aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build
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/test/java/com/google/devtools/build
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/test/java/com/google/devtools/build')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTest.java13
1 files changed, 10 insertions, 3 deletions
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 96fd9fc9eb..4615783887 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
@@ -139,18 +139,25 @@ public class ArtifactFunctionTest extends ArtifactFunctionTestCase {
Artifact output = createMiddlemanArtifact("output");
Artifact input1 = createSourceArtifact("input1");
Artifact input2 = createDerivedArtifact("input2");
+ SpecialArtifact tree = createDerivedTreeArtifactWithAction("treeArtifact");
+ file(createFakeTreeFileArtifact(tree, "child1", "hello1").getPath(), "src1");
+ file(createFakeTreeFileArtifact(tree, "child2", "hello2").getPath(), "src2");
Action action =
new DummyAction(
- ImmutableList.of(input1, input2), output, MiddlemanType.AGGREGATING_MIDDLEMAN);
+ ImmutableList.of(input1, input2, tree), output, MiddlemanType.AGGREGATING_MIDDLEMAN);
actions.add(action);
file(input2.getPath(), "contents");
file(input1.getPath(), "source contents");
evaluate(
Iterables.toArray(
- ArtifactSkyKey.mandatoryKeys(ImmutableSet.of(input2, input1, input2)), SkyKey.class));
+ ArtifactSkyKey.mandatoryKeys(ImmutableSet.of(input2, input1, input2, tree)),
+ SkyKey.class));
SkyValue value = evaluateArtifactValue(output);
assertThat(((AggregatingArtifactValue) value).getInputs())
- .containsExactly(Pair.of(input1, create(input1)), Pair.of(input2, create(input2)));
+ .containsExactly(
+ Pair.of(input1, create(input1)),
+ Pair.of(input2, create(input2)),
+ Pair.of(tree, ((TreeArtifactValue) evaluateArtifactValue(tree)).getSelfData()));
}
/**