Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(830)

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_target.dart

Issue 2805663002: Document file names in deps files. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
index ab66f3da581a1d948dd532a876bc334de6a75d6d..2abba433b4e3839b276cc50f741d50512a0fd145 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -286,7 +286,27 @@ class KernelTarget extends TargetImplementation {
Future writeDepsFile(Uri output, Uri depsFile,
{Iterable<Uri> extraDependencies}) async {
String toRelativeFilePath(Uri uri) {
- return Uri.parse(relativizeUri(uri)).toFilePath();
+ // Ninja expects to find file names relative to the current working
+ // directory. We've tried making them relative to the deps file, but that
+ // doesn't work for downstream projects. Making them absolute also
+ // doesn't work.
+ //
+ // We can test if it works by running ninja twice, for example:
+ //
+ // ninja -C xcodebuild/ReleaseX64 runtime_kernel -d explain
+ // ninja -C xcodebuild/ReleaseX64 runtime_kernel -d explain
+ //
+ // The second time, ninja should say:
+ //
+ // ninja: Entering directory `xcodebuild/ReleaseX64'
+ // ninja: no work to do.
+ //
+ // It's broken if it says something like this:
+ //
+ // ninja explain: expected depfile 'patched_sdk.d' to mention
+ // 'patched_sdk/platform.dill', got
+ // '/.../xcodebuild/ReleaseX64/patched_sdk/platform.dill'
+ return Uri.parse(relativizeUri(uri, base: Uri.base)).toFilePath();
}
if (loader.first == null) return null;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698