[vm/dart2native] Ensure to normalize packages path (in addition to sourceFile) to guarantee consistency
The path normalization done by dart2native for "sourceFile" can cause
lower-casing of the path. We should do the same for the "packages" path.
TEST=Makes pkg/vm_snapshot_analysis/test/precompiler_trace_test pass on
Windows in unittest-asserts-release-win config.
Closes https://github.com/dart-lang/sdk/issues/43955
Change-Id: I3de0f2cc33d7a30280d4e815b0b7e3588f24e4f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170093
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
diff --git a/pkg/dart2native/lib/generate.dart b/pkg/dart2native/lib/generate.dart
index 7ce1f9a2..eb70dcf 100644
--- a/pkg/dart2native/lib/generate.dart
+++ b/pkg/dart2native/lib/generate.dart
@@ -32,6 +32,9 @@
final Directory tempDir = Directory.systemTemp.createTempSync();
try {
final sourcePath = path.canonicalize(path.normalize(sourceFile));
+ if (packages != null) {
+ packages = path.canonicalize(path.normalize(packages));
+ }
final Kind outputKind = {
'aot': Kind.aot,
'exe': Kind.exe,