diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java index e183366c11..8cefd9c0a7 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java @@ -659,42 +659,7 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver try { SkyValue value = depsEntry.getValue().get(); if (populateInputData) { - if (value instanceof AggregatingArtifactValue) { - AggregatingArtifactValue aggregatingValue = (AggregatingArtifactValue) value; - for (Pair<Artifact, FileArtifactValue> entry : aggregatingValue.getFileArtifacts()) { - inputArtifactData.put(entry.first, entry.second); - } - for (Pair<Artifact, TreeArtifactValue> entry : aggregatingValue.getTreeArtifacts()) { - expandTreeArtifactAndPopulateArtifactData( - entry.getFirst(), - Preconditions.checkNotNull(entry.getSecond()), - expandedArtifacts, - inputArtifactData); - } - // We have to cache the "digest" of the aggregating value itself, - // because the action cache checker may want it. - inputArtifactData.put(input, aggregatingValue.getSelfData()); - // While not obvious at all this code exists to ensure that we don't expand the - // .runfiles/MANIFEST file into the inputs. The reason for that being that the MANIFEST - // file contains absolute paths that don't work with remote execution. - // Instead, the way the SpawnInputExpander expands runfiles is via the Runfiles class - // which contains all artifacts in the runfiles tree minus the MANIFEST file. - // TODO(buchgr): Clean this up and get rid of the RunfilesArtifactValue type. - if (!(value instanceof RunfilesArtifactValue)) { - ImmutableList.Builder<Artifact> expansionBuilder = ImmutableList.builder(); - for (Pair<Artifact, FileArtifactValue> pair : aggregatingValue.getFileArtifacts()) { - expansionBuilder.add(Preconditions.checkNotNull(pair.getFirst())); - } - expandedArtifacts.put(input, expansionBuilder.build()); - } - } else if (value instanceof TreeArtifactValue) { - expandTreeArtifactAndPopulateArtifactData( - input, (TreeArtifactValue) value, expandedArtifacts, inputArtifactData); - - } else { - Preconditions.checkState(value instanceof FileArtifactValue, depsEntry); - inputArtifactData.put(input, (FileArtifactValue) value); - } + ActionInputMapHelper.addToMap(inputArtifactData, expandedArtifacts, input, value); } } catch (MissingInputFileException e) { missingCount++; @@ -746,22 +711,6 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver return Pair.of(inputArtifactData, expandedArtifacts); } - private static void expandTreeArtifactAndPopulateArtifactData( - Artifact treeArtifact, - TreeArtifactValue value, - Map<Artifact, Collection<Artifact>> expandedArtifacts, - ActionInputMap inputArtifactData) { - ImmutableSet.Builder<Artifact> children = ImmutableSet.builder(); - for (Map.Entry<Artifact.TreeFileArtifact, FileArtifactValue> child : - value.getChildValues().entrySet()) { - children.add(child.getKey()); - inputArtifactData.put(child.getKey(), child.getValue()); - } - expandedArtifacts.put(treeArtifact, children.build()); - // Again, we cache the "digest" of the value for cache checking. - inputArtifactData.put(treeArtifact, value.getSelfData()); - } - private static Iterable<Artifact> filterKnownInputs( Iterable<Artifact> newInputs, ActionInputMap inputArtifactData) { return Iterables.filter(newInputs, input -> inputArtifactData.getMetadata(input) == null); |