Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Nov 29, 2021

CocoaPods crashes on ARM Macs if the x86 version of the ffi gem isn't installed.

#70801 detected one crash, but there have been additional crash messages reported. Parse LoadError and the file in question ffi_c.bundle so users get a prompt in both cases about how to fix it (with sudo so we can't just do it ourselves)

Fixes #93908.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Nov 29, 2021
@jmagman jmagman self-assigned this Nov 29, 2021
@google-cla google-cla bot added the cla: yes label Nov 29, 2021
);
expect(usage.events, contains(const TestUsageEvent('pod-install-failure', 'arm-ffi')));
final Map<String, String> possibleErrors = <String, String>{
'symbol not found': 'LoadError - dlsym(0x7fbbeb6837d0, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle',
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the original message.

expect(usage.events, contains(const TestUsageEvent('pod-install-failure', 'arm-ffi')));
final Map<String, String> possibleErrors = <String, String>{
'symbol not found': 'LoadError - dlsym(0x7fbbeb6837d0, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle',
'incompatible architecture': "LoadError - (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/ffi_c.bundle' (no such file) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle",
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the new one.
Screen Shot 2021-11-29 at 4 00 38 PM

'incompatible architecture': "LoadError - (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/ffi_c.bundle' (no such file) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle",
};
possibleErrors.forEach((String errorName, String cocoaPodsError) {
testUsingContext('ffi $errorName failure on ARM macOS prompts gem install', () async {
Copy link
Member Author

Choose a reason for hiding this comment

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

Same test, two different errors to parse.

);
} else if (stdout.contains('Init_ffi_c') &&
stdout.contains('symbol not found') &&
} else if (stdout.contains('ffi_c.bundle') && stdout.contains('LoadError') &&
Copy link
Member Author

Choose a reason for hiding this comment

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

Both reported errors contain ffi_c.bundle and LoadError.

@jmagman
Copy link
Member Author

jmagman commented Dec 7, 2021

Friendly ping @christopherfujino

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

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

Labels

platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[google_sign_in]IOS build fails with error: building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64

3 participants