Fix the gen_snapshot path for a local_engine FLX build in debug mode (#8754)
gen_snapshot is now used for both JIT and AOT snapshots. The JIT version
used in debug mode will be a 64-bit binary.
diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart
index ada47c8..d0dd1fd 100644
--- a/packages/flutter_tools/lib/src/artifacts.dart
+++ b/packages/flutter_tools/lib/src/artifacts.dart
@@ -89,7 +89,6 @@
case TargetPlatform.darwin_x64:
case TargetPlatform.linux_x64:
case TargetPlatform.windows_x64:
- assert(mode == null, 'Platform $platform does not support different build modes.');
return _getHostArtifactPath(artifact, platform);
}
assert(false, 'Invalid platform $platform.');
@@ -221,7 +220,7 @@
final String abi = _getAbiDirectory(platform);
return fs.path.join(engineOutPath, 'gen', 'flutter', 'shell', 'platform', 'android', 'android', fs.path.join('android', 'libs', abi, _artifactToFileName(artifact)));
case Artifact.genSnapshot:
- return _genSnapshotPath(platform);
+ return _genSnapshotPath(platform, mode);
case Artifact.skyShell:
return _skyShellPath(platform);
case Artifact.isolateSnapshotData:
@@ -240,9 +239,9 @@
return fs.path.basename(engineOutPath);
}
- String _genSnapshotPath(TargetPlatform platform) {
+ String _genSnapshotPath(TargetPlatform platform, BuildMode mode) {
String clang;
- if (platform == TargetPlatform.ios) {
+ if (platform == TargetPlatform.ios || mode == BuildMode.debug) {
clang = 'clang_x64';
} else {
clang = getCurrentHostPlatform() == HostPlatform.darwin_x64 ? 'clang_i386' : 'clang_x86';
diff --git a/packages/flutter_tools/lib/src/flx.dart b/packages/flutter_tools/lib/src/flx.dart
index 5b67cf4..1009223 100644
--- a/packages/flutter_tools/lib/src/flx.dart
+++ b/packages/flutter_tools/lib/src/flx.dart
@@ -36,7 +36,7 @@
assert(mainPath != null);
assert(snapshotPath != null);
assert(packages != null);
- final String snapshotterPath = artifacts.getArtifactPath(Artifact.genSnapshot);
+ final String snapshotterPath = artifacts.getArtifactPath(Artifact.genSnapshot, null, BuildMode.debug);
final String vmSnapshotData = artifacts.getArtifactPath(Artifact.vmSnapshotData);
final String isolateSnapshotData = artifacts.getArtifactPath(Artifact.isolateSnapshotData);