diff options
author | 2018-07-19 13:03:43 -0700 | |
---|---|---|
committer | 2018-07-19 13:05:07 -0700 | |
commit | 89188eb35a5b92f248d1eeb4b1549d9d1db10951 (patch) | |
tree | f2c4dd3bd111609ffa74368df661812eed471327 /src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java | |
parent | 96829fef59ca2400d274b402fa9fb7ea1eda0982 (diff) |
Check if ParentFileValue is a directory when evaluating a FileFunction node.
RELNOTES: None.
PiperOrigin-RevId: 205288166
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java index 53b1cec194..279f6afa06 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java @@ -21,7 +21,6 @@ import com.google.common.collect.Sets; import com.google.devtools.build.lib.actions.FileStateType; import com.google.devtools.build.lib.actions.FileStateValue; import com.google.devtools.build.lib.actions.FileValue; -import com.google.devtools.build.lib.actions.InconsistentFilesystemException; import com.google.devtools.build.lib.pkgcache.PathPackageLocator; import com.google.devtools.build.lib.util.Pair; import com.google.devtools.build.lib.vfs.Path; @@ -138,7 +137,7 @@ public class FileFunction implements SkyFunction { parentRealRootedPath.getRoot(), parentRealRootedPath.getRootRelativePath().getRelative(baseName)); - if (!parentFileValue.exists()) { + if (!parentFileValue.exists() || !parentFileValue.isDirectory()) { return Pair.<RootedPath, FileStateValue>of( realRootedPath, FileStateValue.NONEXISTENT_FILE_STATE_NODE); } @@ -150,14 +149,6 @@ public class FileFunction implements SkyFunction { if (realFileStateValue == null) { return null; } - if (realFileStateValue.getType() != FileStateType.NONEXISTENT - && parentFileValue != null && !parentFileValue.isDirectory()) { - String type = realFileStateValue.getType().toString().toLowerCase(); - String message = type + " " + rootedPath.asPath() + " exists but its parent " - + "path " + parentFileValue.realRootedPath().asPath() + " isn't an existing directory."; - throw new FileFunctionException(new InconsistentFilesystemException(message), - Transience.TRANSIENT); - } return Pair.of(realRootedPath, realFileStateValue); } |