diff options
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupFunction.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupFunction.java index 68c9ff8353..f3ca9881c6 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupFunction.java @@ -14,6 +14,7 @@ package com.google.devtools.build.lib.skyframe; import com.google.devtools.build.lib.cmdline.PackageIdentifier; +import com.google.devtools.build.lib.skyframe.PackageLookupValue.IncorrectRepositoryReferencePackageLookupValue; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.skyframe.SkyFunction; import com.google.devtools.build.skyframe.SkyKey; @@ -38,6 +39,16 @@ public class ContainingPackageLookupFunction implements SkyFunction { return ContainingPackageLookupValue.withContainingPackage(dir, pkgLookupValue.getRoot()); } + // Does the requested package cross into a sub-repository, which we should report via the + // correct package identifier? + if (pkgLookupValue instanceof IncorrectRepositoryReferencePackageLookupValue) { + IncorrectRepositoryReferencePackageLookupValue incorrectPackageLookupValue = + (IncorrectRepositoryReferencePackageLookupValue) pkgLookupValue; + PackageIdentifier correctPackageIdentifier = + incorrectPackageLookupValue.getCorrectedPackageIdentifier(); + return env.getValue(ContainingPackageLookupValue.key(correctPackageIdentifier)); + } + PathFragment parentDir = dir.getPackageFragment().getParentDirectory(); if (parentDir == null) { return ContainingPackageLookupValue.NONE; |