aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/LocalDiffAwareness.java
diff options
context:
space:
mode:
authorGravatar Ulf Adams <ulfjack@google.com>2015-08-28 12:37:42 +0000
committerGravatar John Field <jfield@google.com>2015-08-28 15:00:24 +0000
commitf608b72f4f037371aff94365714ee8cc56a5f412 (patch)
tree3291438ce7678e1bc0a2d47354d97659b63b6efe /src/main/java/com/google/devtools/build/lib/skyframe/LocalDiffAwareness.java
parent750909cb3c2bd7b47ae02cb78cf4f19c954fc121 (diff)
Remove the WATCHFS_BLACKLIST from Constants.java.
Instead, inject the list from the corresponding module. -- MOS_MIGRATED_REVID=101769355
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/LocalDiffAwareness.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/LocalDiffAwareness.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/LocalDiffAwareness.java b/src/main/java/com/google/devtools/build/lib/skyframe/LocalDiffAwareness.java
index dba00768ce..8d8c8dbde2 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/LocalDiffAwareness.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/LocalDiffAwareness.java
@@ -17,9 +17,9 @@ package com.google.devtools.build.lib.skyframe;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.HashBiMap;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
-import com.google.devtools.build.lib.Constants;
import com.google.devtools.build.lib.vfs.ModifiedFileSet;
import com.google.devtools.build.lib.vfs.PathFragment;
@@ -49,6 +49,17 @@ public class LocalDiffAwareness implements DiffAwareness {
/** Factory for creating {@link LocalDiffAwareness} instances. */
public static class Factory implements DiffAwareness.Factory {
+ private final ImmutableList<String> prefixBlacklist;
+
+ /**
+ * Creates a new factory; the file system watcher may not work on all file systems, particularly
+ * for network file systems. The prefix blacklist can be used to blacklist known paths that
+ * point to network file systems.
+ */
+ public Factory(ImmutableList<String> prefixBlacklist) {
+ this.prefixBlacklist = prefixBlacklist;
+ }
+
@Override
public DiffAwareness maybeCreate(com.google.devtools.build.lib.vfs.Path pathEntry) {
com.google.devtools.build.lib.vfs.Path resolvedPathEntry;
@@ -60,7 +71,7 @@ public class LocalDiffAwareness implements DiffAwareness {
PathFragment resolvedPathEntryFragment = resolvedPathEntry.asFragment();
// There's no good way to automatically detect network file systems. We rely on a blacklist
// for now (and maybe add a command-line option in the future?).
- for (String prefix : Constants.WATCHFS_BLACKLIST) {
+ for (String prefix : prefixBlacklist) {
if (resolvedPathEntryFragment.startsWith(new PathFragment(prefix))) {
return null;
}