Handle CocoaPods ffi stderr (#102327)

This commit is contained in:
Jenn Magder 2022-04-21 15:49:08 -07:00 committed by GitHub
parent c73100bfae
commit c9825d24dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -349,10 +349,11 @@ class CocoaPods {
} }
void _diagnosePodInstallFailure(ProcessResult result) { void _diagnosePodInstallFailure(ProcessResult result) {
if (result.stdout is! String) { final Object? stdout = result.stdout;
final Object? stderr = result.stderr;
if (stdout is! String || stderr is! String) {
return; return;
} }
final String stdout = result.stdout as String;
if (stdout.contains('out-of-date source repos')) { if (stdout.contains('out-of-date source repos')) {
_logger.printError( _logger.printError(
"Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.\n" "Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.\n"
@ -360,7 +361,7 @@ class CocoaPods {
' pod repo update\n', ' pod repo update\n',
emphasis: true, emphasis: true,
); );
} else if ((stdout.contains('ffi_c.bundle') || stdout.contains('/ffi/')) && } else if ((stderr.contains('ffi_c.bundle') || stderr.contains('/ffi/')) &&
_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(

View File

@ -514,7 +514,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
'LANG': 'en_US.UTF-8', 'LANG': 'en_US.UTF-8',
}, },
exitCode: 1, exitCode: 1,
stdout: cocoaPodsError, stderr: cocoaPodsError,
), ),
const FakeCommand( const FakeCommand(
command: <String>['which', 'sysctl'], command: <String>['which', 'sysctl'],