1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-08 12:06:26 +00:00

Revert "Reland "[VM/SDK]""

This reverts commit b59583edea.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Reland "[VM/SDK]"
> 
> This is a reland of b4146411d0
> 
> Original change's description:
> > [VM/SDK]
> > 
> > - Switch the kernel isolate to run in Dart2 mode
> > - Refactor build rules so bootstrapping of the front end happens
> >   with a prebuilt dart sdk
> > - Refactor application snapshot build rules so the kernel application
> >   snapshot rule does not get into a cyclic dependency during the
> >   bootstrap stage
> > 
> > Change-Id: Id16b2859e0b299b2d689971d03a247cb94d0aa26
> > Reviewed-on: https://dart-review.googlesource.com/61660
> > Commit-Queue: Siva Annamalai <asiva@google.com>
> > Reviewed-by: Zach Anderson <zra@google.com>
> 
> Change-Id: I2a3fa8ed4f331cf3de89ddff5cf8e478809dae39
> Reviewed-on: https://dart-review.googlesource.com/65841
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=zra@google.com,asiva@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I6077236481bec9089ead881c902036b0817114fc
Reviewed-on: https://dart-review.googlesource.com/66240
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This commit is contained in:
Siva Annamalai 2018-07-23 18:07:29 +00:00 committed by commit-bot@chromium.org
parent 57e11e3d55
commit 33697f7339
21 changed files with 144 additions and 259 deletions

View File

@ -51,8 +51,12 @@ group("runtime") {
"runtime/bin:sample_extension",
"runtime/bin:test_extension",
"runtime/vm:kernel_platform_files($host_toolchain)",
# TODO(rmacnak): Link this into 'dart'.
"utils/kernel-service:copy_kernel_service_snapshot",
"utils/kernel-service:kernel-service",
]
if (target_supports_aot) {
deps += [ "runtime/bin:precompiler_entry_points_json" ]
}

View File

@ -33,7 +33,7 @@ dev_compiler/test/sourcemap/testfiles/*: SkipByDesign # Skip dev_compiler codege
dev_compiler/test/worker/*: Skip # test needs fixes
front_end/test/fasta/analyze_test: Pass, Slow
front_end/test/fasta/ast_builder_test: Pass, Slow
front_end/test/fasta/bootstrap_test: Skip # Issue 33811
front_end/test/fasta/bootstrap_test: Pass, Slow
front_end/test/fasta/compile_test: Pass, ExtraSlow
front_end/test/fasta/outline_test: Pass, Slow
front_end/test/fasta/rasta/*: SkipByDesign # Anything in rasta is input to fasta unit tests and shouldn't be run as tests.

View File

@ -260,8 +260,8 @@ Future _processExpressionCompilationRequest(request) async {
final SendPort port = request[1];
final int isolateId = request[2];
final String expression = request[3];
final List<String> definitions = request[4].cast<String>();
final List<String> typeDefinitions = request[5].cast<String>();
final List definitions = request[4];
final List typeDefinitions = request[5];
final String libraryUri = request[6];
final String klass = request[7]; // might be null
final bool isStatic = request[8];

View File

@ -1180,8 +1180,6 @@ executable("run_vm_tests") {
sources = [
"builtin_nolib.cc",
"dfe.cc",
"dfe.h",
"error_exit.cc",
"error_exit.h",
"run_vm_tests.cc",

View File

@ -467,19 +467,20 @@ static Dart_Isolate CreateAndSetupKernelIsolate(const char* script_uri,
Dart_Isolate isolate;
IsolateData* isolate_data = NULL;
bool isolate_run_app_snapshot = false;
AppSnapshot* app_snapshot = NULL;
// Kernel isolate uses an app snapshot or uses the dill file.
if ((kernel_snapshot_uri != NULL) &&
(app_snapshot = Snapshot::TryReadAppSnapshot(kernel_snapshot_uri)) !=
NULL) {
const uint8_t* isolate_snapshot_data = NULL;
const uint8_t* isolate_snapshot_instructions = NULL;
const uint8_t* ignore_vm_snapshot_data;
const uint8_t* ignore_vm_snapshot_instructions;
isolate_run_app_snapshot = true;
app_snapshot->SetBuffers(
&ignore_vm_snapshot_data, &ignore_vm_snapshot_instructions,
&isolate_snapshot_data, &isolate_snapshot_instructions);
if (kernel_snapshot_uri != NULL) {
// Kernel isolate uses an app snapshot or the core libraries snapshot.
const uint8_t* isolate_snapshot_data = core_isolate_snapshot_data;
const uint8_t* isolate_snapshot_instructions =
core_isolate_snapshot_instructions;
AppSnapshot* app_snapshot = Snapshot::TryReadAppSnapshot(uri);
if (app_snapshot != NULL) {
isolate_run_app_snapshot = true;
const uint8_t* ignore_vm_snapshot_data;
const uint8_t* ignore_vm_snapshot_instructions;
app_snapshot->SetBuffers(
&ignore_vm_snapshot_data, &ignore_vm_snapshot_instructions,
&isolate_snapshot_data, &isolate_snapshot_instructions);
}
IsolateData* isolate_data =
new IsolateData(uri, package_root, packages_config, app_snapshot);
isolate = Dart_CreateIsolate(
@ -496,9 +497,9 @@ static Dart_Isolate CreateAndSetupKernelIsolate(const char* script_uri,
isolate_data->set_kernel_buffer(const_cast<uint8_t*>(kernel_service_buffer),
kernel_service_buffer_size,
false /* take_ownership */);
isolate = Dart_CreateIsolateFromKernel(
script_uri, main, kernel_service_buffer, kernel_service_buffer_size,
flags, isolate_data, error);
isolate = Dart_CreateIsolateFromKernel(uri, main, kernel_service_buffer,
kernel_service_buffer_size, flags,
isolate_data, error);
}
if (isolate == NULL) {
@ -1301,13 +1302,7 @@ void main(int argc, char** argv) {
application_kernel_buffer_size);
// Since we saw a dill file, it means we have to turn on all the
// preview_dart_2 options.
if (Options::no_preview_dart_2()) {
Log::PrintErr(
"A kernel file is specified as the input, "
"--no-preview-dart-2 option is incompatible with it\n");
Platform::Exit(kErrorExitCode);
}
Options::dfe()->set_use_dfe();
Options::SetDart2Options(&vm_options);
}
#endif

View File

@ -125,45 +125,43 @@ static Dart_Isolate CreateIsolateAndSetup(const char* script_uri,
strdup("Spawning of only Kernel isolate is supported in run_vm_tests.");
return NULL;
}
Dart_Isolate isolate = NULL;
bin::IsolateData* isolate_data = NULL;
const uint8_t* kernel_service_buffer = NULL;
intptr_t kernel_service_buffer_size = 0;
// Kernel isolate uses an app snapshot or the kernel service dill file.
if (kernel_snapshot != NULL &&
(bin::DartUtils::SniffForMagicNumber(kernel_snapshot) ==
bin::DartUtils::kAppJITMagicNumber)) {
script_uri = kernel_snapshot;
bin::AppSnapshot* app_snapshot =
bin::Snapshot::TryReadAppSnapshot(script_uri);
ASSERT(app_snapshot != NULL);
const uint8_t* ignore_vm_snapshot_data;
const uint8_t* ignore_vm_snapshot_instructions;
const uint8_t* isolate_snapshot_data;
const uint8_t* isolate_snapshot_instructions;
app_snapshot->SetBuffers(
&ignore_vm_snapshot_data, &ignore_vm_snapshot_instructions,
&isolate_snapshot_data, &isolate_snapshot_instructions);
isolate_data = new bin::IsolateData(script_uri, package_root,
packages_config, app_snapshot);
isolate = Dart_CreateIsolate(
DART_KERNEL_ISOLATE_NAME, main, isolate_snapshot_data,
isolate_snapshot_instructions, NULL, NULL, flags, isolate_data, error);
} else {
bin::dfe.Init();
bin::dfe.LoadKernelService(&kernel_service_buffer,
&kernel_service_buffer_size);
ASSERT(kernel_service_buffer != NULL);
isolate_data =
new bin::IsolateData(script_uri, package_root, packages_config, NULL);
isolate_data->set_kernel_buffer(const_cast<uint8_t*>(kernel_service_buffer),
kernel_service_buffer_size,
false /* take_ownership */);
isolate = Dart_CreateIsolateFromKernel(
script_uri, main, kernel_service_buffer, kernel_service_buffer_size,
flags, isolate_data, error);
if (kernel_snapshot == NULL) {
*error =
strdup("Kernel snapshot location has to be specified via --dfe option");
return NULL;
}
script_uri = kernel_snapshot;
// Kernel isolate uses an app snapshot or the core libraries snapshot.
bool isolate_run_script_snapshot = false;
const uint8_t* isolate_snapshot_data = bin::core_isolate_snapshot_data;
const uint8_t* isolate_snapshot_instructions =
bin::core_isolate_snapshot_instructions;
bin::AppSnapshot* app_snapshot = NULL;
switch (bin::DartUtils::SniffForMagicNumber(script_uri)) {
case bin::DartUtils::kAppJITMagicNumber: {
app_snapshot = bin::Snapshot::TryReadAppSnapshot(script_uri);
ASSERT(app_snapshot != NULL);
const uint8_t* ignore_vm_snapshot_data;
const uint8_t* ignore_vm_snapshot_instructions;
app_snapshot->SetBuffers(
&ignore_vm_snapshot_data, &ignore_vm_snapshot_instructions,
&isolate_snapshot_data, &isolate_snapshot_instructions);
break;
}
case bin::DartUtils::kSnapshotMagicNumber: {
isolate_run_script_snapshot = true;
break;
}
default:
return NULL;
}
bin::IsolateData* isolate_data = new bin::IsolateData(
script_uri, package_root, packages_config, app_snapshot);
Dart_Isolate isolate = Dart_CreateIsolate(
DART_KERNEL_ISOLATE_NAME, main, isolate_snapshot_data,
isolate_snapshot_instructions, NULL, NULL, flags, isolate_data, error);
if (isolate == NULL) {
delete isolate_data;
return NULL;
@ -171,18 +169,22 @@ static Dart_Isolate CreateIsolateAndSetup(const char* script_uri,
Dart_EnterScope();
if (isolate_run_script_snapshot) {
uint8_t* payload;
intptr_t payload_length;
void* file = bin::DartUtils::OpenFile(script_uri, false);
bin::DartUtils::ReadFile(&payload, &payload_length, file);
bin::DartUtils::CloseFile(file);
Dart_Handle result = Dart_LoadScriptFromSnapshot(payload, payload_length);
CHECK_RESULT(result);
}
bin::DartUtils::SetOriginalWorkingDirectory();
Dart_Handle result = bin::DartUtils::PrepareForScriptLoading(
false /* is_service_isolate */, false /* trace_loading */);
CHECK_RESULT(result);
// Setup kernel service as the main script for this isolate.
if (kernel_service_buffer) {
result = Dart_LoadScriptFromKernel(kernel_service_buffer,
kernel_service_buffer_size);
CHECK_RESULT(result);
}
Dart_ExitScope();
Dart_ExitIsolate();
*error = Dart_IsolateMakeRunnable(isolate);
@ -215,9 +217,6 @@ static int Main(int argc, const char** argv) {
// Save the console state so we can restore it later.
dart::bin::Console::SaveConfig();
// Store the executable name.
dart::bin::Platform::SetExecutableName(argv[0]);
if (argc < 2) {
// Bad parameter count.
PrintUsage();

View File

@ -337,19 +337,12 @@ void Snapshot::GenerateKernel(const char* snapshot_filename,
bool strong,
const char* package_config) {
#if !defined(EXCLUDE_CFE_AND_KERNEL_PLATFORM) && !defined(TESTING)
uint8_t* kernel_buffer = NULL;
intptr_t kernel_buffer_size = 0;
dfe.ReadScript(script_name, &kernel_buffer, &kernel_buffer_size);
if (kernel_buffer != NULL) {
WriteSnapshotFile(snapshot_filename, kernel_buffer, kernel_buffer_size);
} else {
Dart_KernelCompilationResult result =
dfe.CompileScript(script_name, strong, false, package_config);
if (result.status != Dart_KernelCompilationStatus_Ok) {
ErrorExit(kErrorExitCode, "%s\n", result.error);
}
WriteSnapshotFile(snapshot_filename, result.kernel, result.kernel_size);
Dart_KernelCompilationResult result =
dfe.CompileScript(script_name, strong, false, package_config);
if (result.status != Dart_KernelCompilationStatus_Ok) {
ErrorExit(kErrorExitCode, "%s\n", result.error);
}
WriteSnapshotFile(snapshot_filename, result.kernel, result.kernel_size);
#else
UNREACHABLE();
#endif // !defined(EXCLUDE_CFE_AND_KERNEL_PLATFORM) && !defined(TESTING)

View File

@ -86,14 +86,3 @@ declare_args() {
# product).
exclude_kernel_service = false
}
declare_args() {
# We create a kernel service app-jit snapshot only for when the target
# architecture is x64 for other cases we will use the '.dill' file
# which is already linked in the VM.
if (dart_target_arch == "x64") {
create_kernel_service_snapshot = true
} else {
create_kernel_service_snapshot = false
}
}

View File

@ -92,10 +92,9 @@ class RunKernelTask : public ThreadPool::Task {
api_flags.enable_asserts = false;
api_flags.enable_error_on_bad_type = false;
api_flags.enable_error_on_bad_override = false;
api_flags.use_dart_frontend = true;
api_flags.reify_generic_functions = true;
api_flags.strong = true;
api_flags.sync_async = true;
api_flags.reify_generic_functions = false;
api_flags.strong = false;
api_flags.sync_async = false;
#if !defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC)
api_flags.use_field_guards = true;
#endif
@ -237,11 +236,7 @@ void KernelIsolate::Shutdown() {
{
MonitorLocker ml(monitor_);
while (isolate_ != NULL) {
// TODO(asiva): Investigate shutdown hangs with kill message not
// being delivered sometimes, use a timed loop to deliver message
// again.
ml.Wait(1000);
Isolate::KillIfExists(isolate_, Isolate::kInternalKillMsg);
ml.Wait();
}
}
}

View File

@ -14,7 +14,6 @@
# fail.
import("../build/dart/copy_tree.gni")
import("../runtime/runtime_args.gni")
declare_args() {
# Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.
@ -135,19 +134,15 @@ _platform_sdk_snapshots = [
"dartfmt",
"../utils/dartfmt",
],
[
"kernel-service",
"../utils/kernel-service",
],
[
"pub",
"../utils/pub",
],
]
if (create_kernel_service_snapshot) {
_platform_sdk_snapshots += [
[
"kernel-service",
"../utils/kernel-service:kernel-service_snapshot",
],
]
}
_full_sdk_snapshots = [
[
@ -186,19 +181,15 @@ _full_sdk_snapshots = [
"kernel_worker",
"../utils/bazel:kernel_worker",
],
[
"kernel-service",
"../utils/kernel-service",
],
[
"pub",
"../utils/pub",
],
]
if (create_kernel_service_snapshot) {
_full_sdk_snapshots += [
[
"kernel-service",
"../utils/kernel-service:kernel-service_snapshot",
],
]
}
# Libraries that go under lib/
_platform_sdk_libraries = [

View File

@ -5,6 +5,7 @@
import("../application_snapshot.gni")
application_snapshot("analysis_server") {
dart_version = 2
main_dart = "../../pkg/analysis_server/bin/server.dart"
training_args = [
"--train-using=" + rebase_path("../../pkg/analyzer_cli"),

View File

@ -4,7 +4,8 @@
import("../application_snapshot.gni")
application_snapshot_dart1("analysis_server_dart1") {
application_snapshot("analysis_server_dart1") {
dart_version = 1
main_dart = "../../pkg/analysis_server/bin/server.dart"
training_args = [ "--help" ]
}

View File

@ -3,17 +3,15 @@
# BSD-style license that can be found in the LICENSE file.
import("../build/dart/dart_action.gni")
import("../runtime/runtime_args.gni")
_dart_root = get_path_info("..", "abspath")
declare_args() {
# Default to building app-jit snapshots. The simulator and cross builds
# override this to script snapshots to cut down on build time.
dart_snapshot_kind = "app-jit"
if (target_cpu != host_cpu) {
dart_snapshot_kind = "script"
} else {
dart_snapshot_kind = "app-jit"
}
}
@ -26,8 +24,12 @@ declare_args() {
# training_args (required):
# Arguments to pass to the Dart application for the training run.
#
# dart_version (optional):
# Must be 1 or 2. Defaults to 1.
#
# vm_args (optional):
# Additional arguments to the Dart VM.
# Additional arguments to the Dart VM. Do not put --preview-dart-2 here.
# Instead set dart_version = 2.
#
# name (optional):
# The name of the snapshot if different from the target name. The output
@ -44,7 +46,7 @@ declare_args() {
#
# output (optional):
# Overrides the full output path.
template("_application_snapshot") {
template("application_snapshot") {
assert(defined(invoker.main_dart), "Must specify 'main_dart'")
assert(defined(invoker.training_args), "Must specify 'training_args'")
snapshot_vm_args = []
@ -74,8 +76,27 @@ template("_application_snapshot") {
if (defined(invoker.output)) {
output = invoker.output
}
# TODO(asiva), flip default once the VM is dart2 by default.
dart_version = 1
if (defined(invoker.dart_version)) {
dart_version = invoker.dart_version
}
assert(dart_version == 1 || dart_version == 2,
"For $target_name, dart_version must be 1 or 2")
dart_action(target_name) {
deps = extra_deps
if (dart_version == 1) {
snapshot_vm_args += [ "--no-preview-dart-2" ]
} else {
# HACK: When creating app-jit snapshots for Dart 2 apps, the standalone
# Dart VM binary requires the app-jit snapshot for the kernel service to
# be adjacent to it. This deps ensures that it is there, but a different
# approach will be needed when the kernel service itself switches to
# Dart 2 to avoid creating a circular dependence.
deps += [ "$_dart_root/utils/kernel-service:copy_kernel_service_snapshot"]
}
depfile = "$output.d"
script = main_dart
@ -111,107 +132,6 @@ template("_application_snapshot") {
}
}
# Creates an app-jit snapshot for a Dart2 program based on a training run.
#
# Parameters:
# main_dart (required):
# The entrypoint to the Dart application.
#
# training_args (required):
# Arguments to pass to the Dart application for the training run.
#
# vm_args (optional):
# Additional arguments to the Dart VM. Do not put --no-preview-dart-2 here.
# Instead use the template application_snapshot_dart1.
#
# name (optional):
# The name of the snapshot if different from the target name. The output
# will be in $root_gen_dir/$name.dart.snapshot.
#
# deps (optional):
# Any build dependencies.
#
# dot_packages (optional):
# The .packages file for the app. Defaults to the $_dart_root/.packages.
#
# output (optional):
# Overrides the full output path.
template("application_snapshot") {
_application_snapshot(target_name) {
forward_variables_from(invoker, "*")
if (!defined(invoker.deps)) {
deps = []
}
deps += [
"$_dart_root/utils/kernel-service:kernel-service_snapshot"
]
}
}
# Creates an app-jit snapshot for a Dart1 program based on a training run.
#
# Parameters:
# main_dart (required):
# The entrypoint to the Dart application.
#
# training_args (required):
# Arguments to pass to the Dart application for the training run.
#
# vm_args (optional):
# Additional arguments to the Dart VM. Do not put --no-preview-dart-2 here.
#
# name (optional):
# The name of the snapshot if different from the target name. The output
# will be in $root_gen_dir/$name.dart.snapshot.
#
# deps (optional):
# Any build dependencies.
#
# dot_packages (optional):
# The .packages file for the app. Defaults to the $_dart_root/.packages.
#
# output (optional):
# Overrides the full output path.
template("application_snapshot_dart1") {
_application_snapshot(target_name) {
forward_variables_from(invoker, "*")
if (!defined(invoker.vm_args)) {
vm_args = []
}
vm_args += [ "--no-preview-dart-2" ]
}
}
# Creates an app-jit snapshot for the common FE based on a training run.
#
# Parameters:
# main_dart (required):
# The entrypoint to the Dart application.
#
# training_args (required):
# Arguments to pass to the Dart application for the training run.
#
# vm_args (optional):
# Additional arguments to the Dart VM. Do not put --no-preview-dart-2 here.
#
# name (optional):
# The name of the snapshot if different from the target name. The output
# will be in $root_gen_dir/$name.dart.snapshot.
#
# deps (optional):
# Any build dependencies.
#
# dot_packages (optional):
# The .packages file for the app. Defaults to the $_dart_root/.packages.
#
# output (optional):
# Overrides the full output path.
template("kernel_application_snapshot") {
_application_snapshot(target_name) {
forward_variables_from(invoker, "*")
}
}
template("aot_assembly") {
assert(defined(invoker.main_dart), "Must specify 'main_dart'")
aot_vm_args = []

View File

@ -7,4 +7,5 @@ import("../application_snapshot.gni")
application_snapshot("kernel_worker") {
main_dart = "kernel_worker.dart"
training_args = [ "--help" ]
dart_version = 2
}

View File

@ -32,7 +32,7 @@ dart_action("dart2js_create_snapshot_entry") {
# dart_action() needs kernel service snapshot to run in Dart 2 mode.
# This can't be added as a dependency to dart_action() itself as it will
# create a circular dependency.
deps += [ "../../utils/kernel-service:kernel-service" ]
deps += [ "../../utils/kernel-service:copy_kernel_service_snapshot" ]
output_dir = rebase_path(target_gen_dir)
@ -58,6 +58,8 @@ dart_action("dart2js_create_snapshot_entry") {
}
application_snapshot("dart2js") {
dart_version = 2
deps = [
":compile_dart2js_platform",
":compile_dart2js_platform_strong",

View File

@ -21,6 +21,7 @@ analyzer_files = exec_script("../../tools/list_dart_files.py",
"list lines")
application_snapshot("generate_dartanalyzer_snapshot") {
dart_version = 2
main_dart = "../../pkg/analyzer_cli/bin/analyzer.dart"
training_args = [
"--dart-sdk=" + rebase_path("../../sdk"),

View File

@ -11,6 +11,8 @@ sdk_summary = "$target_gen_dir/ddc_sdk.sum"
sdk_dill = "$target_gen_dir/kernel/ddc_sdk.dill"
application_snapshot("dartdevc") {
dart_version = 2
main_dart = "../../pkg/dev_compiler/bin/dartdevc.dart"
training_args = [
@ -33,6 +35,8 @@ application_snapshot("dartdevc") {
}
application_snapshot("dartdevk") {
dart_version = 2
main_dart = "../../pkg/dev_compiler/bin/dartdevk.dart"
training_args = [
@ -89,7 +93,7 @@ template("dart2js_compile") {
# dart_action() needs kernel service snapshot to run in Dart 2 mode.
# This can't be added as a dependency to dart_action() itself as it will
# create a circular dependency.
deps += [ "../../utils/kernel-service:kernel-service" ]
deps += [ "../../utils/kernel-service:copy_kernel_service_snapshot" ]
inputs = sdk_lib_files + compiler_files + dev_compiler_files + [
"$root_out_dir/dart2js_platform.dill",

View File

@ -5,6 +5,7 @@
import("../application_snapshot.gni")
application_snapshot("dartdoc") {
dart_version = 2
main_dart = "../../third_party/pkg/dartdoc/bin/dartdoc.dart"
training_args = [ "--help" ]
}

View File

@ -5,6 +5,7 @@
import("../application_snapshot.gni")
application_snapshot("dartfmt") {
dart_version = 2
main_dart = "../../third_party/pkg_tested/dart_style/bin/format.dart"
# Train it on formatting its own source.

View File

@ -4,39 +4,24 @@
import("../../build/dart/dart_action.gni")
import("../../build/dart/dart_host_sdk_toolchain.gni")
import("../../runtime/runtime_args.gni")
import("../application_snapshot.gni")
group("kernel-service") {
if (create_kernel_service_snapshot) {
deps = [
# TODO(rmacnak): Link this into 'dart'.
":copy_kernel-service_snapshot",
]
} else {
deps = [
":kernel_service_dill",
]
}
}
# TODO: Switch this to use kernel based app-jit snapshot
# when we are ready to switch to the kernel based core snapshots.
kernel_application_snapshot("kernel-service_snapshot") {
main_dart = "$root_gen_dir/kernel_service.dill"
application_snapshot("kernel-service") {
main_dart = "../../pkg/vm/bin/kernel_service.dart"
deps = [
":kernel_service_dill",
"../../runtime/vm:kernel_platform_files($dart_host_toolchain)",
]
training_args = [
"--train",
"file://" + rebase_path("../../pkg/compiler/lib/src/dart2js.dart"),
]
output = "$root_gen_dir/kernel-service.dart.snapshot"
}
copy("copy_kernel-service_snapshot") {
copy("copy_kernel_service_snapshot") {
deps = [
":kernel-service_snapshot",
":kernel-service",
]
sources = [
"$root_gen_dir/kernel-service.dart.snapshot",
@ -55,15 +40,14 @@ application_snapshot("frontend_server") {
training_args = [
"--train",
"--sdk-root=$sdk_root/",
"--platform=$sdk_root/vm_platform_strong.dill",
"--platform=$sdk_root/vm_platform.dill",
]
output = "$root_out_dir/frontend_server.dart.snapshot"
}
prebuilt_dart_action("kernel_service_dill") {
deps = [
"../../runtime/vm:vm_platform",
"../../runtime/vm:kernel_platform_files($dart_host_toolchain)",
"../../runtime/vm:vm_legacy_platform",
]
kernel_service_script = "../../pkg/vm/bin/kernel_service.dart"
gen_kernel_script = "../../pkg/vm/bin/gen_kernel.dart"
@ -71,7 +55,7 @@ prebuilt_dart_action("kernel_service_dill") {
inputs = [
gen_kernel_script,
kernel_service_script,
"$root_out_dir/vm_platform_strong.dill",
"$root_out_dir/vm_platform.dill",
]
outputs = [
"$root_gen_dir/kernel_service.dill",
@ -79,10 +63,14 @@ prebuilt_dart_action("kernel_service_dill") {
script = gen_kernel_script
# TODO: Switch over to vm_platform_strong.dill and remove the
# flags --no-strong-mode once https://github.com/dart-lang/sdk/issues/31623
# is fixed.
args = [
"--packages=" + rebase_path("../../.packages"),
"--platform=" + rebase_path("$root_out_dir/vm_platform_strong.dill"),
"--platform=" + rebase_path("$root_out_dir/vm_platform.dill"),
"--no-aot",
"--no-strong-mode",
"--no-embed-sources",
"--output=" + rebase_path("$root_gen_dir/kernel_service.dill"),
rebase_path(kernel_service_script),

View File

@ -5,6 +5,7 @@
import("../application_snapshot.gni")
application_snapshot("pub") {
dart_version = 2
main_dart = "../../third_party/pkg/pub/bin/pub.dart"
training_args = [ "--help" ]
}