mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:10:22 +00:00
[dartdevc] Properly encode Windows-style paths and paths with spaces for source maps
Change-Id: I32a28d7327a35c245a67343c91fdc74d6026d810 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108503 Commit-Queue: Mark Zhou <markzipan@google.com> Reviewed-by: Jake Macdonald <jakemac@google.com>
This commit is contained in:
parent
7820e807a6
commit
9a07c4a817
|
@ -56,7 +56,7 @@ class _CompilerWorker extends AsyncWorkerLoop {
|
|||
/// Build a map of uris to digests.
|
||||
final inputDigests = <Uri, List<int>>{};
|
||||
for (var input in request.inputs) {
|
||||
inputDigests[Uri.base.resolve(input.path)] = input.digest;
|
||||
inputDigests[sourcePathToUri(input.path)] = input.digest;
|
||||
}
|
||||
|
||||
lastResult = await runZoned(
|
||||
|
|
|
@ -369,7 +369,7 @@ Map placeSourceMap(Map sourceMap, String sourceMapPath,
|
|||
}
|
||||
|
||||
// Convert to a local file path if it's not.
|
||||
sourcePath = path.absolute(path.fromUri(uri));
|
||||
sourcePath = sourcePathToUri(path.absolute(path.fromUri(uri))).path;
|
||||
|
||||
// Allow bazel mappings to override.
|
||||
var match = bazelMappings[sourcePath];
|
||||
|
|
|
@ -150,7 +150,7 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
|
|||
oldState?.workerInputCache ?? new Map<Uri, WorkerInputComponent>();
|
||||
var sdkDigest = workerInputDigests[sdkSummary];
|
||||
if (sdkDigest == null) {
|
||||
throw new StateError("Expected to get sdk digest at $cachedSdkInput");
|
||||
throw new StateError("Expected to get sdk digest at $sdkSummary");
|
||||
}
|
||||
|
||||
cachedSdkInput = workerInputCache[sdkSummary];
|
||||
|
|
|
@ -372,5 +372,7 @@ class DevCompilerSummaryTarget extends DevCompilerTarget {
|
|||
|
||||
Uri _toUri(String uriString) {
|
||||
if (uriString == null) return null;
|
||||
return Uri.base.resolve(uriString);
|
||||
// Windows-style paths use '\', so convert them to '/' in case they've been
|
||||
// concatenated with Unix-style paths.
|
||||
return Uri.base.resolve(uriString.replaceAll("\\", "/"));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue