Skip to content

Commit 23cd9ff

Browse files
okorohelijahMylioScott
authored andcommitted
Fix Xcode 27 lipo verification failure for Darwin frameworks (flutter#188625)
This PR fixes a blocking build failure encountered when building iOS and macOS apps using the Xcode 27 toolchain. *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* Fixes flutter#188346, flutter#188461 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] 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]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent ad9c3ff commit 23cd9ff

3 files changed

Lines changed: 24 additions & 26 deletions

File tree

‎packages/flutter_tools/lib/src/build_system/targets/darwin.dart‎

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,22 @@ abstract class UnpackDarwin extends Target {
6969
]);
7070
final lipoInfo = infoResult.stdout as String;
7171

72-
final ProcessResult verifyResult = await environment.processManager.run(<String>[
73-
'lipo',
74-
frameworkBinaryPath,
75-
'-verify_arch',
76-
...archList,
77-
]);
78-
79-
if (verifyResult.exitCode != 0) {
80-
throw Exception(
81-
'Binary $frameworkBinaryPath does not contain architectures "$archs".\n'
82-
'\n'
83-
'lipo -info:\n'
84-
'$lipoInfo',
85-
);
72+
for (final arch in archList) {
73+
final ProcessResult verifyResult = await environment.processManager.run(<String>[
74+
'lipo',
75+
frameworkBinaryPath,
76+
'-verify_arch',
77+
arch,
78+
]);
79+
80+
if (verifyResult.exitCode != 0) {
81+
throw Exception(
82+
'Binary $frameworkBinaryPath does not contain architecture "$arch" (expected "$archs").\n'
83+
'\n'
84+
'lipo -info:\n'
85+
'$lipoInfo',
86+
);
87+
}
8688
}
8789

8890
// Skip thinning for non-fat executables.

‎packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -978,10 +978,7 @@ void main() {
978978
command: <String>['lipo', '-info', binary.path],
979979
stdout: 'Architectures in the fat file:',
980980
),
981-
FakeCommand(
982-
command: <String>['lipo', binary.path, '-verify_arch', 'arm64', 'x86_64'],
983-
exitCode: 1,
984-
),
981+
FakeCommand(command: <String>['lipo', binary.path, '-verify_arch', 'arm64'], exitCode: 1),
985982
]);
986983

987984
await expectLater(
@@ -991,7 +988,7 @@ void main() {
991988
(Exception exception) => exception.toString(),
992989
'description',
993990
contains(
994-
'does not contain architectures "arm64 x86_64".\n\n'
991+
'does not contain architecture "arm64" (expected "arm64 x86_64").\n\n'
995992
'lipo -info:\nArchitectures in the fat file:',
996993
),
997994
),
@@ -1018,7 +1015,8 @@ void main() {
10181015
command: <String>['lipo', '-info', binary.path],
10191016
stdout: 'Architectures in the fat file:',
10201017
),
1021-
FakeCommand(command: <String>['lipo', binary.path, '-verify_arch', 'arm64', 'x86_64']),
1018+
FakeCommand(command: <String>['lipo', binary.path, '-verify_arch', 'arm64']),
1019+
FakeCommand(command: <String>['lipo', binary.path, '-verify_arch', 'x86_64']),
10221020
FakeCommand(
10231021
command: <String>[
10241022
'lipo',
@@ -1182,7 +1180,8 @@ void main() {
11821180
command: <String>['lipo', '-info', binary.path],
11831181
stdout: 'Architectures in the fat file:',
11841182
),
1185-
FakeCommand(command: <String>['lipo', binary.path, '-verify_arch', 'arm64', 'x86_64']),
1183+
FakeCommand(command: <String>['lipo', binary.path, '-verify_arch', 'arm64']),
1184+
FakeCommand(command: <String>['lipo', binary.path, '-verify_arch', 'x86_64']),
11861185
FakeCommand(
11871186
command: <String>[
11881187
'lipo',

‎packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,7 @@ void main() {
248248
processManager.addCommands(<FakeCommand>[
249249
copyFrameworkCommand,
250250
lipoInfoFatCommand,
251-
FakeCommand(
252-
command: <String>['lipo', binary.path, '-verify_arch', 'arm64', 'x86_64'],
253-
exitCode: 1,
254-
),
251+
FakeCommand(command: <String>['lipo', binary.path, '-verify_arch', 'arm64'], exitCode: 1),
255252
]);
256253

257254
await expectLater(
@@ -261,7 +258,7 @@ void main() {
261258
(Exception exception) => exception.toString(),
262259
'description',
263260
contains(
264-
'does not contain architectures "arm64 x86_64".\n\nlipo -info:\nArchitectures in the fat file:',
261+
'does not contain architecture "arm64" (expected "arm64 x86_64").\n\nlipo -info:\nArchitectures in the fat file:',
265262
),
266263
),
267264
),

0 commit comments

Comments
 (0)