aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/TargetCompletionValue.java
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2017-08-24 09:23:39 +0200
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-08-24 14:00:09 +0200
commita4634cfb8aa1ee6c6d4f304554ace8fe95782d67 (patch)
tree005568b14351899997a58a486e27720b456fbc24 /src/main/java/com/google/devtools/build/lib/skyframe/TargetCompletionValue.java
parent93fdf030042f1aa9f235e6d7c0cde79f02263c26 (diff)
Automated rollback of commit bb0aba3e91b603bf96d4e214a3886d1f47c3d90a.
*** Reason for rollback *** Publishing duplicate build events for tests. *** Original change description *** Request test artifacts to be built in parallel with running the test. In cases where not all test artifacts are needed to run the test, this allows for greater parallelism in the build. We need to inject the request for the test to be run into the TargetCompletion function, so that it can properly process any errors. Thanks to nharmata@ for suggesting this. MEMORY: One additional Skyframe node and 2 edges for each test to be run (sharded tests still only count as one). So with 500 test target... *** PiperOrigin-RevId: 166307568
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/TargetCompletionValue.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/TargetCompletionValue.java40
1 files changed, 19 insertions, 21 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/TargetCompletionValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/TargetCompletionValue.java
index 6c84563619..476f69da44 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/TargetCompletionValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/TargetCompletionValue.java
@@ -14,15 +14,15 @@
package com.google.devtools.build.lib.skyframe;
import com.google.auto.value.AutoValue;
+import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.analysis.ConfiguredTarget;
import com.google.devtools.build.lib.analysis.LabelAndConfiguration;
import com.google.devtools.build.lib.analysis.TopLevelArtifactContext;
-import com.google.devtools.build.skyframe.SkyFunctionName;
+import com.google.devtools.build.skyframe.LegacySkyKey;
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
import java.util.Collection;
-import javax.annotation.Nullable;
/**
* The value of a TargetCompletion. Currently this just stores a ConfiguredTarget.
@@ -40,38 +40,36 @@ public class TargetCompletionValue implements SkyValue {
public static SkyKey key(
LabelAndConfiguration labelAndConfiguration,
- TopLevelArtifactContext topLevelArtifactContext,
- SkyKey testExecutionSkyKey) {
- return TargetCompletionKey.create(
- labelAndConfiguration, topLevelArtifactContext, testExecutionSkyKey);
+ TopLevelArtifactContext topLevelArtifactContext) {
+ return LegacySkyKey.create(
+ SkyFunctions.TARGET_COMPLETION,
+ TargetCompletionKey.create(labelAndConfiguration, topLevelArtifactContext));
}
public static Iterable<SkyKey> keys(Collection<ConfiguredTarget> targets,
final TopLevelArtifactContext ctx) {
return Iterables.transform(
- targets, ct -> TargetCompletionKey.create(LabelAndConfiguration.of(ct), ctx, null));
+ targets,
+ new Function<ConfiguredTarget, SkyKey>() {
+ @Override
+ public SkyKey apply(ConfiguredTarget ct) {
+ return LegacySkyKey.create(
+ SkyFunctions.TARGET_COMPLETION,
+ TargetCompletionKey.create(LabelAndConfiguration.of(ct), ctx));
+ }
+ });
}
@AutoValue
- abstract static class TargetCompletionKey implements SkyKey {
+ abstract static class TargetCompletionKey {
public static TargetCompletionKey create(
LabelAndConfiguration labelAndConfiguration,
- TopLevelArtifactContext topLevelArtifactContext,
- @Nullable SkyKey testExecutionSkyKey) {
+ TopLevelArtifactContext topLevelArtifactContext) {
return new AutoValue_TargetCompletionValue_TargetCompletionKey(
- labelAndConfiguration, topLevelArtifactContext, testExecutionSkyKey);
+ labelAndConfiguration, topLevelArtifactContext);
}
- abstract LabelAndConfiguration labelAndConfiguration();
-
+ public abstract LabelAndConfiguration labelAndConfiguration();
public abstract TopLevelArtifactContext topLevelArtifactContext();
-
- @Nullable
- abstract SkyKey testExecutionSkyKey();
-
- @Override
- public SkyFunctionName functionName() {
- return SkyFunctions.TARGET_COMPLETION;
- }
}
}