Change Spawn.get{Tool,Input}Files to NestedSet
I think this should basically be a no-op. In a few places, it delays
flattening of the nested set, and could potentially reduce peak memory
use / reduce the time we're holding onto a flattened copy of the inputs.
PiperOrigin-RevId: 288673175
diff --git a/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java b/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
index c266278..e0cf8d0 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
@@ -17,12 +17,12 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.io.ByteStreams;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
import com.google.devtools.build.lib.actions.ActionInputHelper;
-import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.ArtifactPathResolver;
import com.google.devtools.build.lib.actions.EnvironmentalExecException;
import com.google.devtools.build.lib.actions.ExecException;
@@ -43,6 +43,8 @@
import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos;
import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.TestResult.ExecutionInfo;
import com.google.devtools.build.lib.buildeventstream.TestFileNameConstants;
+import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
+import com.google.devtools.build.lib.collect.nestedset.Order;
import com.google.devtools.build.lib.events.Reporter;
import com.google.devtools.build.lib.util.OS;
import com.google.devtools.build.lib.util.Pair;
@@ -132,9 +134,9 @@
ImmutableMap.copyOf(executionInfo),
action.getRunfilesSupplier(),
ImmutableMap.of(),
- /*inputs=*/ action.getInputs().toList(),
- /*tools=*/ ImmutableList.<Artifact>of(),
- ImmutableList.copyOf(action.getSpawnOutputs()),
+ /*inputs=*/ action.getInputs(),
+ /*tools=*/ NestedSetBuilder.emptySet(Order.STABLE_ORDER),
+ ImmutableSet.copyOf(action.getSpawnOutputs()),
localResourceUsage);
return new StandaloneTestRunnerSpawn(
action, actionExecutionContext, spawn, tmpDir, workingDirectory, execRoot);
@@ -398,9 +400,10 @@
ImmutableMap.copyOf(action.getExecutionInfo()),
null,
ImmutableMap.of(),
- /*inputs=*/ ImmutableList.of(action.getTestXmlGeneratorScript(), action.getTestLog()),
- /*tools=*/ ImmutableList.<Artifact>of(),
- /*outputs=*/ ImmutableList.of(ActionInputHelper.fromPath(action.getXmlOutputPath())),
+ /*inputs=*/ NestedSetBuilder.create(
+ Order.STABLE_ORDER, action.getTestXmlGeneratorScript(), action.getTestLog()),
+ /*tools=*/ NestedSetBuilder.emptySet(Order.STABLE_ORDER),
+ /*outputs=*/ ImmutableSet.of(ActionInputHelper.fromPath(action.getXmlOutputPath())),
SpawnAction.DEFAULT_RESOURCE_SET);
}