diff options
author | John Cater <jcater@google.com> | 2017-11-20 08:09:02 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-11-20 08:11:46 -0800 |
commit | 4117c867fe8e560f53bc1c7106af9c2889cc18f2 (patch) | |
tree | d3821713ce41036407863db6ecb755e12b060885 /src/main/java/com/google/devtools/build/lib | |
parent | 81a77e69a3e3bb9308d8bd72facea1e40b3c7bcf (diff) |
Update GlobFunction to check for subdirectories crossing into a local repository.
Part of #4056.
Change-Id: I4b8e41660b0a135e23aa572bbfeea27a7cda0581
PiperOrigin-RevId: 176362103
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java index 22bb42807f..16846bc621 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java @@ -74,6 +74,10 @@ public final class GlobFunction implements SkyFunction { // We crossed the package boundary, that is, pkg/subdir contains a BUILD file and thus // defines another package, so glob expansion should not descend into that subdir. return GlobValue.EMPTY; + } else if (globSubdirPkgLookupValue + instanceof PackageLookupValue.IncorrectRepositoryReferencePackageLookupValue) { + // We crossed a repository boundary, so glob expansion should not descend into that subdir. + return GlobValue.EMPTY; } } @@ -351,11 +355,18 @@ public final class GlobFunction implements SkyFunction { valueRequested, fileName, glob); - if (!((PackageLookupValue) valueRequested).packageExists()) { + PackageLookupValue packageLookupValue = (PackageLookupValue) valueRequested; + if (packageLookupValue.packageExists()) { + // This is a separate package, so ignore it. + return null; + } else if (packageLookupValue + instanceof PackageLookupValue.IncorrectRepositoryReferencePackageLookupValue) { + // This is a separate repository, so ignore it. + return null; + } else { return glob.getSubdir().getRelative(fileName); } } - return null; } @Nullable |