Detect additional ARM ffi CocoaPods error (#94385)
This commit is contained in:
parent
e05ddcbd9e
commit
f7bd20fc09
@ -360,8 +360,7 @@ class CocoaPods {
|
|||||||
' pod repo update\n',
|
' pod repo update\n',
|
||||||
emphasis: true,
|
emphasis: true,
|
||||||
);
|
);
|
||||||
} else if (stdout.contains('Init_ffi_c') &&
|
} else if (stdout.contains('ffi_c.bundle') && stdout.contains('LoadError') &&
|
||||||
stdout.contains('symbol not found') &&
|
|
||||||
_operatingSystemUtils.hostPlatform == HostPlatform.darwin_arm) {
|
_operatingSystemUtils.hostPlatform == HostPlatform.darwin_arm) {
|
||||||
// https://github.com/flutter/flutter/issues/70796
|
// https://github.com/flutter/flutter/issues/70796
|
||||||
UsageEvent(
|
UsageEvent(
|
||||||
|
@ -491,46 +491,52 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext('ffi failure on ARM macOS prompts gem install', () async {
|
final Map<String, String> possibleErrors = <String, String>{
|
||||||
final FlutterProject projectUnderTest = setupProjectUnderTest();
|
'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',
|
||||||
pretendPodIsInstalled();
|
'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",
|
||||||
pretendPodVersionIs('1.10.0');
|
};
|
||||||
fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile'))
|
possibleErrors.forEach((String errorName, String cocoaPodsError) {
|
||||||
..createSync()
|
testUsingContext('ffi $errorName failure on ARM macOS prompts gem install', () async {
|
||||||
..writeAsStringSync('Existing Podfile');
|
final FlutterProject projectUnderTest = setupProjectUnderTest();
|
||||||
|
pretendPodIsInstalled();
|
||||||
|
pretendPodVersionIs('1.10.0');
|
||||||
|
fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile'))
|
||||||
|
..createSync()
|
||||||
|
..writeAsStringSync('Existing Podfile');
|
||||||
|
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
const FakeCommand(
|
FakeCommand(
|
||||||
command: <String>['pod', 'install', '--verbose'],
|
command: const <String>['pod', 'install', '--verbose'],
|
||||||
workingDirectory: 'project/ios',
|
workingDirectory: 'project/ios',
|
||||||
environment: <String, String>{
|
environment: const <String, String>{
|
||||||
'COCOAPODS_DISABLE_STATS': 'true',
|
'COCOAPODS_DISABLE_STATS': 'true',
|
||||||
'LANG': 'en_US.UTF-8',
|
'LANG': 'en_US.UTF-8',
|
||||||
},
|
},
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
stdout: 'LoadError - dlsym(0x7fbbeb6837d0, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle',
|
stdout: cocoaPodsError,
|
||||||
),
|
),
|
||||||
const FakeCommand(
|
const FakeCommand(
|
||||||
command: <String>['which', 'sysctl'],
|
command: <String>['which', 'sysctl'],
|
||||||
),
|
),
|
||||||
const FakeCommand(
|
const FakeCommand(
|
||||||
command: <String>['sysctl', 'hw.optional.arm64'],
|
command: <String>['sysctl', 'hw.optional.arm64'],
|
||||||
stdout: 'hw.optional.arm64: 1',
|
stdout: 'hw.optional.arm64: 1',
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
await expectToolExitLater(
|
await expectToolExitLater(
|
||||||
cocoaPodsUnderTest.processPods(
|
cocoaPodsUnderTest.processPods(
|
||||||
xcodeProject: projectUnderTest.ios,
|
xcodeProject: projectUnderTest.ios,
|
||||||
buildMode: BuildMode.debug,
|
buildMode: BuildMode.debug,
|
||||||
),
|
),
|
||||||
equals('Error running pod install'),
|
equals('Error running pod install'),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
logger.errorText,
|
logger.errorText,
|
||||||
contains('set up CocoaPods for ARM macOS'),
|
contains('set up CocoaPods for ARM macOS'),
|
||||||
);
|
);
|
||||||
expect(usage.events, contains(const TestUsageEvent('pod-install-failure', 'arm-ffi')));
|
expect(usage.events, contains(const TestUsageEvent('pod-install-failure', 'arm-ffi')));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext('ffi failure on x86 macOS does not prompt gem install', () async {
|
testUsingContext('ffi failure on x86 macOS does not prompt gem install', () async {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user