Skip to content

Commit 0cf4033

Browse files
authored
Switch iOS gen_snapshot from multi-arch binary to multiple binaries (#37445)
* Switch iOS gen_snapshot from multi-arch binary to multiple binaries * Make snapshotterPath mutable
1 parent 84fe2ad commit 0cf4033

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/flutter_tools/lib/src/base/build.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,12 @@ class GenSnapshot {
5454
...additionalArgs,
5555
];
5656

57-
final String snapshotterPath = getSnapshotterPath(snapshotType);
57+
String snapshotterPath = getSnapshotterPath(snapshotType);
5858

59-
// iOS gen_snapshot is a multi-arch binary. Running as an i386 binary will
60-
// generate armv7 code. Running as an x86_64 binary will generate arm64
61-
// code. /usr/bin/arch can be used to run binaries with the specified
62-
// architecture.
59+
// iOS has a separate gen_snapshot for armv7 and arm64 in the same,
60+
// directory. So we need to select the right one.
6361
if (snapshotType.platform == TargetPlatform.ios) {
64-
final String hostArch = iosArch == IOSArch.armv7 ? '-i386' : '-x86_64';
65-
return runCommandAndStreamOutput(<String>['/usr/bin/arch', hostArch, snapshotterPath, ...args]);
62+
snapshotterPath += '_' + getNameForIOSArch(iosArch);
6663
}
6764

6865
StringConverter outputFilter;

0 commit comments

Comments
 (0)