Use full package identifier in containing package check
Otherwise a @x//a/b will be seen as crossing @y//a's package boundary.
--
MOS_MIGRATED_REVID=100465538
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 c342eca..af32b56 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
@@ -738,7 +738,8 @@
// The label does not cross a subpackage boundary.
return false;
}
- if (!containingPkg.getPackageFragment().startsWith(label.getPackageFragment())) {
+ if (!containingPkg.getPathFragment().startsWith(
+ label.getPackageIdentifier().getPathFragment())) {
// This label is referencing an imaginary package, because the containing package should
// extend the label's package: if the label is //a/b:c/d, the containing package could be
// //a/b/c or //a/b, but should never be //a. Usually such errors will be caught earlier, but