Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[ci] migrate Cirrus to Apple Silicon #5693

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
e7389cc
[ci] migrate to Apple Silicon
fkorotkov May 10, 2022
c71b646
Fix RunnerTest config for google_maps_flutter
stuartmorgan-g May 11, 2022
eea37d5
changelog
stuartmorgan-g May 11, 2022
49e16fc
Move some tasks back to Intel
stuartmorgan-g May 11, 2022
e31c427
Log unexpeted FlutterErrors in tests instead of throwing
stuartmorgan-g May 11, 2022
7f6506c
Add temp debug NSLog statements
stuartmorgan-g May 11, 2022
225df85
Remove failed logging, add some details
stuartmorgan-g May 12, 2022
91ea52d
Don't assert for overfullfillment
fkorotkov May 12, 2022
d65a77f
Fullfill only when initialized
fkorotkov May 12, 2022
1ddf2a7
Move linting back to ARM
stuartmorgan-g May 13, 2022
001e214
Log event for debugging
fkorotkov May 13, 2022
5ceab37
Remove NSLog
stuartmorgan-g May 13, 2022
d68340a
Remove duplicate details from error
stuartmorgan-g May 13, 2022
6b47358
video_player changelog
stuartmorgan-g May 13, 2022
9caf835
iPhone 12
fkorotkov May 15, 2022
b490760
Reverted iPhone version
fkorotkov May 15, 2022
7fffeb9
Try Xcode 13.4 and macOS 12.4
fkorotkov May 16, 2022
4e0b259
Revert "Try Xcode 13.4 and macOS 12.4"
fkorotkov May 16, 2022
9713866
Revert "Revert "Try Xcode 13.4 and macOS 12.4""
fkorotkov May 16, 2022
60eb2f5
Try experimental config
fkorotkov May 17, 2022
d9d7875
Revert "Try experimental config"
fkorotkov May 18, 2022
a3771c4
Use only one simulator
fkorotkov May 18, 2022
71e2cb5
Set timeout to not waste resources in case of a hanging
fkorotkov May 18, 2022
d44df7c
[tools] Fix `publish` flag calculation (#5694)
stuartmorgan-g May 14, 2022
8ee7bd8
[camera]handle iOS camera access permission (#5215)
hellohuanlin May 14, 2022
2ccc39e
[image_picker] Fix 'messages.g.h' file not found (#5635)
co-kevin May 16, 2022
29241ad
[ci] Manually roll Flutter master (#5765)
stuartmorgan-g May 16, 2022
1fd508f
Roll Flutter from 036cae36697a to bf7a32628eef (49 revisions) (#5768)
engine-flutter-autoroll May 17, 2022
33934de
Roll Flutter from bf7a32628eef to bb9bbc601345 (1 revision) (#5769)
engine-flutter-autoroll May 17, 2022
63a6039
Roll Flutter from bb9bbc601345 to fd312f1ccff9 (1 revision) (#5770)
engine-flutter-autoroll May 17, 2022
c1c1332
Roll Flutter from fd312f1ccff9 to c248854d176b (1 revision) (#5771)
engine-flutter-autoroll May 17, 2022
f586229
[in_app_purchase] fixed a memory leak error (#5358)
yimao009 May 17, 2022
2656002
[local_auth] Windows support. (#4806)
azchohfi May 17, 2022
9cdd4b5
[google_sign_in_platform_interface] Add availability to mock models (…
Hwan-seok May 17, 2022
74042c0
Update cirrus secret. (#5774)
godofredoc May 17, 2022
18283a7
Add more Android plugin owners (#5624)
stuartmorgan-g May 17, 2022
66e56f0
[video_player]: Bump exoplayer from 2.17.0 to 2.17.1 in /packages/vid…
dependabot[bot] May 17, 2022
9da2a72
[tools] Validate example READMEs (#5775)
stuartmorgan-g May 18, 2022
c62a7ed
[webview_flutter] Initial v4.0 platform interface implementation (#5…
mvanbeusekom May 18, 2022
bd40099
[camera] Request access permission for audio (#5766)
hellohuanlin May 18, 2022
2e81edb
Roll Flutter from c248854d176b to 1994027986cf (1 revision) (#5777)
engine-flutter-autoroll May 18, 2022
f3d955a
[ci/tools] Add iOS/macOS analysis to catch deprecated code (#5778)
stuartmorgan-g May 18, 2022
72c1752
Add more CODEOWNERS (#5779)
stuartmorgan-g May 18, 2022
bf35c1b
[tools] Add `update-release-info` (#5643)
stuartmorgan-g May 18, 2022
dfa3e84
[local_auth] Adds federated Windows support (#5776)
azchohfi May 19, 2022
b0c19f0
[google_sign_in] Upgrade to GoogleSignIn 6.2, support arm64 simulator…
jmagman May 19, 2022
9d1311d
Roll Flutter from 1994027986cf to a4a8e73bce15 (31 revisions) (#5782)
engine-flutter-autoroll May 19, 2022
afc26ec
[ci] Updates iOS deprecation check to iOS 13 (#5786)
stuartmorgan-g May 19, 2022
216b216
[various] Set minimum Flutter versions to 2.8 (#5792)
stuartmorgan-g May 19, 2022
87cd4e7
[google_maps_flutter_web] Remove custom analysis file. (#5791)
ditman May 20, 2022
82cbfc8
[path_provider] Fix integration tests on macOS (#5773)
stuartmorgan-g May 20, 2022
0fcac82
iPhone 12
fkorotkov May 15, 2022
fc971fb
Use only one simulator
fkorotkov May 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2b2cda15293d86d5c27d345505cde25b9efcb153
a4a8e73bce152ab39d6ae839ca51e447f87293fa
68 changes: 47 additions & 21 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gcp_credentials: ENCRYPTED[!2c88dee9c9d9805b214c9f7ad8f3bc8fae936cdb0f881d562101151c408c7e024a41222677d5831df90c60d2dd6cd80a!]
gcp_credentials: ENCRYPTED[!ebad0a1f4f7a446b77944c33651460a7ab010b4617273cb016cf354eb8fc22aa92e37a3c58bfa4a0c40a799351e027a6!]

# Don't run on release tags since it creates O(n^2) tasks where n is the
# number of plugins.
Expand Down Expand Up @@ -57,9 +57,17 @@ macos_template: &MACOS_TEMPLATE
# Only one macOS task can run in parallel without credits, so use them for
# PRs on macOS.
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'

macos_intel_template: &MACOS_INTEL_TEMPLATE
<< : *MACOS_TEMPLATE
osx_instance:
image: big-sur-xcode-13

macos_arm_template: &MACOS_ARM_TEMPLATE
<< : *MACOS_TEMPLATE
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:13.4

# Light-workload Linux tasks.
# These use default machines, with fewer CPUs, to reduce pressure on the
# concurrency limits.
Expand Down Expand Up @@ -298,23 +306,16 @@ task:
drive_script:
- ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml

# macOS tasks.
# ARM macOS tasks.
task:
<< : *MACOS_TEMPLATE
<< : *MACOS_ARM_TEMPLATE
<< : *FLUTTER_UPGRADE_TEMPLATE
matrix:
### iOS+macOS tasks ***
- name: darwin-lint_podspecs
script:
- ./script/tool_runner.sh podspecs
### iOS tasks ###
- name: ios-build_all_plugins
env:
BUILD_ALL_ARGS: "ios --no-codesign"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
- name: ios-platform_tests
env:
PATH: $PATH:/usr/local/bin
Expand All @@ -329,28 +330,22 @@ task:
SIMCTL_CHILD_MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550]
create_simulator_script:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-15-0 | xargs xcrun simctl boot
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-15-4 | xargs xcrun simctl boot
build_script:
- ./script/tool_runner.sh build-examples --ios
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --ios
xcode_analyze_deprecation_script:
# Ensure we don't accidentally introduce deprecated code.
- ./script/tool_runner.sh xcode-analyze --ios --ios-min-version=13.0
native_test_script:
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=Flutter-iPhone,OS=latest"
drive_script:
# `drive-examples` contains integration tests, which changes the UI of the application.
# This UI change sometimes affects `xctest`.
# So we run `drive-examples` after `native-test`; changing the order will result ci failure.
- ./script/tool_runner.sh drive-examples --ios --exclude=script/configs/exclude_integration_ios.yaml
### macOS desktop tasks ###
- name: macos-build_all_plugins
env:
BUILD_ALL_ARGS: "macos"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
setup_script:
- flutter config --enable-macos-desktop
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
- name: macos-platform_tests
env:
matrix:
Expand All @@ -362,7 +357,38 @@ task:
- ./script/tool_runner.sh build-examples --macos
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --macos
xcode_analyze_deprecation_script:
# Ensure we don't accidentally introduce deprecated code.
- ./script/tool_runner.sh xcode-analyze --macos --macos-min-version=12.3
native_test_script:
- ./script/tool_runner.sh native-test --macos
drive_script:
- ./script/tool_runner.sh drive-examples --macos --exclude=script/configs/exclude_integration_macos.yaml

# Intel macOS tasks.
task:
<< : *MACOS_INTEL_TEMPLATE
<< : *FLUTTER_UPGRADE_TEMPLATE
matrix:
### macOS desktop tasks ###
# macos-platform_tests builds all the plugins on M1, so this build is run
# on Intel to give us build coverage of both host types.
- name: macos-build_all_plugins
env:
BUILD_ALL_ARGS: "macos"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
setup_script:
- flutter config --enable-macos-desktop
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
### iOS tasks ###
# ios-platform_tests builds all the plugins on M1, so this build is run
# on Intel to give us build coverage of both host types.
- name: ios-build_all_plugins
env:
BUILD_ALL_ARGS: "ios --no-codesign"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
31 changes: 31 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@
# reviewed by someone else.

# Plugin-level rules.
packages/camera/** @bparrishMines
packages/file_selector/** @stuartmorgan
packages/google_maps_flutter/** @stuartmorgan
packages/google_sign_in/** @stuartmorgan
packages/image_picker/** @stuartmorgan
packages/local_auth/** @stuartmorgan
packages/path_provider/** @gaaclarke
packages/plugin_platform_interface/** @stuartmorgan
packages/quick_actions/** @stuartmorgan
packages/shared_preferences/** @gaaclarke
packages/url_launcher/** @stuartmorgan
packages/video_player/** @gaaclarke
packages/webview_flutter/** @bparrishMines

Expand All @@ -18,6 +27,8 @@ packages/**/*_web/** @ditman

# - Android
packages/camera/camera/android/** @camsim99
packages/espresso/** @blasten
packages/flutter_plugin_android_lifecycle/** @blasten
packages/google_maps_flutter/google_maps_flutter/android/** @GaryQian
packages/google_sign_in/google_sign_in_android/** @camsim99
packages/image_picker/image_picker_android/** @GaryQian
Expand All @@ -42,3 +53,23 @@ packages/shared_preferences/shared_preferences_ios/** @cyanglaz
packages/url_launcher/url_launcher_ios/** @jmagman
packages/video_player/video_player_avfoundation/** @hellohuanlin
packages/webview_flutter/webview_flutter_wkwebview/** @cyanglaz

# - Linux
packages/path_provider/path_provider_linux/** @cbracken
packages/shared_preferences/shared_preferences_linux/** @cbracken
packages/url_launcher/url_launcher_linux/** @cbracken

# - macOS
packages/file_selector/file_selector_macos/** @cbracken
packages/path_provider/path_provider_macos/** @cbracken
packages/shared_preferences/shared_preferences_macos/** @cbracken
packages/url_launcher/url_launcher_macos/** @cbracken

# - Windows
packages/camera/camera_windows/** @cbracken
packages/file_selector/file_selector_windows/** @cbracken
packages/image_picker/image_picker_windows/** @cbracken
packages/local_auth/local_auth_windows/** @cbracken
packages/path_provider/path_provider_windows/** @cbracken
packages/shared_preferences/shared_preferences_windows/** @cbracken
packages/url_launcher/url_launcher_windows/** @cbracken
12 changes: 12 additions & 0 deletions packages/camera/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 0.9.6

* Adds audio access permission handling logic on iOS to fix an issue with `prepareForVideoRecording` not awaiting for the audio permission request result.

## 0.9.5+1

* Suppresses warnings for pre-iOS-11 codepaths.

## 0.9.5

* Adds camera access permission handling logic on iOS to fix a related crash when using the camera for the first time.

## 0.9.4+24

* Fixes preview orientation when pausing preview with locked orientation.
Expand Down
31 changes: 31 additions & 0 deletions packages/camera/camera/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ void didChangeAppLifecycleState(AppLifecycleState state) {
}
```

### Handling camera access permissions

Permission errors may be thrown when initializing the camera controller, and you are expected to handle them properly.

Here is a list of all permission error codes that can be thrown:

- `CameraAccessDenied`: Thrown when user denies the camera access permission.

- `CameraAccessDeniedWithoutPrompt`: iOS only for now. Thrown when user has previously denied the permission. iOS does not allow prompting alert dialog a second time. Users will have to go to Settings > Privacy > Camera in order to enable camera access.

- `CameraAccessRestricted`: iOS only for now. Thrown when camera access is restricted and users cannot grant permission (parental control).

- `AudioAccessDenied`: Thrown when user denies the audio access permission.

- `AudioAccessDeniedWithoutPrompt`: iOS only for now. Thrown when user has previously denied the permission. iOS does not allow prompting alert dialog a second time. Users will have to go to Settings > Privacy > Microphone in order to enable audio access.

- `AudioAccessRestricted`: iOS only for now. Thrown when audio access is restricted and users cannot grant permission (parental control).

- `cameraPermission`: Android and Web only. A legacy error code for all kinds of camera permission errors.

### Example

Here is a small example flutter app displaying a full screen camera preview.
Expand Down Expand Up @@ -119,6 +139,17 @@ class _CameraAppState extends State<CameraApp> {
return;
}
setState(() {});
}).catchError((Object e) {
if (e is CameraException) {
switch (e.code) {
case 'CameraAccessDenied':
print('User denied camera access.');
break;
default:
print('Handle other errors.');
break;
}
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -26,6 +26,7 @@
E04F108627A87CA600573D0C /* FLTSavePhotoDelegateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E04F108527A87CA600573D0C /* FLTSavePhotoDelegateTests.m */; };
E071CF7227B3061B006EF3BA /* FLTCamPhotoCaptureTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E071CF7127B3061B006EF3BA /* FLTCamPhotoCaptureTests.m */; };
E071CF7427B31DE4006EF3BA /* FLTCamSampleBufferTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E071CF7327B31DE4006EF3BA /* FLTCamSampleBufferTests.m */; };
E0B0D2BB27DFF2AF00E71E4B /* CameraPermissionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E0B0D2BA27DFF2AF00E71E4B /* CameraPermissionTests.m */; };
E0C6E2002770F01A00EA6AA3 /* ThreadSafeMethodChannelTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E0C6E1FD2770F01A00EA6AA3 /* ThreadSafeMethodChannelTests.m */; };
E0C6E2012770F01A00EA6AA3 /* ThreadSafeTextureRegistryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E0C6E1FE2770F01A00EA6AA3 /* ThreadSafeTextureRegistryTests.m */; };
E0C6E2022770F01A00EA6AA3 /* ThreadSafeEventChannelTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E0C6E1FF2770F01A00EA6AA3 /* ThreadSafeEventChannelTests.m */; };
Expand Down Expand Up @@ -91,6 +92,7 @@
E04F108527A87CA600573D0C /* FLTSavePhotoDelegateTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FLTSavePhotoDelegateTests.m; sourceTree = "<group>"; };
E071CF7127B3061B006EF3BA /* FLTCamPhotoCaptureTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FLTCamPhotoCaptureTests.m; sourceTree = "<group>"; };
E071CF7327B31DE4006EF3BA /* FLTCamSampleBufferTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FLTCamSampleBufferTests.m; sourceTree = "<group>"; };
E0B0D2BA27DFF2AF00E71E4B /* CameraPermissionTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CameraPermissionTests.m; sourceTree = "<group>"; };
E0C6E1FD2770F01A00EA6AA3 /* ThreadSafeMethodChannelTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThreadSafeMethodChannelTests.m; sourceTree = "<group>"; };
E0C6E1FE2770F01A00EA6AA3 /* ThreadSafeTextureRegistryTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThreadSafeTextureRegistryTests.m; sourceTree = "<group>"; };
E0C6E1FF2770F01A00EA6AA3 /* ThreadSafeEventChannelTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThreadSafeEventChannelTests.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -136,6 +138,7 @@
E04F108527A87CA600573D0C /* FLTSavePhotoDelegateTests.m */,
E071CF7127B3061B006EF3BA /* FLTCamPhotoCaptureTests.m */,
E071CF7327B31DE4006EF3BA /* FLTCamSampleBufferTests.m */,
E0B0D2BA27DFF2AF00E71E4B /* CameraPermissionTests.m */,
E01EE4A72799F3A5008C1950 /* QueueUtilsTests.m */,
E0CDBAC027CD9729002561D9 /* CameraTestUtils.h */,
E0CDBAC127CD9729002561D9 /* CameraTestUtils.m */,
Expand Down Expand Up @@ -422,6 +425,7 @@
788A065A27B0E02900533D74 /* StreamingTest.m in Sources */,
E0C6E2022770F01A00EA6AA3 /* ThreadSafeEventChannelTests.m in Sources */,
E0C6E2012770F01A00EA6AA3 /* ThreadSafeTextureRegistryTests.m in Sources */,
E0B0D2BB27DFF2AF00E71E4B /* CameraPermissionTests.m in Sources */,
E0C6E2002770F01A00EA6AA3 /* ThreadSafeMethodChannelTests.m in Sources */,
E01EE4A82799F3A5008C1950 /* QueueUtilsTests.m in Sources */,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ - (void)testFixForCaptureSessionQueueNullPointerCrashDueToRaceCondition {
result:^(id _Nullable result) {
[disposeExpectation fulfill];
}];
[camera handleMethodCall:createCall
result:^(id _Nullable result) {
[createExpectation fulfill];
}];
[camera createCameraOnSessionQueueWithCreateMethodCall:createCall
result:[[FLTThreadSafeFlutterResult alloc]
initWithResult:^(id _Nullable result) {
[createExpectation fulfill];
}]];
[self waitForExpectationsWithTimeout:1 handler:nil];
// `captureSessionQueue` must not be nil after `create` call. Otherwise a nil
// `captureSessionQueue` passed into `AVCaptureVideoDataOutput::setSampleBufferDelegate:queue:`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ @implementation CameraMethodChannelTests
- (void)testCreate_ShouldCallResultOnMainThread {
CameraPlugin *camera = [[CameraPlugin alloc] initWithRegistry:nil messenger:nil];

XCTestExpectation *expectation =
[[XCTestExpectation alloc] initWithDescription:@"Result finished"];
XCTestExpectation *expectation = [self expectationWithDescription:@"Result finished"];

// Set up mocks for initWithCameraName method
id avCaptureDeviceInputMock = OCMClassMock([AVCaptureDeviceInput class]);
Expand All @@ -37,7 +36,8 @@ - (void)testCreate_ShouldCallResultOnMainThread {
methodCallWithMethodName:@"create"
arguments:@{@"resolutionPreset" : @"medium", @"enableAudio" : @(1)}];

[camera handleMethodCallAsync:call result:resultObject];
[camera createCameraOnSessionQueueWithCreateMethodCall:call result:resultObject];
[self waitForExpectationsWithTimeout:1 handler:nil];

// Verify the result
NSDictionary *dictionaryResult = (NSDictionary *)resultObject.receivedResult;
Expand Down
Loading