From 5969da51d9dbbd825302ec34f01ffa473d511ec3 Mon Sep 17 00:00:00 2001 From: Nate Biggs Date: Wed, 22 Feb 2023 17:19:43 +0000 Subject: [PATCH] [dart2js] Update build infrastructure to move Dart2JS onto sound null safety. Change-Id: Id172ab72e5d36899f699bb48f8ceb3609964efbc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280221 Reviewed-by: Sigmund Cherem Commit-Queue: Nate Biggs --- pkg/compiler/test/end_to_end/dart2js_batch_test.dart | 5 ++--- pkg/dartdev/lib/src/commands/compile.dart | 1 - sdk/bin/dart2js | 1 - utils/compiler/BUILD.gn | 5 +---- utils/compiler/create_snapshot_entry.dart | 1 - 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/pkg/compiler/test/end_to_end/dart2js_batch_test.dart b/pkg/compiler/test/end_to_end/dart2js_batch_test.dart index 29e553592f7..f2cce0f24ce 100644 --- a/pkg/compiler/test/end_to_end/dart2js_batch_test.dart +++ b/pkg/compiler/test/end_to_end/dart2js_batch_test.dart @@ -65,9 +65,8 @@ Future runTests(Process process) { String outFile = path.join(tmpDir.path, 'out.js'); String outFile2 = path.join(tmpDir.path, 'out2.js'); - // TODO(48820): remove null safety flag. - process.stdin.writeln('--no-sound-null-safety --out="$outFile" "$inFile"'); - process.stdin.writeln('--no-sound-null-safety --out="$outFile2" "$inFile"'); + process.stdin.writeln('--out="$outFile" "$inFile"'); + process.stdin.writeln('--out="$outFile2" "$inFile"'); process.stdin.writeln('too many arguments'); process.stdin.writeln(r'"nonexistent file.dart"'); process.stdin.close(); diff --git a/pkg/dartdev/lib/src/commands/compile.dart b/pkg/dartdev/lib/src/commands/compile.dart index 2eb3bd7e6a3..a94e304bd79 100644 --- a/pkg/dartdev/lib/src/commands/compile.dart +++ b/pkg/dartdev/lib/src/commands/compile.dart @@ -79,7 +79,6 @@ class CompileJSCommand extends CompileSubcommandCommand { ...argResults!.arguments, ], packageConfigOverride: null, - forceNoSoundNullSafety: true, ); return 0; diff --git a/sdk/bin/dart2js b/sdk/bin/dart2js index bc9f2ecf7f5..e038b1a935d 100755 --- a/sdk/bin/dart2js +++ b/sdk/bin/dart2js @@ -37,7 +37,6 @@ fi unset EXTRA_VM_OPTIONS declare -a EXTRA_VM_OPTIONS -EXTRA_VM_OPTIONS+=('--no_sound_null_safety') case $0 in *_developer) EXTRA_VM_OPTIONS+=('--enable-asserts') diff --git a/utils/compiler/BUILD.gn b/utils/compiler/BUILD.gn index 5d93b26d014..c1166a46cb0 100644 --- a/utils/compiler/BUILD.gn +++ b/utils/compiler/BUILD.gn @@ -60,8 +60,7 @@ application_snapshot("dart2js") { "$root_out_dir/dart2js_outline.dill", "$root_out_dir/dart2js_outline_unsound.dill", ] - gen_kernel_args = [ "--no-sound-null-safety" ] - vm_args = [ "--no-sound-null-safety" ] + vm_args = [] main_dart = "$target_gen_dir/dart2js.dart" training_args = [ "--packages=" + rebase_path("../../.dart_tool/package_config.json"), @@ -71,8 +70,6 @@ application_snapshot("dart2js") { # sources. "--platform-binaries=" + rebase_path("$root_out_dir/"), - # TODO(48820): remove once dart2js is migrated. - "--no-sound-null-safety", rebase_path("../../pkg/compiler/lib/src/util/memory_compiler.dart"), ] } diff --git a/utils/compiler/create_snapshot_entry.dart b/utils/compiler/create_snapshot_entry.dart index 360debef6c4..2533d5711ee 100644 --- a/utils/compiler/create_snapshot_entry.dart +++ b/utils/compiler/create_snapshot_entry.dart @@ -24,7 +24,6 @@ Future getVersion(var rootPath) { Future getDart2jsSnapshotGenerationFile(var rootPath) { return getVersion(rootPath).then((version) { var snapshotGenerationText = """ -// @dart = 2.9 import 'package:compiler/src/dart2js.dart' as dart2jsMain; void main(List arguments) {