Replace FileValue with ArtifactFileMetadata for tracking metadata during execution. FileValue unnecessarily keeps a reference to a Path (via RootedPath) which is not needed for execution.
Did a drive-by functional change of getting rid of special-casing for empty file in ActionMetadataHandler: special handling of empty files has been gone for years. Also reworked comments to reflect the current state of the world (namely, additionalOutputData is often the primary source of metadata).
Only potential semantic change I can see is that we now get the last modified time of an artifact in FilesystemValueChecker by doing a getLastModifiedTime on the artifact's path directly, versus the real path of the FileValue. That is safe, though, because the real path of the FileValue came directly from our just reading the artifact this time.
PiperOrigin-RevId: 213005841
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTest.java
index 6f8a519..4ddc79f 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTest.java
@@ -31,12 +31,12 @@
import com.google.devtools.build.lib.actions.Artifact.SpecialArtifact;
import com.google.devtools.build.lib.actions.Artifact.SpecialArtifactType;
import com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact;
+import com.google.devtools.build.lib.actions.ArtifactFileMetadata;
import com.google.devtools.build.lib.actions.ArtifactOwner;
import com.google.devtools.build.lib.actions.ArtifactRoot;
import com.google.devtools.build.lib.actions.ArtifactSkyKey;
import com.google.devtools.build.lib.actions.BasicActionLookupValue;
import com.google.devtools.build.lib.actions.FileArtifactValue;
-import com.google.devtools.build.lib.actions.FileValue;
import com.google.devtools.build.lib.actions.MissingInputFileException;
import com.google.devtools.build.lib.actions.MutableActionGraph.ActionConflictException;
import com.google.devtools.build.lib.actions.util.ActionsTestUtil;
@@ -401,7 +401,7 @@
private static class SimpleActionExecutionFunction implements SkyFunction {
@Override
public SkyValue compute(SkyKey skyKey, Environment env) throws InterruptedException {
- Map<Artifact, FileValue> artifactData = new HashMap<>();
+ Map<Artifact, ArtifactFileMetadata> artifactData = new HashMap<>();
Map<Artifact, TreeArtifactValue> treeArtifactData = new HashMap<>();
Map<Artifact, FileArtifactValue> additionalOutputData = new HashMap<>();
ActionLookupData actionLookupData = (ActionLookupData) skyKey.argument();
@@ -421,7 +421,8 @@
treeFileArtifact2, FileArtifactValue.create(treeFileArtifact2)));
treeArtifactData.put(output, treeArtifactValue);
} else if (action.getActionType() == MiddlemanType.NORMAL) {
- FileValue fileValue = ActionMetadataHandler.fileValueFromArtifact(output, null, null);
+ ArtifactFileMetadata fileValue =
+ ActionMetadataHandler.fileMetadataFromArtifact(output, null, null);
artifactData.put(output, fileValue);
additionalOutputData.put(output, FileArtifactValue.create(output, fileValue));
} else {