aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.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,