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
This commit is contained in:
Liam Appelbe 2019-08-02 07:43:07 -07:00 committed by GitHub
parent 84fe2adedb
commit 0cf4033404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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