aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2017-09-22 16:17:07 -0400
committerGravatar John Cater <jcater@google.com>2017-09-25 09:38:44 -0400
commitc6ff86fa17b8372bad1311601ef3db96a74b968e (patch)
tree9837c2aa602affa2e6854a27f31ac905c83e4a69 /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
parentd8ba904a3b0598e97601bc670840e39f21799ead (diff)
Remove BuildInfoFactory precomputed value.
PiperOrigin-RevId: 169728184
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
index dc1ca91ea7..a25c8c2721 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
@@ -236,7 +236,8 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
new AtomicReference<>();
protected final AtomicReference<Map<String, String>> clientEnv = new AtomicReference<>();
- private final ImmutableList<BuildInfoFactory> buildInfoFactories;
+ private final ImmutableMap<BuildInfoKey, BuildInfoFactory> buildInfoFactories;
+
// Under normal circumstances, the artifact factory persists for the life of a Blaze server, but
// since it is not yet created when we create the value builders, we have to use a supplier,
// initialized when the build view is created.
@@ -322,7 +323,11 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
this.resourceManager = ResourceManager.instance();
this.skyframeActionExecutor = new SkyframeActionExecutor(eventBus, statusReporterRef);
this.directories = Preconditions.checkNotNull(directories);
- this.buildInfoFactories = buildInfoFactories;
+ ImmutableMap.Builder<BuildInfoKey, BuildInfoFactory> factoryMapBuilder = ImmutableMap.builder();
+ for (BuildInfoFactory factory : buildInfoFactories) {
+ factoryMapBuilder.put(factory.getKey(), factory);
+ }
+ this.buildInfoFactories = factoryMapBuilder.build();
this.allowedMissingInputs = allowedMissingInputs;
this.extraSkyFunctions = extraSkyFunctions;
this.extraPrecomputedValues = extraPrecomputedValues;
@@ -438,7 +443,8 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
map.put(SkyFunctions.ARTIFACT, new ArtifactFunction(allowedMissingInputs));
map.put(
SkyFunctions.BUILD_INFO_COLLECTION,
- new BuildInfoCollectionFunction(artifactFactory, removeActionsAfterEvaluation));
+ new BuildInfoCollectionFunction(
+ artifactFactory, buildInfoFactories, removeActionsAfterEvaluation));
map.put(SkyFunctions.BUILD_INFO, new WorkspaceStatusFunction(removeActionsAfterEvaluation));
map.put(SkyFunctions.COVERAGE_REPORT, new CoverageReportFunction(removeActionsAfterEvaluation));
ActionExecutionFunction actionExecutionFunction =
@@ -714,7 +720,6 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
protected void maybeInjectPrecomputedValuesForAnalysis() {
if (needToInjectPrecomputedValuesForAnalysis) {
- injectBuildInfoFactories();
injectExtraPrecomputedValues(extraPrecomputedValues);
needToInjectPrecomputedValuesForAnalysis = false;
}
@@ -736,18 +741,8 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
return CacheBuilder.newBuilder().build();
}
- /**
- * Injects the build info factory map that will be used when constructing build info
- * actions/artifacts. Unchanged across the life of the Blaze server, although it must be injected
- * each time the evaluator is created.
- */
- private void injectBuildInfoFactories() {
- ImmutableMap.Builder<BuildInfoKey, BuildInfoFactory> factoryMapBuilder =
- ImmutableMap.builder();
- for (BuildInfoFactory factory : buildInfoFactories) {
- factoryMapBuilder.put(factory.getKey(), factory);
- }
- PrecomputedValue.BUILD_INFO_FACTORIES.set(injectable(), factoryMapBuilder.build());
+ public ImmutableMap<BuildInfoKey, BuildInfoFactory> getBuildInfoFactories() {
+ return buildInfoFactories;
}
private void setShowLoadingProgress(boolean showLoadingProgressValue) {