StandaloneTestStrategy sets the full list of outputs on the test spawn
All spawn strategies already treat all normal outputs as optional. Bazel checks
at the action level whether all action outputs are created, but does not check
at the spawn level. Spawn.getOptionalOutputs is therefore unnecessary, and
removed in this change.
The only place where this was set was in StandaloneTestStrategy, which now
specifies the full set of outputs, which is now computed by TestRunnerAction.
The internal test strategy implementations are also updated in this change.
While I'm at it, also remove the use of BaseSpawn and use SimpleSpawn instead.
This may go some way towards fixing #1413 and #942.
--
PiperOrigin-RevId: 149397100
MOS_MIGRATED_REVID=149397100
diff --git a/src/main/java/com/google/devtools/build/lib/actions/BaseSpawn.java b/src/main/java/com/google/devtools/build/lib/actions/BaseSpawn.java
index e3143fd..901b225 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/BaseSpawn.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/BaseSpawn.java
@@ -16,7 +16,6 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.vfs.PathFragment;
import java.util.Collection;
@@ -31,7 +30,6 @@
private final ImmutableList<String> arguments;
private final ImmutableMap<String, String> environment;
private final ImmutableMap<String, String> executionInfo;
- private final ImmutableSet<PathFragment> optionalOutputFiles;
private final RunfilesSupplier runfilesSupplier;
private final ActionExecutionMetadata action;
private final ResourceSet localResources;
@@ -42,39 +40,15 @@
Map<String, String> executionInfo,
RunfilesSupplier runfilesSupplier,
ActionExecutionMetadata action,
- ResourceSet localResources,
- Collection<PathFragment> optionalOutputFiles) {
+ ResourceSet localResources) {
this.arguments = ImmutableList.copyOf(arguments);
this.environment = ImmutableMap.copyOf(environment);
this.executionInfo = ImmutableMap.copyOf(executionInfo);
this.runfilesSupplier = runfilesSupplier;
this.action = action;
this.localResources = localResources;
- this.optionalOutputFiles = ImmutableSet.copyOf(optionalOutputFiles);
}
- /**
- * Returns a new Spawn. The caller must not modify the parameters after the call; neither will
- * this method.
- */
- public BaseSpawn(
- List<String> arguments,
- Map<String, String> environment,
- Map<String, String> executionInfo,
- RunfilesSupplier runfilesSupplier,
- ActionExecutionMetadata action,
- ResourceSet localResources) {
- this(
- arguments,
- environment,
- executionInfo,
- runfilesSupplier,
- action,
- localResources,
- ImmutableSet.<PathFragment>of());
- }
-
- /** Returns a new Spawn. */
public BaseSpawn(
List<String> arguments,
Map<String, String> environment,
@@ -170,11 +144,6 @@
}
@Override
- public Collection<PathFragment> getOptionalOutputFiles() {
- return optionalOutputFiles;
- }
-
- @Override
public ActionExecutionMetadata getResourceOwner() {
return action;
}