From 2022ad876a991609984e42030453602bac9f2882 Mon Sep 17 00:00:00 2001 From: Nathan Harmata Date: Mon, 22 Feb 2016 23:04:14 +0000 Subject: 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 --- src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java') 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(); } -- cgit v1.2.3