Skip to content

Commit

Permalink
[stable][ddc] Add new name for ddc compiler
Browse files Browse the repository at this point in the history
* The new compiler name "ddc" will be used for all configurations
  in an upcoming change.
* Aliases "dartdevc" and "dartdevk" will be removed in the future.

Issue: #51481
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/280862
Change-Id: Icd81c63bff57911816a4e187a40e4a4012eead85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284543
Reviewed-by: Alexander Thomas <athom@google.com>
  • Loading branch information
nshahan authored and athomas committed Feb 28, 2023
1 parent 0ec8740 commit 9e95988
Show file tree
Hide file tree
Showing 24 changed files with 83 additions and 54 deletions.
3 changes: 2 additions & 1 deletion pkg/expect/lib/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ bool get isDart2WasmConfiguration =>

bool get isDdcConfiguration =>
_configuration.compiler == Compiler.dartdevk ||
_configuration.compiler == Compiler.dartdevc;
_configuration.compiler == Compiler.dartdevc ||
_configuration.compiler == Compiler.ddc;

bool get isVmJitConfiguration => _configuration.compiler == Compiler.dartk;

Expand Down
5 changes: 5 additions & 0 deletions pkg/smith/lib/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ class Compiler extends NamedEnum {
static const dart2wasm = Compiler._('dart2wasm');
static const dartdevc = Compiler._('dartdevc');
static const dartdevk = Compiler._('dartdevk');
static const ddc = Compiler._('ddc');
static const appJitk = Compiler._('app_jitk');
static const dartk = Compiler._('dartk');
static const dartkp = Compiler._('dartkp');
Expand All @@ -653,6 +654,7 @@ class Compiler extends NamedEnum {
dart2wasm,
dartdevc,
dartdevk,
ddc,
appJitk,
dartk,
dartkp,
Expand Down Expand Up @@ -693,6 +695,7 @@ class Compiler extends NamedEnum {

case Compiler.dartdevc:
case Compiler.dartdevk:
case Compiler.ddc:
return const [
Runtime.none,
Runtime.d8,
Expand Down Expand Up @@ -734,6 +737,7 @@ class Compiler extends NamedEnum {
return Runtime.d8;
case Compiler.dartdevc:
case Compiler.dartdevk:
case Compiler.ddc:
return Runtime.chrome;
case Compiler.dart2analyzer:
return Runtime.none;
Expand All @@ -757,6 +761,7 @@ class Compiler extends NamedEnum {
case Compiler.dart2wasm:
case Compiler.dartdevc:
case Compiler.dartdevk:
case Compiler.ddc:
case Compiler.fasta:
return Mode.release;

Expand Down
14 changes: 7 additions & 7 deletions pkg/smith/test/configuration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ void main() {
});

group("visualCompare()", () {
var a = Configuration("dartdevc", Architecture.ia32, Compiler.dartdevc,
Mode.debug, Runtime.chrome, System.android,
var a = Configuration("ddc", Architecture.ia32, Compiler.ddc, Mode.debug,
Runtime.chrome, System.android,
builderTag: "a tag",
vmOptions: ["vm a1", "vm a2"],
dart2jsOptions: ["dart2js a1", "dart2js a2"],
Expand Down Expand Up @@ -392,10 +392,10 @@ void main() {

test("everything different", () {
expect(a.visualCompare(b), equals("""
dartdevc
ddc
dart2js
architecture: ia32 x64
compiler: dartdevc dart2js
compiler: ddc dart2js
mode: debug release
runtime: chrome d8
system: android fuchsia
Expand Down Expand Up @@ -423,10 +423,10 @@ architecture: ia32 x64

test("everything the same", () {
expect(a.visualCompare(a), equals("""
dartdevc
dartdevc
ddc
ddc
architecture: ia32 ia32
compiler: dartdevc dartdevc
compiler: ddc ddc
mode: debug debug
runtime: chrome chrome
system: android android
Expand Down
6 changes: 3 additions & 3 deletions pkg/test_runner/lib/src/browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,18 @@ bool _invalidVariableName(String keyword, {bool strictMode = true}) {
return false;
}

/// Generates the HTML template file needed to load and run a dartdevc test in
/// Generates the HTML template file needed to load and run a ddc test in
/// the browser.
///
/// [testName] is the short name of the test without any subdirectory path
/// or extension, like "math_test". [testNameAlias] is the alias of the
/// test variable used for import/export (usually relative to its module root).
/// [testJSDir] is the relative path to the build directory where the
/// dartdevc-generated JS file is stored. [nonNullAsserts] enables non-null
/// ddc-generated JS file is stored. [nonNullAsserts] enables non-null
/// assertions for non-nullable method parameters when running with weak null
/// safety. [weakNullSafetyErrors] enables null safety type violations to throw
/// when running in weak mode.
String dartdevcHtml(
String ddcHtml(
String testName,
String testNameAlias,
String testJSDir,
Expand Down
4 changes: 3 additions & 1 deletion pkg/test_runner/lib/src/build_configurations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ List<String> _selectBuildTargets(Configuration inner) {
Compiler.appJitk: ['runtime'],
Compiler.fasta: ['create_sdk', 'dartdevc_test', 'kernel_platform_files'],
Compiler.dartdevk: ['dartdevc_test'],
Compiler.ddc: ['dartdevc_test'],
Compiler.dart2js: ['create_sdk'],
Compiler.dart2analyzer: ['create_sdk', 'utils/dartanalyzer'],
Compiler.specParser: <String>[],
Expand All @@ -96,7 +97,8 @@ List<String> _selectBuildTargets(Configuration inner) {
result.add('gen_snapshot');
}

if (compiler == Compiler.dartdevk && !inner.useSdk) {
if ((compiler == Compiler.dartdevk || compiler == Compiler.ddc) &&
!inner.useSdk) {
result
..remove('dartdevc_test')
..add('dartdevc_test_local');
Expand Down
1 change: 1 addition & 0 deletions pkg/test_runner/lib/src/command_output.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,7 @@ mixin _StaticErrorOutput on CommandOutput {
Compiler.dart2wasm: ErrorSource.web,
Compiler.dartdevc: ErrorSource.web,
Compiler.dartdevk: ErrorSource.web,
Compiler.ddc: ErrorSource.web,
Compiler.fasta: ErrorSource.cfe
}[testCase.configuration.compiler]!;

Expand Down
14 changes: 7 additions & 7 deletions pkg/test_runner/lib/src/compiler_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ abstract class CompilerConfiguration {
return Dart2WasmCompilerConfiguration(configuration);

case Compiler.dartdevc:
return DevCompilerConfiguration(configuration);

case Compiler.dartdevk:
case Compiler.ddc:
return DevCompilerConfiguration(configuration);

case Compiler.appJitk:
Expand Down Expand Up @@ -583,16 +582,17 @@ class Dart2WasmCompilerConfiguration extends CompilerConfiguration {
}
}

/// Configuration for `dartdevc` and `dartdevk` (DDC with Kernel)
/// Configuration for "dartdevc", "dartdevk", and "ddc".
// TODO(nshahan): Cleanup mulitple aliases for the compiler.
class DevCompilerConfiguration extends CompilerConfiguration {
DevCompilerConfiguration(TestConfiguration configuration)
: super._subclass(configuration);

String computeCompilerPath() {
// The compiler is a Dart program and not an executable itself, so the
// command to spawn as a subprocess is a Dart VM. Internally the
// [DevCompilerCompilationCommand] will prepend the snapshot or Dart library
// entrypoint that is executed by the VM.
// DDC is a Dart program and not an executable itself, so the command to
// spawn as a subprocess is a Dart VM.
// Internally the [DevCompilerCompilationCommand] will prepend the snapshot
// or Dart library entrypoint that is executed by the VM.
// This will change once we update the DDC to use AOT instead of a snapshot.
var dir = _useSdk ? '${_configuration.buildDirectory}/dart-sdk' : 'sdk';
return '$dir/bin/dart$executableExtension';
Expand Down
1 change: 1 addition & 0 deletions pkg/test_runner/lib/src/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class TestConfiguration {
Compiler.appJitk,
Compiler.dartdevc,
Compiler.dartdevk,
Compiler.ddc,
Compiler.dartk,
Compiler.dartkp,
Compiler.fasta,
Expand Down
5 changes: 3 additions & 2 deletions pkg/test_runner/lib/src/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ class OptionsParser {
dart2js: Compile to JavaScript using dart2js.
dart2analyzer: Perform static analysis on Dart code using the analyzer.
compare_analyzer_cfe: Compare analyzer and common front end representations.
dartdevc: Compile to JavaScript using dartdevc.
dartdevk: Compile to JavaScript using dartdevc (same as dartdevc).
ddc: Compile to JavaScript using dartdevc.
dartdevc: Compile to JavaScript using dartdevc (same as ddc).
dartdevk: Compile to JavaScript using dartdevc (same as ddc).
app_jitk: Compile the Dart code into Kernel and then into an app
snapshot.
dartk: Compile the Dart code into Kernel before running test.
Expand Down
1 change: 1 addition & 0 deletions pkg/test_runner/lib/src/process_queue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ class CommandExecutorImpl implements CommandExecutor {
(command.displayName == 'dart2js' ||
command.displayName == 'dartdevc' ||
command.displayName == 'dartdevk' ||
command.displayName == 'ddc' ||
command.displayName == 'fasta') &&
globalConfiguration.batch) {
return _getBatchRunner(command.displayName)
Expand Down
6 changes: 4 additions & 2 deletions pkg/test_runner/lib/src/test_suite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ abstract class TestSuite {
Compiler.dart2js,
Compiler.dartdevc,
Compiler.dartdevk,
Compiler.ddc,
}.contains(configuration.compiler)) {
return true;
}
Expand Down Expand Up @@ -942,7 +943,7 @@ class StandardTestSuite extends TestSuite {
testFile.sharedOptions.contains('--null-assertions');
var weakNullSafetyErrors =
testFile.ddcOptions.contains('--weak-null-safety-errors');
content = dartdevcHtml(
content = ddcHtml(
nameNoExt,
nameFromModuleRootNoExt,
jsDir,
Expand All @@ -963,7 +964,8 @@ class StandardTestSuite extends TestSuite {
Compiler.dart2js,
Compiler.dart2wasm,
Compiler.dartdevc,
Compiler.dartdevk
Compiler.dartdevk,
Compiler.ddc
};
assert(supportedCompilers.contains(configuration.compiler));

Expand Down
2 changes: 1 addition & 1 deletion tests/co19/co19-dartdevc.status
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

[ $compiler == dartdevc || $compiler == dartdevk ]
[ $compiler == dartdevc || $compiler == dartdevk || $compiler == ddc ]
Language/Expressions/Constants/integer_size_t03: SkipByDesign # uses integer literal not representable as JavaScript number
Language/Expressions/Constants/integer_size_t04: SkipByDesign # uses integer literal not representable as JavaScript number
Language/Expressions/Constants/literal_number_t01: SkipByDesign # uses integer literal not representable as JavaScript number
Expand Down
2 changes: 1 addition & 1 deletion tests/co19_2/co19_2-dartdevc.status
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

[ $compiler == dartdevc || $compiler == dartdevk ]
[ $compiler == dartdevc || $compiler == dartdevk || $compiler == ddc ]
Language/Classes/Constructors/Generative_Constructors/formal_parameter_t07: SkipSlow
Language/Classes/Constructors/Generative_Constructors/fresh_instance_t01: SkipSlow
Language/Classes/Constructors/Generative_Constructors/implicit_superinitializer_t01: SkipSlow
Expand Down
6 changes: 3 additions & 3 deletions tests/corelib/corelib.status
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dynamic_nosuchmethod_test: SkipByDesign # Expects names in NSM
error_stack_trace1_test: SkipByDesign # Expects unobfuscated stack trace
type_tostring_test: SkipByDesign # Expects names in Type.toString()

[ $compiler != dart2analyzer && $compiler != dart2js && $compiler != dartdevc && $compiler != dartdevk ]
[ $compiler != dart2analyzer && $compiler != dart2js && $compiler != dartdevc && $compiler != dartdevk && $compiler != ddc ]
bigint_js_test: SkipByDesign # JavaScript-specific test

[ $compiler == dart2js && $runtime != none ]
Expand All @@ -35,7 +35,7 @@ regexp/pcre_test: Slow, Pass # Issue 21593
[ $runtime != dart_precompiled && $runtime != vm ]
reg_exp_receive_port_test: SkipByDesign # uses SendPort/ReceivePort

[ $runtime != none && ($compiler == dart2js || $compiler == dartdevc || $compiler == dartdevk) ]
[ $runtime != none && ($compiler == dart2js || $compiler == dartdevc || $compiler == dartdevk || $compiler == ddc) ]
int_parse_with_limited_ints_test: SkipByDesign # Requires fixed-size int64 support.
integer_arith_vm_test: SkipByDesign # Is a VM optimization test that requires int64 support.
iterable_return_type_int64_test: SkipByDesign # Requires int64 support.
Expand All @@ -45,7 +45,7 @@ typed_data_with_limited_ints_test: SkipByDesign # Requires fixed-size int64 supp
bigint_parse_radix_test: Skip # Issue 31659
bigint_test: Skip # Issue 31659

[ $compiler == dartdevc || $compiler == dartdevk ]
[ $compiler == dartdevc || $compiler == dartdevk || $compiler == ddc ]
bigint_test/03: SkipSlow # modPow is very slow
bigint_test/15: SkipSlow # modPow is very slow
list_concurrent_modify_self_test: SkipSlow # missing check causes list to grow to whole heap
Expand Down
10 changes: 4 additions & 6 deletions tests/corelib_2/corelib_2.status
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
bigint_parse_radix_test/3: Slow # Issue http://dartbug.com/47050
bigint_test: Pass, Slow

[ $compiler == dartdevk ]
regexp/lookbehind_test/01: Skip # Flaky in uncatchable way. Issue 36280

[ $compiler == dartkp ]
bigint_parse_radix_test: Slow, Pass # --no_intrinsify
bigint_test/03: SkipSlow # --no_intrinsify
Expand All @@ -32,7 +29,7 @@ dynamic_nosuchmethod_test: SkipByDesign # Expects names in NSM
error_stack_trace1_test: SkipByDesign # Expects unobfuscated stack trace
type_tostring_test: SkipByDesign # Expects names in Type.toString()

[ $compiler != dart2analyzer && $compiler != dart2js && $compiler != dartdevc && $compiler != dartdevk ]
[ $compiler != dart2analyzer && $compiler != dart2js && $compiler != dartdevc && $compiler != dartdevk && $compiler != ddc ]
bigint_js_test: SkipByDesign # JavaScript-specific test

[ $compiler == dart2js && $runtime != none ]
Expand All @@ -41,7 +38,7 @@ regexp/pcre_test: Slow, Pass # Issue 21593
[ $runtime != dart_precompiled && $runtime != vm ]
reg_exp_receive_port_test: SkipByDesign # uses SendPort/ReceivePort

[ $runtime != none && ($compiler == dart2js || $compiler == dartdevc || $compiler == dartdevk) ]
[ $runtime != none && ($compiler == dart2js || $compiler == dartdevc || $compiler == dartdevk || $compiler == ddc) ]
int_parse_with_limited_ints_test: SkipByDesign # Requires fixed-size int64 support.
integer_arith_vm_test: SkipByDesign # Is a VM optimization test that requires int64 support.
iterable_return_type_int64_test: SkipByDesign # Requires int64 support.
Expand All @@ -51,10 +48,11 @@ typed_data_with_limited_ints_test: SkipByDesign # Requires fixed-size int64 supp
bigint_parse_radix_test: Skip # Issue 31659
bigint_test: Skip # Issue 31659

[ $compiler == dartdevc || $compiler == dartdevk ]
[ $compiler == dartdevc || $compiler == dartdevk || $compiler == ddc ]
bigint_test/03: SkipSlow # modPow is very slow
bigint_test/15: SkipSlow # modPow is very slow
list_concurrent_modify_self_test: SkipSlow # missing check causes list to grow to whole heap
regexp/lookbehind_test/01: Skip # Flaky in uncatchable way. Issue 36280
uri_parse_test: Slow, Pass
uri_test: Slow, Pass

Expand Down
2 changes: 1 addition & 1 deletion tests/dartdevc_2/dartdevc_native_dartdevc.status
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

# Sections in this file should contain "$compiler == dartdevc" or dartdevk.
# Sections in this file should contain "$compiler == dartdevc", dartdevk or ddc.
4 changes: 2 additions & 2 deletions tests/language/language_dartdevc.status
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

# Sections in this file should contain "$compiler == dartdevc" or dartdevk.
# Sections in this file should contain "$compiler == dartdevc", dartdevk or ddc.

[ $compiler == dartdevc || $compiler == dartdevk ]
[ $compiler == dartdevc || $compiler == dartdevk || $compiler == ddc ]
async_star/throw_in_catch_test: Skip # Times out. Issue 29920
external_abstract_fields/external_fields_test: SkipByDesign # Non-JS-interop external members are not supported
number/int64_literal_runtime*_test: Skip # This is testing Dart 2.0 int64 semantics.
Expand Down
6 changes: 3 additions & 3 deletions tests/language_2/language_2_dartdevc.status
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

# Sections in this file should contain "$compiler == dartdevc" or dartdevk.
# Sections in this file should contain "$compiler == dartdevc", dartdevk or ddc.

[ ($compiler == dartdevc || $compiler == dartdevk) && ($runtime == ff || $runtime == firefox) ]
[ ($compiler == dartdevc || $compiler == dartdevk || $compiler == ddc) && ($runtime == ff || $runtime == firefox) ]
async/return_throw_test: Skip # Flaky but not enough to be detected. Re-enable pending a decision on the correct behavior. https://github.com/dart-lang/sdk/issues/44395

[ $compiler == dartdevc || $compiler == dartdevk ]
[ $compiler == dartdevc || $compiler == dartdevk || $compiler == ddc ]
async_star/throw_in_catch_test: Skip # Times out. Issue 29920
external_abstract_fields/external_fields_test: SkipByDesign # Non-JS-interop external members are not supported
number/int64_literal_runtime*_test: Skip # This is testing Dart 2.0 int64 semantics.
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/lib.status
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ js/mock_test/*: SkipByDesign # Issue 42085.
js/parameters_test: SkipByDesign # Issue 42085.
js/trust_types_test: SkipByDesign # Issue 42085. CSP policy disallows injected JS code

[ $compiler != dart2js && $compiler != dartdevc && $compiler != dartdevk ]
[ $compiler != dart2js && $compiler != dartdevc && $compiler != dartdevk && $compiler != ddc ]
web/*: SkipByDesign

[ $runtime == chrome && $system == macos ]
Expand Down
27 changes: 22 additions & 5 deletions tests/lib/lib_dartdevc.status
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,36 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

[ $runtime == chrome && ($compiler == dartdevc || $compiler == dartdevk) ]
[ $builder_tag == canary && ($compiler == dartdevc || $compiler == dartdevk || $compiler == ddc) ]
async/catch_errors11_test: Skip # Issue 50666
async/catch_errors12_test: Skip # Issue 50666
async/catch_errors15_test: Skip # Issue 50666
async/catch_errors17_test: Skip # Issue 50666
async/catch_errors20_test: Skip # Issue 50666
async/catch_errors21_test: Skip # Issue 50666
async/catch_errors23_test: Skip # Issue 50666
async/catch_errors24_test: Skip # Issue 50666
async/catch_errors26_test: Skip # Issue 50666
async/catch_errors27_test: Skip # Issue 50666
async/catch_errors5_test: Skip # Issue 50666
async/catch_errors7_test: Skip # Issue 50666
async/catch_errors8_test: Skip # Issue 50666
async/stream_iterator_test: Skip # Issue 50666
async/stream_zones_test: Skip # Issue 50666

[ $runtime == chrome && ($compiler == dartdevc || $compiler == dartdevk || $compiler == ddc) ]
html/js_dispatch_property_test: Skip # Timeout Issue 31030

[ $system == linux && ($compiler == dartdevc || $compiler == dartdevk) ]
[ $system == linux && ($compiler == dartdevc || $compiler == dartdevk || $compiler == ddc) ]
html/interactive_geolocation_test: Skip # Requires allowing geo location.

[ $system == macos && ($compiler == dartdevc || $compiler == dartdevk) ]
[ $system == macos && ($compiler == dartdevc || $compiler == dartdevk || $compiler == ddc) ]
html/interactive_media_test: Skip # Requires interactive camera, microphone permissions.

[ $system == windows && ($compiler == dartdevc || $compiler == dartdevk) ]
[ $system == windows && ($compiler == dartdevc || $compiler == dartdevk || $compiler == ddc) ]
html/xhr_test: Skip # Times out. Issue 21527

[ $compiler == dartdevc || $compiler == dartdevk ]
[ $compiler == dartdevc || $compiler == dartdevk || $compiler == ddc ]
convert/chunked_conversion_utf88_test: Slow, Pass
convert/json_utf8_chunk_test: Slow, Pass
convert/streamed_conversion_utf8_decode_test: Slow, Pass # Issue 29922
Expand Down
Loading

0 comments on commit 9e95988

Please sign in to comment.