Update SpawnIncludeScanner to use SpawnStrategyResolver.
Part of the roll-forward of
@@ -41,11 +41,11 @@ import com.google.devtools.build.lib.actions.SimpleSpawn;
import com.google.devtools.build.lib.actions.Spawn;
import com.google.devtools.build.lib.actions.SpawnContinuation;
import com.google.devtools.build.lib.actions.SpawnResult;
-import com.google.devtools.build.lib.actions.SpawnStrategy;
import com.google.devtools.build.lib.analysis.platform.PlatformInfo;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.Order;
+import com.google.devtools.build.lib.exec.SpawnStrategyResolver;
import com.google.devtools.build.lib.includescanning.IncludeParser.GrepIncludesFileType;
import com.google.devtools.build.lib.includescanning.IncludeParser.Inclusion;
import com.google.devtools.build.lib.util.io.FileOutErr;
@@ -375,11 +375,12 @@ public class SpawnIncludeScanner {
// Don't share the originalOutErr across spawnGrep calls. Doing so would not be thread-safe.
FileOutErr originalOutErr = actionExecutionContext.getFileOutErr();
FileOutErr grepOutErr = originalOutErr.childOutErr();
- SpawnStrategy strategy = actionExecutionContext.getContext(SpawnStrategy.class);
+ SpawnStrategyResolver spawnStrategyResolver =
+ actionExecutionContext.getContext(SpawnStrategyResolver.class);
ActionExecutionContext spawnContext = actionExecutionContext.withFileOutErr(grepOutErr);
List<SpawnResult> results;
try {
- results = strategy.exec(spawn, spawnContext);
+ results = spawnStrategyResolver.exec(spawn, spawnContext);
dump(spawnContext, actionExecutionContext);
} catch (ExecException e) {
dump(spawnContext, actionExecutionContext);
@@ -501,7 +502,7 @@ public class SpawnIncludeScanner {
SpawnContinuation spawnContinuation;
try {
spawnContinuation =
- grepContext.getContext(SpawnStrategy.class).beginExecution(spawn, grepContext);
+ grepContext.getContext(SpawnStrategyResolver.class).beginExecution(spawn, grepContext);
} catch (InterruptedException e) {
dump(grepContext, actionExecutionContext);
return Futures.immediateCancelledFuture();
