Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Jul 29, 2021

If any plugins declare they do not support arm64 simulators, also mark the entire iOS app as not supporting arm64 simulators to avoid compilation failures. This will cause the app to run in x64 Rosetta translation mode.

Parse the output of

xcrun xcodebuild -alltargets -sdk iphonesimulator -project ios/Pods/Pods.xcodeproj -showBuildSettings

Plugins will be expected to add this to their podspec:

  s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }

google_maps_flutter: #87242
google_sign_in: #87243

Fixes #85713

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. t: xcode "xcodebuild" on iOS and general Xcode project management labels Jul 29, 2021
@jmagman jmagman self-assigned this Jul 29, 2021
@google-cla google-cla bot added the cla: yes label Jul 29, 2021
@orestesgaolin
Copy link
Contributor

Will fix #87201 as well

@jmagman jmagman requested a review from stuartmorgan-g July 29, 2021 17:31
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jmagman
Copy link
Member Author

jmagman commented Jul 29, 2021

Ugh, this isn't going to work, the plugin build settings from the podspec are generated into an xcconfig, for example ios/Pods/Target Support Files/google_sign_in/google_sign_in.debug.xcconfig, not the Pods project (I was testing this incorrectly).

@jmagman jmagman requested a review from jonahwilliams July 30, 2021 01:32
@jmagman
Copy link
Member Author

jmagman commented Jul 30, 2021

I rewrote this to call xcodebuild instead of parsing the Xcode project.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with typo fix

'-project',
podXcodeProject.path,
'-showBuildSettings',
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: you've got a lot of copies of this very long command; it might be helpful to have a little utility method that takes output (and an optional exit code) and builds the FakeCommand, to make the tests a bit less verbose and easier to update if the argument list needs to be changed slightly in the future.

Copy link
Member Author

@jmagman jmagman Jul 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the hw.optional.arm64: 1 command into a constant which cleaned it up a bit. Generally I prefer seeing the "important" command inline in the test rather than trying to keep tests DRY. That's just preference though. Fortunately the test will start failing if the arguments ever change, so it's usually really easy to update even in a few places.

@jmagman
Copy link
Member Author

jmagman commented Jul 30, 2021

The tree is green, not sure why the luci-flutter has been red so long. Merging...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform-host-arm Building on an ARM-based platform platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When plugins do not support ARM iOS simulators, the app fails to build

3 participants