Use the AOT snapshot built by the Dart SDK for the frontend server (#51943)
Dart will be removing the frontend server JIT snapshot.
(see https://dart.googlesource.com/sdk/+/e6c9eaaf6b63e5d3d0eefd7e95df9d10d9a25569)
diff --git a/build/archives/BUILD.gn b/build/archives/BUILD.gn
index fb7f829..38637ad 100644
--- a/build/archives/BUILD.gn
+++ b/build/archives/BUILD.gn
@@ -108,8 +108,8 @@
destination = "vm_isolate_snapshot.bin"
},
{
- source = "$root_gen_dir/frontend_server.dart.snapshot"
- destination = "frontend_server.dart.snapshot"
+ source = "$root_gen_dir/frontend_server_aot.dart.snapshot"
+ destination = "frontend_server_aot.dart.snapshot"
},
]
}
diff --git a/build/dart/rules.gni b/build/dart/rules.gni
index ec70bac..c8242de 100644
--- a/build/dart/rules.gni
+++ b/build/dart/rules.gni
@@ -94,9 +94,10 @@
if (is_win) {
ext = ".exe"
}
- dart = rebase_path("$host_prebuilt_dart_sdk/bin/dart$ext", root_out_dir)
+ dart = rebase_path("$host_prebuilt_dart_sdk/bin/dartaotruntime$ext",
+ root_out_dir)
frontend_server =
- rebase_path("$root_gen_dir/frontend_server.dart.snapshot")
+ rebase_path("$root_gen_dir/frontend_server_aot.dart.snapshot")
args = [ dart ] + common_vm_args + [ frontend_server ] + common_args
}
diff --git a/flutter_frontend_server/BUILD.gn b/flutter_frontend_server/BUILD.gn
index 9ba5ee2..7d7f0c2 100644
--- a/flutter_frontend_server/BUILD.gn
+++ b/flutter_frontend_server/BUILD.gn
@@ -7,13 +7,12 @@
copy("frontend_server") {
if (flutter_prebuilt_dart_sdk) {
- snapshot =
- "$host_prebuilt_dart_sdk/bin/snapshots/frontend_server.dart.snapshot"
+ snapshot = "$host_prebuilt_dart_sdk/bin/snapshots/frontend_server_aot.dart.snapshot"
} else {
- deps = [ "$dart_src/utils/kernel-service:frontend_server" ]
- snapshot = "$root_out_dir/frontend_server.dart.snapshot"
+ deps = [ "$dart_src/utils/kernel-service:frontend_server_aot" ]
+ snapshot = "$root_out_dir/frontend_server_aot.dart.snapshot"
}
sources = [ snapshot ]
- outputs = [ "$root_gen_dir/frontend_server.dart.snapshot" ]
+ outputs = [ "$root_gen_dir/frontend_server_aot.dart.snapshot" ]
}
diff --git a/flutter_frontend_server/test/to_string_test.dart b/flutter_frontend_server/test/to_string_test.dart
index ded3b98..2cd8935 100644
--- a/flutter_frontend_server/test/to_string_test.dart
+++ b/flutter_frontend_server/test/to_string_test.dart
@@ -16,6 +16,7 @@
}
final String dart = Platform.resolvedExecutable;
+ final String dartaotruntime = path.join(path.dirname(Platform.resolvedExecutable), 'dartaotruntime');
final String buildDir = args[0];
final String frontendServer = args[1];
final String sdkRoot = args[2];
@@ -35,7 +36,7 @@
}
test('Without flag', () {
- checkProcessResult(Process.runSync(dart, <String>[
+ checkProcessResult(Process.runSync(dartaotruntime, <String>[
frontendServer,
'--sdk-root=$sdkRoot',
'--target=flutter',
@@ -59,7 +60,7 @@
});
test('With flag', () {
- checkProcessResult(Process.runSync(dart, <String>[
+ checkProcessResult(Process.runSync(dartaotruntime, <String>[
frontendServer,
'--sdk-root=$sdkRoot',
'--target=flutter',
diff --git a/shell/platform/fuchsia/BUILD.gn b/shell/platform/fuchsia/BUILD.gn
index 4de6e16..12a22f3 100644
--- a/shell/platform/fuchsia/BUILD.gn
+++ b/shell/platform/fuchsia/BUILD.gn
@@ -60,7 +60,7 @@
_frontend_server_path =
rebase_path(get_label_info(_frontend_server_label, "root_gen_dir") +
- "/frontend_server.dart.snapshot")
+ "/frontend_server_aot.dart.snapshot")
_list_libraries_path =
rebase_path(get_label_info(_list_libraries_label, "root_gen_dir") +
diff --git a/testing/run_tests.py b/testing/run_tests.py
index 9ec10f5..dc04e6d 100755
--- a/testing/run_tests.py
+++ b/testing/run_tests.py
@@ -932,7 +932,7 @@
os.path.join('flutter', 'flutter_frontend_server'),
[
build_dir,
- os.path.join(build_dir, 'gen', 'frontend_server.dart.snapshot'),
+ os.path.join(build_dir, 'gen', 'frontend_server_aot.dart.snapshot'),
os.path.join(build_dir, 'flutter_patched_sdk')
],
),
@@ -949,7 +949,7 @@
(
os.path.join('flutter', 'tools', 'const_finder'),
[
- os.path.join(build_dir, 'gen', 'frontend_server.dart.snapshot'),
+ os.path.join(build_dir, 'gen', 'frontend_server_aot.dart.snapshot'),
os.path.join(build_dir, 'flutter_patched_sdk'),
os.path.join(build_dir, 'dart-sdk', 'lib', 'libraries.json'),
],
diff --git a/tools/const_finder/test/const_finder_test.dart b/tools/const_finder/test/const_finder_test.dart
index 18e237f..0731b17 100644
--- a/tools/const_finder/test/const_finder_test.dart
+++ b/tools/const_finder/test/const_finder_test.dart
@@ -45,6 +45,7 @@
// This test is assuming the `dart` used to invoke the tests is compatible
// with the version of package:kernel in //third-party/dart/pkg/kernel
final String dart = Platform.resolvedExecutable;
+final String dartaotruntime = path.join(path.dirname(Platform.resolvedExecutable), 'dartaotruntime');
void _checkRecursion(String dillPath, Compiler compiler) {
stdout.writeln('Checking recursive calls.');
@@ -443,7 +444,7 @@
}
void _compileAOTDill() {
- checkProcessResult(Process.runSync(dart, <String>[
+ checkProcessResult(Process.runSync(dartaotruntime, <String>[
frontendServer,
'--sdk-root=$sdkRoot',
'--target=flutter',