Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
c4ef0723
Unverified
Commit
c4ef0723
authored
Feb 28, 2023
by
Todd Volkert
Committed by
GitHub
Feb 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cocoapods ffi error can be in stdout or stderr (#121470)
Cocoapods ffi error can be in stdout or stderr
parent
2c3fa082
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
46 deletions
+61
-46
cocoapods.dart
packages/flutter_tools/lib/src/macos/cocoapods.dart
+5
-1
cocoapods_test.dart
...lutter_tools/test/general.shard/macos/cocoapods_test.dart
+56
-45
No files found.
packages/flutter_tools/lib/src/macos/cocoapods.dart
View file @
c4ef0723
...
...
@@ -361,7 +361,7 @@ class CocoaPods {
' pod repo update
\n
'
,
emphasis:
true
,
);
}
else
if
((
stderr
.
contains
(
'ffi_c.bundle'
)
||
stderr
.
contains
(
'/ffi/'
))
&&
}
else
if
((
_isFfiX86Error
(
stdout
)
||
_isFfiX86Error
(
stderr
))
&&
_operatingSystemUtils
.
hostPlatform
==
HostPlatform
.
darwin_arm64
)
{
// https://github.com/flutter/flutter/issues/70796
UsageEvent
(
...
...
@@ -377,6 +377,10 @@ class CocoaPods {
}
}
bool
_isFfiX86Error
(
String
error
)
{
return
error
.
contains
(
'ffi_c.bundle'
)
||
error
.
contains
(
'/ffi/'
);
}
void
_warnIfPodfileOutOfDate
(
XcodeBasedProject
xcodeProject
)
{
final
bool
isIos
=
xcodeProject
is
IosProject
;
if
(
isIos
)
{
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
View file @
c4ef0723
...
...
@@ -19,6 +19,11 @@ import '../../src/common.dart';
import
'../../src/context.dart'
;
import
'../../src/fake_process_manager.dart'
;
enum
_StdioStream
{
stdout
,
stderr
,
}
void
main
(
)
{
late
FileSystem
fileSystem
;
late
FakeProcessManager
fakeProcessManager
;
...
...
@@ -492,51 +497,57 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
'bus error'
:
'/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275: [BUG] Bus Error at 0x000000010072c000'
,
};
possibleErrors
.
forEach
((
String
errorName
,
String
cocoaPodsError
)
{
testUsingContext
(
'ffi
$errorName
failure on ARM macOS prompts gem install'
,
()
async
{
final
FlutterProject
projectUnderTest
=
setupProjectUnderTest
();
pretendPodIsInstalled
();
pretendPodVersionIs
(
'100.0.0'
);
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
..
createSync
()
..
writeAsStringSync
(
'Existing Podfile'
);
fakeProcessManager
.
addCommands
(<
FakeCommand
>[
FakeCommand
(
command:
const
<
String
>[
'pod'
,
'install'
,
'--verbose'
],
workingDirectory:
'project/ios'
,
environment:
const
<
String
,
String
>{
'COCOAPODS_DISABLE_STATS'
:
'true'
,
'LANG'
:
'en_US.UTF-8'
,
},
exitCode:
1
,
stderr:
cocoaPodsError
,
),
const
FakeCommand
(
command:
<
String
>[
'which'
,
'sysctl'
],
),
const
FakeCommand
(
command:
<
String
>[
'sysctl'
,
'hw.optional.arm64'
],
stdout:
'hw.optional.arm64: 1'
,
),
]);
await
expectToolExitLater
(
cocoaPodsUnderTest
.
processPods
(
xcodeProject:
projectUnderTest
.
ios
,
buildMode:
BuildMode
.
debug
,
),
equals
(
'Error running pod install'
),
);
expect
(
logger
.
errorText
,
contains
(
'set up CocoaPods for ARM macOS'
),
);
expect
(
logger
.
errorText
,
contains
(
'enable-libffi-alloc'
),
);
expect
(
usage
.
events
,
contains
(
const
TestUsageEvent
(
'pod-install-failure'
,
'arm-ffi'
)));
});
void
testToolExitsWithCocoapodsMessage
(
_StdioStream
outputStream
)
{
final
String
streamName
=
outputStream
==
_StdioStream
.
stdout
?
'stdout'
:
'stderr'
;
testUsingContext
(
'ffi
$errorName
failure to
$streamName
on ARM macOS prompts gem install'
,
()
async
{
final
FlutterProject
projectUnderTest
=
setupProjectUnderTest
();
pretendPodIsInstalled
();
pretendPodVersionIs
(
'100.0.0'
);
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
..
createSync
()
..
writeAsStringSync
(
'Existing Podfile'
);
fakeProcessManager
.
addCommands
(<
FakeCommand
>[
FakeCommand
(
command:
const
<
String
>[
'pod'
,
'install'
,
'--verbose'
],
workingDirectory:
'project/ios'
,
environment:
const
<
String
,
String
>{
'COCOAPODS_DISABLE_STATS'
:
'true'
,
'LANG'
:
'en_US.UTF-8'
,
},
exitCode:
1
,
stdout:
outputStream
==
_StdioStream
.
stdout
?
cocoaPodsError
:
''
,
stderr:
outputStream
==
_StdioStream
.
stderr
?
cocoaPodsError
:
''
,
),
const
FakeCommand
(
command:
<
String
>[
'which'
,
'sysctl'
],
),
const
FakeCommand
(
command:
<
String
>[
'sysctl'
,
'hw.optional.arm64'
],
stdout:
'hw.optional.arm64: 1'
,
),
]);
await
expectToolExitLater
(
cocoaPodsUnderTest
.
processPods
(
xcodeProject:
projectUnderTest
.
ios
,
buildMode:
BuildMode
.
debug
,
),
equals
(
'Error running pod install'
),
);
expect
(
logger
.
errorText
,
contains
(
'set up CocoaPods for ARM macOS'
),
);
expect
(
logger
.
errorText
,
contains
(
'enable-libffi-alloc'
),
);
expect
(
usage
.
events
,
contains
(
const
TestUsageEvent
(
'pod-install-failure'
,
'arm-ffi'
)));
});
}
testToolExitsWithCocoapodsMessage
(
_StdioStream
.
stdout
);
testToolExitsWithCocoapodsMessage
(
_StdioStream
.
stderr
);
});
testUsingContext
(
'ffi failure on x86 macOS does not prompt gem install'
,
()
async
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment