[dart cli] Remove need for dartdev.dill file from sdk
The bulid rules generate an appjit snapshot or a kernel file under dartdev.dart.snapshot depending on whether the target_cpu is the same as the host_cpu. Generation of the additional dartdev.dill file is not needed because of this, the logic to start the dartdev isolate tries to load dartdev.dart.snapshot as an appjit snapshot first and if that fails it tries it as a kernel file. TEST=ci Change-Id: I1c985bdf543d3eb5e17d968378053cc558fd8a0f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306134 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Siva Annamalai <asiva@google.com>
This commit is contained in:
+13
-19
@@ -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);
|
||||
|
||||
+1
-14
@@ -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",
|
||||
|
||||
@@ -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" ]
|
||||
|
||||
Reference in New Issue
Block a user