aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java
diff options
context:
space:
mode:
authorGravatar Nathan Harmata <nharmata@google.com>2016-02-22 23:04:14 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-02-23 13:08:38 +0000
commit2022ad876a991609984e42030453602bac9f2882 (patch)
tree05db5b6a99d858b96d0afa134b04f76368daa74a /src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java
parent3f8fe0ded2a05b8e971c68c18cf820faba01fa1f (diff)
Fix blatant bug with Skyframe globbing where we incorrectly allow dangling symlinks to match a glob pattern.
This bug has/had two consequences: (1) Change pruning will incorrectly cut off changes to GlobValues that ought to now match more files (say, if a dangling symlink comes into existence), causing a package to be incorrectly incrementally not re-loaded. (2) After a recent change to PackageFunction where we use a fancy hybrid globbing approach, we use skyframe globbing on incremental package loading. So if a re-loaded package has the same glob pattern but this glob pattern incorrectly matches a dangling symlink, the re-loaded package will incorrectly have a target for the dangling symlink path. -- MOS_MIGRATED_REVID=115274842
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java3
1 files changed, 3 insertions, 0 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 50b7c294c7..e1c877f455 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
@@ -146,6 +146,9 @@ public final class GlobFunction implements SkyFunction {
"readdir and stat disagree about whether " + symlinkRootedPath.asPath()
+ " is a symlink."), Transience.TRANSIENT);
}
+ if (!symlinkFileValue.exists()) {
+ continue;
+ }
isDirectory = symlinkFileValue.isDirectory();
}