diff options
author | Nathan Harmata <nharmata@google.com> | 2016-04-17 02:46:15 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-04-18 10:43:29 +0000 |
commit | 4d89d118048a4979a1ff2e69e3e99ffbc2056b14 (patch) | |
tree | ee319e9b9d512fb80e2a3504895bb8afecb899f8 /src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java | |
parent | 9c5e4bf20dec3c8be4d50b406d69ecf84c6e8322 (diff) |
Fix SkyQuery bug where we weren't respecting the package blacklist. We do this by changing both the relevant Skyframe and the SkyQuery code to propagate (minimal!) blacklist information in the SkyKeys themselves.
There are other approaches to solving this problem, but I like how this solution doesn't involve duplication of logic. Also, it has the following nice benefit: previously, RecursiveDirectoryTraversalFunction would declare a dep on the blacklist for every directory traversed which adds an edge for each directory traversed.
--
MOS_MIGRATED_REVID=120049635
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java index 5b5ee60ce8..72d07b8542 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java @@ -19,7 +19,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Maps; -import com.google.common.collect.Sets; import com.google.devtools.build.lib.analysis.BlazeDirectories; import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.devtools.build.lib.cmdline.RepositoryName; @@ -45,7 +44,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.Set; /** * RecursiveDirectoryTraversalFunction traverses the subdirectories of a directory, looking for @@ -139,13 +137,7 @@ abstract class RecursiveDirectoryTraversalFunction */ TReturn visitDirectory(RecursivePkgKey recursivePkgKey, Environment env) { RootedPath rootedPath = recursivePkgKey.getRootedPath(); - BlacklistedPackagePrefixesValue blacklist = - (BlacklistedPackagePrefixesValue) env.getValue(BlacklistedPackagePrefixesValue.key()); - if (blacklist == null) { - return null; - } - Set<PathFragment> excludedPaths = - Sets.union(recursivePkgKey.getExcludedPaths(), blacklist.getPatterns()); + ImmutableSet<PathFragment> excludedPaths = recursivePkgKey.getExcludedPaths(); Path root = rootedPath.getRoot(); PathFragment rootRelativePath = rootedPath.getRelativePath(); |