aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java
index 47cd18f278..3027a3841b 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java
@@ -153,10 +153,7 @@ public class ActionMetadataHandler implements MetadataHandler {
|| value == FileArtifactValue.OMITTED_FILE_MARKER) {
throw new FileNotFoundException();
}
- // If the file is a directory, we need to return the mtime because the action cache uses mtime
- // to determine if this artifact has changed. We want this code path to go away somehow
- // for directories (maybe by implementing FileSet in Skyframe).
- return value.isFile() ? new Metadata(value.getDigest()) : new Metadata(value.getModifiedTime());
+ return value;
}
@Nullable
@@ -218,7 +215,7 @@ public class ActionMetadataHandler implements MetadataHandler {
if (!fileValue.exists()) {
throw new FileNotFoundException(artifact.prettyPrint() + " does not exist");
}
- return new Metadata(Preconditions.checkNotNull(fileValue.getDigest(), artifact));
+ return FileArtifactValue.createNormalFile(fileValue);
}
// We do not cache exceptions besides nonexistence here, because it is unlikely that the file
// will be requested from this cache too many times.
@@ -256,7 +253,7 @@ public class ActionMetadataHandler implements MetadataHandler {
if (isFile && !artifact.hasParent() && data.getDigest() != null) {
// We do not need to store the FileArtifactValue separately -- the digest is in the file value
// and that is all that is needed for this file's metadata.
- return new Metadata(data.getDigest());
+ return FileArtifactValue.createNormalFile(data);
}
// Unfortunately, the FileValue does not contain enough information for us to calculate the
// corresponding FileArtifactValue -- either the metadata must use the modified time, which we