Skip to content

Commit

Permalink
[test_runner] Avoid potential errors using the wrong SDK fork in paths
Browse files Browse the repository at this point in the history
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 <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
  • Loading branch information
nshahan authored and commit-bot@chromium.org committed Dec 18, 2019
1 parent 82f1f2f commit 171059d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/test_runner/lib/src/compiler_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ class Dart2xCompilerConfiguration extends CompilerConfiguration {
: super._subclass(configuration);

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

if (_isHostChecked) {
Expand Down Expand Up @@ -459,7 +461,9 @@ class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration {
CommandArtifact artifact) {
var sdk = _useSdk
? Uri.directory(_configuration.buildDirectory).resolve('dart-sdk/')
: Uri.directory(Repository.dir.toNativePath()).resolve('sdk/');
: Uri.directory(Repository.dir.toNativePath()).resolve(
// TODO(38701): Cleanup after merging the forked SDK into mainline.
_configuration.nnbdMode == NnbdMode.legacy ? 'sdk/' : 'sdk_nnbd/');
var preambleDir = sdk.resolve('lib/_internal/js_runtime/lib/preambles/');
return runtimeConfiguration.dart2jsPreambles(preambleDir)
..add(artifact.filename);
Expand Down Expand Up @@ -492,6 +496,7 @@ class DevCompilerConfiguration extends CompilerConfiguration {
String computeCompilerPath() {
var dir = _useSdk
? "${_configuration.buildDirectory}/dart-sdk"
// TODO(38701): Cleanup after merging the forked SDK into mainline.
: _configuration.nnbdMode == NnbdMode.legacy ? "sdk" : "sdk_nnbd";
return "$dir/bin/dartdevc$shellScriptExtension";
}
Expand Down Expand Up @@ -916,7 +921,9 @@ class AnalyzerCompilerConfiguration extends CompilerConfiguration {
int get timeoutMultiplier => 4;

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

0 comments on commit 171059d

Please sign in to comment.