aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Benjamin Peterson <bp@benjamin.pe>2018-06-03 22:11:16 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-03 22:12:32 -0700
commit63748e4f0307b00f0cb91864d00f58ce54132689 (patch)
treead75a3bc79e895eb140ca5598d65c4e207c9377d /src/main
parent43a1dc799f068daaf5487e92ace90ad65d0560bf (diff)
Carry tree artifacts' self data through aggregating middlemen.
This CL is a followup to c868c47. It is intended to fix #5296. The immediate problem in that issue is that remote caching finds a tree artifact in an input runfiles tree without metadata in the cache. The metadata isn't there because the runfiles artifacts are now all behind a middleman action, and ArtifactFunction didn't propagate tree artifact values through middlemen. This change fixes the problem by adding a tree artifact's self data value to the values carried through to dependent actions. Remote caching with tree artifact inputs seems to have been working mostly by accident. (Evidence: it wasn't tested, and remote execution of actions with tree artifact inputs results a Java traceback before and after c868c47.) This CL is only really a bandaid to return to the old "working" state. If remote execution wants to start supporting tree artifacts properly in the future, we'll likely need to carry the tree artifact child data through middleman actions, too. Closes #5299. Change-Id: I2e07d4fca0f6d2d34d97b7edb27f9d0063776225 PiperOrigin-RevId: 199079382
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java
index 199916674d..bee72a2321 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java
@@ -282,13 +282,15 @@ class ArtifactFunction implements SkyFunction {
Artifact input = ArtifactSkyKey.artifact(entry.getKey());
SkyValue inputValue = entry.getValue();
Preconditions.checkNotNull(inputValue, "%s has null dep %s", artifact, input);
- if (!(inputValue instanceof FileArtifactValue)) {
+ if (inputValue instanceof FileArtifactValue) {
+ inputs.add(Pair.of(input, (FileArtifactValue) inputValue));
+ } else if (inputValue instanceof TreeArtifactValue) {
+ inputs.add(Pair.of(input, ((TreeArtifactValue) inputValue).getSelfData()));
+ } else {
// We do not recurse in aggregating middleman artifacts.
Preconditions.checkState(!(inputValue instanceof AggregatingArtifactValue),
"%s %s %s", artifact, action, inputValue);
- continue;
}
- inputs.add(Pair.of(input, (FileArtifactValue) inputValue));
}
return (action.getActionType() == MiddlemanType.AGGREGATING_MIDDLEMAN)
? new AggregatingArtifactValue(inputs.build(), value)