Skip to content

Commit 171059d

Browse files
nshahancommit-bot@chromium.org
authored andcommitted
[test_runner] Avoid potential errors using the wrong SDK fork in paths
Followup from comments in https://dart-review.googlesource.com/c/sdk/+/128570 Change-Id: I12c1f157154d0bc30e08d0b0f5631946fc00f361 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128774 Commit-Queue: Nicholas Shahan <[email protected]> Reviewed-by: Bob Nystrom <[email protected]>
1 parent 82f1f2f commit 171059d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/test_runner/lib/src/compiler_configuration.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,9 @@ class Dart2xCompilerConfiguration extends CompilerConfiguration {
367367
: super._subclass(configuration);
368368

369369
String computeCompilerPath() {
370-
var prefix = 'sdk/bin';
370+
var prefix =
371+
// TODO(38701): Cleanup after merging the forked SDK into mainline.
372+
_configuration.nnbdMode == NnbdMode.legacy ? 'sdk/bin' : 'sdk_nnbd/bin';
371373
var suffix = shellScriptExtension;
372374

373375
if (_isHostChecked) {
@@ -459,7 +461,9 @@ class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration {
459461
CommandArtifact artifact) {
460462
var sdk = _useSdk
461463
? Uri.directory(_configuration.buildDirectory).resolve('dart-sdk/')
462-
: Uri.directory(Repository.dir.toNativePath()).resolve('sdk/');
464+
: Uri.directory(Repository.dir.toNativePath()).resolve(
465+
// TODO(38701): Cleanup after merging the forked SDK into mainline.
466+
_configuration.nnbdMode == NnbdMode.legacy ? 'sdk/' : 'sdk_nnbd/');
463467
var preambleDir = sdk.resolve('lib/_internal/js_runtime/lib/preambles/');
464468
return runtimeConfiguration.dart2jsPreambles(preambleDir)
465469
..add(artifact.filename);
@@ -492,6 +496,7 @@ class DevCompilerConfiguration extends CompilerConfiguration {
492496
String computeCompilerPath() {
493497
var dir = _useSdk
494498
? "${_configuration.buildDirectory}/dart-sdk"
499+
// TODO(38701): Cleanup after merging the forked SDK into mainline.
495500
: _configuration.nnbdMode == NnbdMode.legacy ? "sdk" : "sdk_nnbd";
496501
return "$dir/bin/dartdevc$shellScriptExtension";
497502
}
@@ -916,7 +921,9 @@ class AnalyzerCompilerConfiguration extends CompilerConfiguration {
916921
int get timeoutMultiplier => 4;
917922

918923
String computeCompilerPath() {
919-
var prefix = 'sdk/bin';
924+
var prefix =
925+
// TODO(38701): Cleanup after merging the forked SDK into mainline.
926+
_configuration.nnbdMode == NnbdMode.legacy ? 'sdk/bin' : 'sdk_nnbd/bin';
920927
if (_isHostChecked) {
921928
if (_useSdk) {
922929
throw "--host-checked and --use-sdk cannot be used together";

0 commit comments

Comments
 (0)