aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java
diff options
context:
space:
mode:
authorGravatar Kevin Gessner <kgessner@etsy.com>2017-12-19 08:28:12 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-19 08:30:21 -0800
commitc93ef7ba6443d7546294eacfe9d21573a11aad70 (patch)
tree67c04176dc24eee6553e73a173d8c44d07c6e1f1 /src/main/java
parent497f58fa98d28a4c826c78a73132afc2f439d82f (diff)
look for the prelude in each repository (fixes #1673)
Instead of every package using the root repository's prelude, it is resolved in each repository for the packages in that repository. There weren't any tests using the prelude at all, so these are better than nothing. I wrote them as bash integration tests instead of Java tests because I couldn't get the prelude to work at all with `BuildViewTestCase` -- I'd be happy to share the busted test I wrote if someone would like to help debug it. Closes #3991. PiperOrigin-RevId: 179557018
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
index f873feac50..fbd9646a8e 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
@@ -541,7 +541,14 @@ public class PackageFunction implements SkyFunction {
return null;
}
- SkyKey astLookupKey = ASTFileLookupValue.key(preludeLabel);
+ // Load the prelude from the same repository as the package being loaded. Can't use
+ // Label.resolveRepositoryRelative because preludeLabel is in the main repository, not the
+ // default one, so it is resolved to itself.
+ Label pkgPreludeLabel =
+ Label.createUnvalidated(
+ PackageIdentifier.create(packageId.getRepository(), preludeLabel.getPackageFragment()),
+ preludeLabel.getName());
+ SkyKey astLookupKey = ASTFileLookupValue.key(pkgPreludeLabel);
ASTFileLookupValue astLookupValue = null;
try {
astLookupValue = (ASTFileLookupValue) env.getValueOrThrow(astLookupKey,