diff --git a/runtime/bin/main_impl.cc b/runtime/bin/main_impl.cc index d2c4fd14c5f3..eecebd8bab3e 100644 --- a/runtime/bin/main_impl.cc +++ b/runtime/bin/main_impl.cc @@ -586,6 +586,16 @@ static Dart_Isolate CreateAndSetupDartDevIsolate(const char* script_uri, int64_t start = Dart_TimelineGetMicros(); auto dartdev_path = DartDevIsolate::TryResolveDartDevSnapshotPath(); + if (dartdev_path.get() == nullptr) { + Syslog::PrintErr( + "Failed to start the Dart CLI isolate. Could not resolve DartDev " + "snapshot or kernel.\n"); + if (error != nullptr && *error != nullptr) { + free(*error); + *error = nullptr; + } + return nullptr; + } Dart_Isolate isolate = nullptr; const uint8_t* isolate_snapshot_data = core_isolate_snapshot_data; @@ -593,14 +603,9 @@ static Dart_Isolate CreateAndSetupDartDevIsolate(const char* script_uri, core_isolate_snapshot_instructions; IsolateGroupData* isolate_group_data = nullptr; IsolateData* isolate_data = nullptr; - - if (error != nullptr) { - *error = nullptr; - } AppSnapshot* app_snapshot = nullptr; bool isolate_run_app_snapshot = true; - if (dartdev_path.get() != nullptr && - (app_snapshot = Snapshot::TryReadAppSnapshot( + if ((app_snapshot = Snapshot::TryReadAppSnapshot( dartdev_path.get(), /*force_load_elf_from_memory=*/false, /*decode_uri=*/false)) != nullptr) { const uint8_t* isolate_snapshot_data = nullptr; @@ -621,27 +626,16 @@ static Dart_Isolate CreateAndSetupDartDevIsolate(const char* script_uri, } if (isolate == nullptr) { - isolate_run_app_snapshot = false; - dartdev_path = DartDevIsolate::TryResolveDartDevKernelPath(); + // dartdev_path was not an application snapshot, try it as a kernel file. // Clear error from app snapshot and retry from kernel. if (error != nullptr && *error != nullptr) { free(*error); *error = nullptr; } - + isolate_run_app_snapshot = false; if (app_snapshot != nullptr) { delete app_snapshot; } - - if (dartdev_path.get() == nullptr) { - Syslog::PrintErr( - "Failed to start the Dart CLI isolate. Could not resolve DartDev " - "snapshot or kernel.\n"); - delete isolate_data; - delete isolate_group_data; - return nullptr; - } - isolate_group_data = new IsolateGroupData(DART_DEV_ISOLATE_NAME, packages_config, nullptr, isolate_run_app_snapshot); diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index 52897f81a7ff..d80448568af7 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -44,8 +44,7 @@ declare_args() { # ........analysis_server.dart.snapshot # ........dart2js.dart.snapshot # ........dart2wasm_product.snapshot (if not on ia32) -# ........dartdev.dart.snapshot -# ........dartdev.dill +# ........dartdev.dart.snapshot (app-jit snapshot or kernel dill file) # ........dartdevc.dart.snapshot # ........dds.dart.snapshot # ........frontend_server.dart.snapshot @@ -453,17 +452,6 @@ copy("copy_vm_dill_files") { [ "$root_out_dir/$dart_sdk_output/lib/_internal/{{source_file_part}}" ] } -copy("copy_dartdev_dill_files") { - visibility = [ ":create_common_sdk" ] - deps = [ - ":copy_libraries", - "../utils/dartdev:dartdev", - ] - sources = [ "$root_out_dir/dartdev.dill" ] - outputs = - [ "$root_out_dir/$dart_sdk_output/bin/snapshots/{{source_file_part}}" ] -} - copy("copy_dart2js_dill_files") { visibility = [ ":create_full_sdk" ] deps = [ @@ -682,7 +670,6 @@ group("create_common_sdk") { public_deps = [ ":copy_api_readme", ":copy_dart", - ":copy_dartdev_dill_files", ":copy_dartdoc_files", ":copy_headers", ":copy_libraries_specification", diff --git a/utils/dartdev/BUILD.gn b/utils/dartdev/BUILD.gn index e3818aaedf7f..9e9dd6e73d4d 100644 --- a/utils/dartdev/BUILD.gn +++ b/utils/dartdev/BUILD.gn @@ -7,28 +7,11 @@ import("../application_snapshot.gni") group("dartdev") { public_deps = [ - ":copy_dartdev_kernel", ":copy_dartdev_snapshot", ":copy_prebuilt_devtools", ] } -copy("copy_dartdev_kernel") { - visibility = [ ":dartdev" ] - public_deps = [ ":generate_dartdev_kernel" ] - sources = [ "$root_gen_dir/dartdev.dill" ] - outputs = [ "$root_out_dir/dartdev.dill" ] -} - -application_snapshot("generate_dartdev_kernel") { - dart_snapshot_kind = "kernel" - main_dart = "../../pkg/dartdev/bin/dartdev.dart" - training_args = [] - deps = [ "../dds:dds" ] - vm_args = [ "--sound-null-safety" ] - output = "$root_gen_dir/dartdev.dill" -} - copy("copy_dartdev_snapshot") { visibility = [ ":dartdev" ] public_deps = [ ":generate_dartdev_snapshot" ]