[ DDS ] Fix DDS AOT snapshot build rules

dds_aot.dart.snapshot was not being generated for runtime build targets,
and dds.dart.snapshot was being built regardless of whether or not we
were building for an IA32 target.

This change also adds a check for IA32 in 'dart run' so the "Could not
find dds_aot.dart.snapshot. Have you built the full Dart SDK?" message
isn't printed when we fall back to using dds.dart.snapshot.

This change also reverts 2cc08595a6, which
failed to fix the issue it was attempting to fix.

TEST=pkg/vm_service tests

Change-Id: Ic990082c25b0d022093ad66600332dfb2878709f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341760
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Ben Konyi
2023-12-15 19:05:59 +00:00
committed by Commit Queue
parent 3d24839907
commit 0a393f1b69
5 changed files with 23 additions and 9 deletions
-1
View File
@@ -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",
]
+9 -4
View File
@@ -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)) {
+6 -3
View File
@@ -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;
+1 -1
View File
@@ -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',
+7
View File
@@ -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"
}