Skip to content

Commit 579de4e

Browse files
sigmundchCommit Queue
authored andcommitted
[dyn-modules] fix ddc test runner in windows
Windows paths of the form `c:` are parsed incorrectly by the subprocesses actions when reading the package path. This change ensures they are encoded as `file:` URIs instead to ensure they are parsed properly. Fixes #56725 TESTED=dynamic_modules_suite Change-Id: Iadcfc8bf08b8845620dcf2be5fafadb975a8edc2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397180 Reviewed-by: Nate Biggs <[email protected]> Commit-Queue: Sigmund Cherem <[email protected]>
1 parent 1086762 commit 579de4e

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

pkg/dynamic_modules/test/runner/ddc.dart

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class DdcExecutor implements TargetExecutor {
7676
'$ddcSdkOutline',
7777
// Note: this needs to change if we ever intend to support packages within
7878
// the dynamic loading tests themselves
79-
'--packages=${repoRoot.toFilePath()}/.dart_tool/package_config.json',
79+
'--packages=$repoRoot/.dart_tool/package_config.json',
8080
if (!isMain) ...[
8181
// TODO(sigmund): consider specifying the module name directly
8282
'--dynamic-module',
@@ -95,15 +95,15 @@ class DdcExecutor implements TargetExecutor {
9595
var testDir = _tmp.uri.resolve(testName).toFilePath();
9696
var args = [
9797
'--packages=${repoRoot.toFilePath()}/.dart_tool/package_config.json',
98-
kernelWOrkerAotSnapshot.toFilePath(),
98+
kernelWorkerAotSnapshot.toFilePath(),
9999
'--summary-only',
100100
'--target',
101101
'ddc',
102102
'--multi-root',
103103
'${sourceDir.resolve('../../')}',
104104
'--multi-root-scheme',
105105
rootScheme,
106-
'--packages-file=${repoRoot.toFilePath()}/.dart_tool/package_config.json',
106+
'--packages-file=$repoRoot/.dart_tool/package_config.json',
107107
'--dart-sdk-summary',
108108
'$ddcSdkOutline',
109109
'--source',
@@ -142,12 +142,13 @@ class DdcExecutor implements TargetExecutor {
142142
var testDir = _tmp.uri.resolve('${test.name}/');
143143
var bootstrapUri = testDir.resolve('bootstrap.js');
144144
// TODO(sigmund): remove hardwired entrypoint name
145+
String toPath(Uri uri) => uri.toFilePath().replaceAll('\\', '\\\\');
145146
File.fromUri(bootstrapUri).writeAsStringSync('''
146-
load('${ddcPreamblesJs.toFilePath()}'); // preambles/d8.js
147-
load('${ddcSealNativeObjectJs.toFilePath()}'); // seal_native_object.js
148-
load('${ddcModuleLoaderJs.toFilePath()}'); // ddc_module_loader.js
149-
load('${ddcSdkJs.toFilePath()}'); // dart_sdk.js
150-
load('main.dart.js'); // compiled test module
147+
load('${toPath(ddcPreamblesJs)}'); // preambles/d8.js
148+
load('${toPath(ddcSealNativeObjectJs)}'); // seal_native_object.js
149+
load('${toPath(ddcModuleLoaderJs)}'); // ddc_module_loader.js
150+
load('${toPath(ddcSdkJs)}'); // dart_sdk.js
151+
load('main.dart.js'); // compiled test module
151152
152153
self.dartMainRunner(function () {
153154
dart_library.configure(

pkg/dynamic_modules/test/runner/util.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Uri _dartBin = Uri.file(Platform.resolvedExecutable);
6868
Uri dartAotBin = _dartBin
6969
.resolve(Platform.isWindows ? 'dartaotruntime.exe' : 'dartaotruntime');
7070
Uri ddcAotSnapshot = _dartBin.resolve('snapshots/dartdevc_aot.dart.snapshot');
71-
Uri kernelWOrkerAotSnapshot =
71+
Uri kernelWorkerAotSnapshot =
7272
_dartBin.resolve('snapshots/kernel_worker_aot.dart.snapshot');
7373
Uri buildRootUri = repoRoot.resolve(buildFolder);
7474
Uri ddcSdkOutline = buildRootUri.resolve('ddc_outline.dill');

0 commit comments

Comments
 (0)