diff --git a/BUILD.gn b/BUILD.gn index 16905da1aff..23d54037b2a 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -50,7 +50,6 @@ group("runtime") { "runtime/vm:kernel_platform_files($host_toolchain)", "samples/ffi/http:fake_http", "utils/dartdev:dartdev", - "utils/dds:dds", "utils/kernel-service:kernel-service", ] diff --git a/pkg/dartdev/lib/src/commands/run.dart b/pkg/dartdev/lib/src/commands/run.dart index 940d2bb4d64..52b830de991 100644 --- a/pkg/dartdev/lib/src/commands/run.dart +++ b/pkg/dartdev/lib/src/commands/run.dart @@ -397,10 +397,15 @@ class _DebuggingSession { ? sdk.ddsAotSnapshot : absolute(sdkDir, 'dds_aot.dart.snapshot'); String execName = sdk.dartAotRuntime; - if (!Sdk.checkArtifactExists(snapshotName)) { - // An AOT snapshot of dds is not available, we could - // be running on the ia32 platform so check for a regular - // kernel file being present. + // Check to see if the AOT snapshot and dartaotruntime are available. + // If not, fall back to running from the AppJIT snapshot. + // + // This can happen if: + // - The SDK is built for IA32 which doesn't support AOT compilation + // - We only have artifacts available from the 'runtime' build + // configuration, which the VM SDK build bots frequently run from + if (!Sdk.checkArtifactExists(snapshotName, logError: false) || + !Sdk.checkArtifactExists(sdk.dartAotRuntime, logError: false)) { snapshotName = fullSdk ? sdk.ddsSnapshot : absolute(sdkDir, 'dds.dart.snapshot'); if (!Sdk.checkArtifactExists(snapshotName)) { diff --git a/pkg/dartdev/lib/src/sdk.dart b/pkg/dartdev/lib/src/sdk.dart index 962dbdf6d59..67e3d5e8bad 100644 --- a/pkg/dartdev/lib/src/sdk.dart +++ b/pkg/dartdev/lib/src/sdk.dart @@ -80,10 +80,13 @@ class Sdk { 'devtools', ); - static bool checkArtifactExists(String path) { + static bool checkArtifactExists(String path, {bool logError = true}) { if (!File(path).existsSync()) { - log.stderr('Could not find $path. Have you built the full ' - 'Dart SDK?'); + if (logError) { + log.stderr( + 'Could not find $path. Have you built the full Dart SDK?', + ); + } return false; } return true; diff --git a/sdk/lib/_internal/vm/bin/vmservice_io.dart b/sdk/lib/_internal/vm/bin/vmservice_io.dart index bdd4db05871..c1b62145a46 100644 --- a/sdk/lib/_internal/vm/bin/vmservice_io.dart +++ b/sdk/lib/_internal/vm/bin/vmservice_io.dart @@ -91,7 +91,7 @@ class _DebuggingSession { 'dds_aot.dart.snapshot', ].join('/'); String execName = dartAotPath; - if (!File(snapshotName).existsSync()) { + if (!File(snapshotName).existsSync() || !File(dartAotPath).existsSync()) { snapshotName = [ dartDir, fullSdk ? 'snapshots' : 'gen', diff --git a/utils/dartdev/BUILD.gn b/utils/dartdev/BUILD.gn index 9e9dd6e73d4..b33ec489da9 100644 --- a/utils/dartdev/BUILD.gn +++ b/utils/dartdev/BUILD.gn @@ -22,7 +22,14 @@ copy("copy_dartdev_snapshot") { application_snapshot("generate_dartdev_snapshot") { main_dart = "../../pkg/dartdev/bin/dartdev.dart" training_args = [ "--help" ] + deps = [ "../dds:dds" ] + + # DDS should be run from AOT snapshot on all architectures except IA32/X86. + if (dart_target_arch != "ia32" && dart_target_arch != "x86") { + deps += [ "../dds:dds_aot" ] + } + vm_args = [ "--sound-null-safety" ] output = "$root_gen_dir/dartdev.dart.snapshot" }