Add a LostInputCheck so failed rewindable executions can avoid side effects
It delegates to checking an action filesystem for lost inputs, if such a
filesystem is in use. The check is available in ActionExecutionContext
and SpawnExecutionContext.
Also, this changes the return type of getDepOwners from Collection to
ImmutableSet to more clearly embody its properties: it's unordered and
should have no duplicates.
Action execution involves two failure exception base types, ExecException
and ActionExecutionException. Like before, there remain two "lost inputs"
exception variants, one for each. There was, and is, a way from
converting in one direction, and now there is a way of safely converting
in both directions. {Exec,ActionExecution}Exception probably instead
should be collapsed to one type, but that's a much bigger refactoring
that this avoids.
RELNOTES: None.
PiperOrigin-RevId: 287190381
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java
index 986b741..3e4e42c 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java
@@ -58,6 +58,7 @@
private final ActionInputPrefetcher actionInputPrefetcher;
private final ActionKeyContext actionKeyContext;
private final MetadataHandler metadataHandler;
+ private final LostInputsCheck lostInputsCheck;
private final FileOutErr fileOutErr;
private final ExtendedEventHandler eventHandler;
private final ImmutableMap<String, String> clientEnv;
@@ -78,6 +79,7 @@
ActionInputPrefetcher actionInputPrefetcher,
ActionKeyContext actionKeyContext,
MetadataHandler metadataHandler,
+ LostInputsCheck lostInputsCheck,
FileOutErr fileOutErr,
ExtendedEventHandler eventHandler,
Map<String, String> clientEnv,
@@ -90,6 +92,7 @@
this.actionInputPrefetcher = actionInputPrefetcher;
this.actionKeyContext = actionKeyContext;
this.metadataHandler = metadataHandler;
+ this.lostInputsCheck = lostInputsCheck;
this.fileOutErr = fileOutErr;
this.eventHandler = eventHandler;
this.clientEnv = ImmutableMap.copyOf(clientEnv);
@@ -110,6 +113,7 @@
ActionInputPrefetcher actionInputPrefetcher,
ActionKeyContext actionKeyContext,
MetadataHandler metadataHandler,
+ LostInputsCheck lostInputsCheck,
FileOutErr fileOutErr,
ExtendedEventHandler eventHandler,
Map<String, String> clientEnv,
@@ -123,6 +127,7 @@
actionInputPrefetcher,
actionKeyContext,
metadataHandler,
+ lostInputsCheck,
fileOutErr,
eventHandler,
clientEnv,
@@ -139,6 +144,7 @@
ActionInputPrefetcher actionInputPrefetcher,
ActionKeyContext actionKeyContext,
MetadataHandler metadataHandler,
+ LostInputsCheck lostInputsCheck,
FileOutErr fileOutErr,
ExtendedEventHandler eventHandler,
Map<String, String> clientEnv,
@@ -150,6 +156,7 @@
actionInputPrefetcher,
actionKeyContext,
metadataHandler,
+ lostInputsCheck,
fileOutErr,
eventHandler,
clientEnv,
@@ -190,6 +197,10 @@
return actionFileSystem;
}
+ public void checkForLostInputs() throws LostInputsActionExecutionException {
+ lostInputsCheck.checkForLostInputs();
+ }
+
/**
* Returns the path for an ActionInput.
*
@@ -336,6 +347,7 @@
actionInputPrefetcher,
actionKeyContext,
metadataHandler,
+ lostInputsCheck,
fileOutErr,
eventHandler,
clientEnv,
@@ -345,4 +357,16 @@
actionFileSystem,
skyframeDepsResult);
}
+
+ /**
+ * A way of checking whether any lost inputs have been detected during the execution of this
+ * action.
+ */
+ public interface LostInputsCheck {
+
+ LostInputsCheck NONE = () -> {};
+
+ /** Throws if inputs have been lost. */
+ void checkForLostInputs() throws LostInputsActionExecutionException;
+ }
}
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionInputDepOwnerMap.java b/src/main/java/com/google/devtools/build/lib/actions/ActionInputDepOwnerMap.java
index 3d9ae5c..66a4e86 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionInputDepOwnerMap.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionInputDepOwnerMap.java
@@ -44,7 +44,7 @@
}
@Override
- public Collection<Artifact> getDepOwners(ActionInput input) {
- return depOwnersByInputs.get(input);
+ public ImmutableSet<Artifact> getDepOwners(ActionInput input) {
+ return ImmutableSet.copyOf(depOwnersByInputs.get(input));
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionInputDepOwners.java b/src/main/java/com/google/devtools/build/lib/actions/ActionInputDepOwners.java
index 0cdcd00..ebc6ebe 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionInputDepOwners.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionInputDepOwners.java
@@ -13,7 +13,7 @@
// limitations under the License.
package com.google.devtools.build.lib.actions;
-import java.util.Collection;
+import com.google.common.collect.ImmutableSet;
/**
* Association between {@link ActionInput}s and the {@link Artifact}s, directly or indirectly
@@ -25,8 +25,8 @@
public interface ActionInputDepOwners {
/**
- * Returns the collection of {@link Artifact}s associated with {@code input}. The collection is
- * empty if no such association exists.
+ * Returns the set of {@link Artifact}s associated with {@code input}. The collection is empty if
+ * no such association exists.
*/
- Collection<Artifact> getDepOwners(ActionInput input);
+ ImmutableSet<Artifact> getDepOwners(ActionInput input);
}
diff --git a/src/main/java/com/google/devtools/build/lib/actions/LostInputsActionExecutionException.java b/src/main/java/com/google/devtools/build/lib/actions/LostInputsActionExecutionException.java
index bf22401..0584c47 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/LostInputsActionExecutionException.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/LostInputsActionExecutionException.java
@@ -14,9 +14,11 @@
package com.google.devtools.build.lib.actions;
+import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.util.io.FileOutErr;
import com.google.devtools.build.lib.vfs.Path;
+import javax.annotation.Nullable;
/**
* An {@link ActionExecutionException} thrown when an action fails to execute because one or more of
@@ -40,13 +42,13 @@
private boolean actionStartedEventAlreadyEmitted;
/** Used to report the action execution failure if rewinding also fails. */
- private Path primaryOutputPath;
+ @Nullable private Path primaryOutputPath;
/**
* Used to report the action execution failure if rewinding also fails. Note that this will be
* closed, so it may only be used for reporting.
*/
- private FileOutErr fileOutErr;
+ @Nullable private FileOutErr fileOutErr;
/** Used to inform rewinding that lost inputs were found during input discovery. */
private boolean fromInputDiscovery;
@@ -101,4 +103,20 @@
public void setFromInputDiscovery() {
this.fromInputDiscovery = true;
}
+
+ /**
+ * Converts to the "lost inputs" subtype of the other exception type ({@link ExecException}) used
+ * during action execution.
+ *
+ * <p>May not be used if this exception has been decorated with additional information from its
+ * context (e.g. from {@link #setPrimaryOutputPath} or other setters) because that information
+ * would be lost if so.
+ */
+ public LostInputsExecException toExecException() {
+ Preconditions.checkState(!actionStartedEventAlreadyEmitted);
+ Preconditions.checkState(primaryOutputPath == null);
+ Preconditions.checkState(fileOutErr == null);
+ Preconditions.checkState(!fromInputDiscovery);
+ return new LostInputsExecException(lostInputs, owners, this);
+ }
}
diff --git a/src/main/java/com/google/devtools/build/lib/actions/LostInputsExecException.java b/src/main/java/com/google/devtools/build/lib/actions/LostInputsExecException.java
index 71f861e..091a8f6 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/LostInputsExecException.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/LostInputsExecException.java
@@ -17,6 +17,9 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import java.util.HashMap;
+import java.util.Map;
/**
* An {@link ExecException} thrown when an action fails to execute because one or more of its inputs
@@ -31,11 +34,22 @@
public LostInputsExecException(
ImmutableMap<String, ActionInput> lostInputs, ActionInputDepOwners owners) {
- super("lost inputs with digests: " + Joiner.on(",").join(lostInputs.keySet()));
+ super(getMessage(lostInputs));
this.lostInputs = lostInputs;
this.owners = owners;
}
+ public LostInputsExecException(
+ ImmutableMap<String, ActionInput> lostInputs, ActionInputDepOwners owners, Throwable cause) {
+ super(getMessage(lostInputs), cause);
+ this.lostInputs = lostInputs;
+ this.owners = owners;
+ }
+
+ private static String getMessage(ImmutableMap<String, ActionInput> lostInputs) {
+ return "lost inputs with digests: " + Joiner.on(",").join(lostInputs.keySet());
+ }
+
@VisibleForTesting
public ImmutableMap<String, ActionInput> getLostInputs() {
return lostInputs;
@@ -53,4 +67,40 @@
return new LostInputsActionExecutionException(
message + ": " + getMessage(), lostInputs, owners, action, /*cause=*/ this);
}
+
+ public void combineAndThrow(LostInputsExecException other) throws LostInputsExecException {
+ // This uses a HashMap when merging the two lostInputs maps because key collisions are expected.
+ // In contrast, ImmutableMap.Builder treats collisions as errors. Collisions will happen when
+ // the two sources of the original exceptions shared knowledge of what was lost. For example,
+ // a SpawnRunner may discover a lost input and look it up in an action filesystem in which it's
+ // also lost. The SpawnRunner and the filesystem may then each throw a LostInputsExecException
+ // with the same information.
+ Map<String, ActionInput> map = new HashMap<>();
+ map.putAll(lostInputs);
+ map.putAll(other.lostInputs);
+ LostInputsExecException combined =
+ new LostInputsExecException(
+ ImmutableMap.copyOf(map), new MergedActionInputDepOwners(owners, other.owners), this);
+ combined.addSuppressed(other);
+ throw combined;
+ }
+
+ private static class MergedActionInputDepOwners implements ActionInputDepOwners {
+
+ private final ActionInputDepOwners left;
+ private final ActionInputDepOwners right;
+
+ MergedActionInputDepOwners(ActionInputDepOwners left, ActionInputDepOwners right) {
+ this.left = left;
+ this.right = right;
+ }
+
+ @Override
+ public ImmutableSet<Artifact> getDepOwners(ActionInput input) {
+ return ImmutableSet.<Artifact>builder()
+ .addAll(left.getDepOwners(input))
+ .addAll(right.getDepOwners(input))
+ .build();
+ }
+ }
}
diff --git a/src/main/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategy.java b/src/main/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategy.java
index c12b6df..331db97 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategy.java
@@ -24,6 +24,8 @@
import com.google.devtools.build.lib.actions.ArtifactPathResolver;
import com.google.devtools.build.lib.actions.EnvironmentalExecException;
import com.google.devtools.build.lib.actions.ExecException;
+import com.google.devtools.build.lib.actions.LostInputsActionExecutionException;
+import com.google.devtools.build.lib.actions.LostInputsExecException;
import com.google.devtools.build.lib.actions.MetadataProvider;
import com.google.devtools.build.lib.actions.RunningActionEvent;
import com.google.devtools.build.lib.actions.SandboxedSpawnActionContext;
@@ -180,7 +182,7 @@
// TODO(ulfjack): Guard against client modification of this map.
private SortedMap<PathFragment, ActionInput> lazyInputMapping;
- public SpawnExecutionContextImpl(
+ SpawnExecutionContextImpl(
Spawn spawn,
ActionExecutionContext actionExecutionContext,
@Nullable StopConcurrentSpawns stopConcurrentSpawns,
@@ -292,5 +294,14 @@
break;
}
}
+
+ @Override
+ public void checkForLostInputs() throws LostInputsExecException {
+ try {
+ actionExecutionContext.checkForLostInputs();
+ } catch (LostInputsActionExecutionException e) {
+ throw e.toExecException();
+ }
+ }
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/exec/SpawnRunner.java b/src/main/java/com/google/devtools/build/lib/exec/SpawnRunner.java
index 7b52819..be50db9 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/SpawnRunner.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/SpawnRunner.java
@@ -18,6 +18,7 @@
import com.google.devtools.build.lib.actions.ArtifactPathResolver;
import com.google.devtools.build.lib.actions.ExecException;
import com.google.devtools.build.lib.actions.FutureSpawn;
+import com.google.devtools.build.lib.actions.LostInputsExecException;
import com.google.devtools.build.lib.actions.MetadataProvider;
import com.google.devtools.build.lib.actions.Spawn;
import com.google.devtools.build.lib.actions.SpawnResult;
@@ -100,7 +101,7 @@
* <p>{@link SpawnRunner} implementations should post a progress status before any potentially
* long-running operation.
*/
- public enum ProgressStatus {
+ enum ProgressStatus {
/** Spawn is waiting for local or remote resources to become available. */
SCHEDULING,
@@ -118,7 +119,7 @@
EXECUTING,
/** Downloading outputs from a remote machine. */
- DOWNLOADING;
+ DOWNLOADING
}
/**
@@ -206,6 +207,9 @@
* outputs that are stored remotely.
*/
MetadataInjector getMetadataInjector();
+
+ /** Throws if lost inputs have been detected. */
+ void checkForLostInputs() throws LostInputsExecException;
}
/**
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
index b949b5c..0614697 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
@@ -886,6 +886,7 @@
ActionExecutionContext actionExecutionContext =
skyframeActionExecutor.getContext(
+ action,
metadataHandler,
metadataHandler,
skyframeActionExecutor.probeCompletedAndReset(action)
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
index 0f6af07..79da171 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
@@ -35,6 +35,7 @@
import com.google.devtools.build.lib.actions.ActionExecutedEvent;
import com.google.devtools.build.lib.actions.ActionExecutedEvent.ErrorTiming;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionExecutionException;
import com.google.devtools.build.lib.actions.ActionExecutionStatusReporter;
import com.google.devtools.build.lib.actions.ActionGraph;
@@ -626,6 +627,7 @@
* tasks related to that action.
*/
public ActionExecutionContext getContext(
+ Action action,
MetadataProvider metadataProvider,
MetadataHandler metadataHandler,
ProgressEventBehavior progressEventBehavior,
@@ -642,6 +644,7 @@
actionInputPrefetcher,
actionKeyContext,
metadataHandler,
+ lostInputsCheck(actionFileSystem, action, outputService),
fileOutErr,
selectEventHandler(progressEventBehavior),
clientEnv,
@@ -785,6 +788,7 @@
actionInputPrefetcher,
actionKeyContext,
metadataHandler,
+ lostInputsCheck(actionFileSystem, action, outputService),
actionLogBufferPathGenerator.generate(
ArtifactPathResolver.createPathResolver(
actionFileSystem, executorEngine.getExecRoot())),
@@ -804,7 +808,8 @@
// Input discovery may have been affected by lost inputs. If an action filesystem is used, it
// may know whether inputs were lost. We should fail fast if any were; rewinding may be able
// to fix it.
- checkActionFileSystemForLostInputs(actionExecutionContext, action, outputService);
+ checkActionFileSystemForLostInputs(
+ actionExecutionContext.getActionFileSystem(), action, outputService);
return artifacts;
} catch (ActionExecutionException e) {
@@ -814,7 +819,8 @@
// complete without error.
if (!(e instanceof LostInputsActionExecutionException)) {
try {
- checkActionFileSystemForLostInputs(actionExecutionContext, action, outputService);
+ checkActionFileSystemForLostInputs(
+ actionExecutionContext.getActionFileSystem(), action, outputService);
} catch (LostInputsActionExecutionException lostInputsException) {
e = lostInputsException;
}
@@ -1063,7 +1069,8 @@
// An action's result (or intermediate state) may have been affected by lost inputs. If an
// action filesystem is used, it may know whether inputs were lost. We should fail fast if
// any were; rewinding may be able to fix it.
- checkActionFileSystemForLostInputs(actionExecutionContext, action, outputService);
+ checkActionFileSystemForLostInputs(
+ actionExecutionContext.getActionFileSystem(), action, outputService);
} catch (ActionExecutionException e) {
// Action failures may be caused by lost inputs. Lost input failures have higher priority
@@ -1071,7 +1078,8 @@
// without error.
if (!(e instanceof LostInputsActionExecutionException)) {
try {
- checkActionFileSystemForLostInputs(actionExecutionContext, action, outputService);
+ checkActionFileSystemForLostInputs(
+ actionExecutionContext.getActionFileSystem(), action, outputService);
} catch (LostInputsActionExecutionException lostInputsException) {
e = lostInputsException;
}
@@ -1509,14 +1517,20 @@
* if any were.
*/
private static void checkActionFileSystemForLostInputs(
- ActionExecutionContext context, Action action, OutputService outputService)
+ @Nullable FileSystem actionFileSystem, Action action, OutputService outputService)
throws LostInputsActionExecutionException {
- FileSystem actionFileSystem = context.getActionFileSystem();
if (actionFileSystem != null) {
outputService.checkActionFileSystemForLostInputs(actionFileSystem, action);
}
}
+ private static LostInputsCheck lostInputsCheck(
+ @Nullable FileSystem actionFileSystem, Action action, OutputService outputService) {
+ return actionFileSystem == null
+ ? LostInputsCheck.NONE
+ : () -> outputService.checkActionFileSystemForLostInputs(actionFileSystem, action);
+ }
+
/**
* Validates that all action outputs were created or intentionally omitted. This can result in
* chmod calls on the output files; see {@link ActionMetadataHandler}.
diff --git a/src/test/java/com/google/devtools/build/lib/actions/ExecutableSymlinkActionTest.java b/src/test/java/com/google/devtools/build/lib/actions/ExecutableSymlinkActionTest.java
index 1ae3dcb..6853c72 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/ExecutableSymlinkActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/ExecutableSymlinkActionTest.java
@@ -19,6 +19,7 @@
import static com.google.devtools.build.lib.testutil.MoreAsserts.assertThrows;
import com.google.common.collect.ImmutableMap;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.util.ActionsTestUtil;
import com.google.devtools.build.lib.actions.util.DummyExecutor;
import com.google.devtools.build.lib.analysis.actions.SymlinkAction;
@@ -62,14 +63,15 @@
new SingleBuildFileCache(execRoot.getPathString(), execRoot.getFileSystem()),
ActionInputPrefetcher.NONE,
actionKeyContext,
- null,
+ /*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
outErr,
/*eventHandler=*/ null,
- ImmutableMap.<String, String>of(),
- ImmutableMap.of(),
- null,
- null,
- null);
+ /*clientEnv=*/ ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
+ /*artifactExpander=*/ null,
+ /*actionFileSystem=*/ null,
+ /*skyframeDepsResult=*/ null);
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java b/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java
index 5ba5c96..f209e37 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java
@@ -31,6 +31,7 @@
import com.google.devtools.build.lib.actions.Action;
import com.google.devtools.build.lib.actions.ActionAnalysisMetadata;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionGraph;
import com.google.devtools.build.lib.actions.ActionInput;
import com.google.devtools.build.lib.actions.ActionInputHelper;
@@ -154,10 +155,11 @@
ActionInputPrefetcher.NONE,
actionKeyContext,
metadataHandler,
+ LostInputsCheck.NONE,
fileOutErr,
eventHandler,
ImmutableMap.copyOf(clientEnv),
- ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
actionGraph == null
? createDummyArtifactExpander()
: ActionInputHelper.actionGraphArtifactExpander(actionGraph),
@@ -169,14 +171,15 @@
DummyExecutor dummyExecutor = new DummyExecutor();
return new ActionExecutionContext(
dummyExecutor,
- null,
+ /*actionInputFileCache=*/ null,
ActionInputPrefetcher.NONE,
new ActionKeyContext(),
- null,
- null,
+ /*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
+ /*fileOutErr=*/ null,
eventHandler,
- ImmutableMap.of(),
- ImmutableMap.of(),
+ /*clientEnv=*/ ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
createDummyArtifactExpander(),
/*actionFileSystem=*/ null,
/*skyframeDepsResult=*/ null);
@@ -196,6 +199,7 @@
ActionInputPrefetcher.NONE,
actionKeyContext,
metadataHandler,
+ LostInputsCheck.NONE,
fileOutErr,
eventHandler,
ImmutableMap.of(),
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTestCase.java
index e7b0992..5af3cc0 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTestCase.java
@@ -21,6 +21,7 @@
import com.google.common.collect.Sets;
import com.google.devtools.build.lib.actions.Action;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionInputPrefetcher;
import com.google.devtools.build.lib.actions.ActionOwner;
import com.google.devtools.build.lib.actions.ActionResult;
@@ -64,17 +65,18 @@
context =
new ActionExecutionContext(
executor,
- null,
+ /*actionInputFileCache=*/ null,
ActionInputPrefetcher.NONE,
actionKeyContext,
- null,
+ /*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
new FileOutErr(),
new StoredEventHandler(),
- ImmutableMap.<String, String>of(),
- ImmutableMap.of(),
- null,
- null,
- null);
+ /*clientEnv=*/ ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
+ /*artifactExpander=*/ null,
+ /*actionFileSystem=*/ null,
+ /*skyframeDepsResult=*/ null);
}
protected void checkNoInputsByDefault() {
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/actions/ParamFileWriteActionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/actions/ParamFileWriteActionTest.java
index b5b0186..aa9047b 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/actions/ParamFileWriteActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/actions/ParamFileWriteActionTest.java
@@ -19,6 +19,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.actions.Action;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionInputHelper;
import com.google.devtools.build.lib.actions.ActionInputPrefetcher;
import com.google.devtools.build.lib.actions.ActionResult;
@@ -203,14 +204,15 @@
Executor executor = new TestExecutorBuilder(fileSystem, directories, binTools).build();
return new ActionExecutionContext(
executor,
- null,
+ /*actionInputFileCache=*/ null,
ActionInputPrefetcher.NONE,
actionKeyContext,
- null,
+ /*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
new FileOutErr(),
new StoredEventHandler(),
- ImmutableMap.<String, String>of(),
- ImmutableMap.of(),
+ /*clientEnv=*/ ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
artifactExpander,
/*actionFileSystem=*/ null,
/*skyframeDepsResult=*/ null);
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/actions/SymlinkActionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/actions/SymlinkActionTest.java
index cd81206..f826c30 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/actions/SymlinkActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/actions/SymlinkActionTest.java
@@ -18,6 +18,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionInputPrefetcher;
import com.google.devtools.build.lib.actions.ActionResult;
import com.google.devtools.build.lib.actions.Artifact;
@@ -84,15 +85,16 @@
action.execute(
new ActionExecutionContext(
executor,
- null,
+ /*actionInputFileCache=*/ null,
ActionInputPrefetcher.NONE,
actionKeyContext,
- null,
- null,
+ /*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
+ /*fileOutErr=*/ null,
new StoredEventHandler(),
- ImmutableMap.<String, String>of(),
- ImmutableMap.of(),
- null,
+ /*clientEnv=*/ ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
+ /*artifactExpander=*/ null,
/*actionFileSystem=*/ null,
/*skyframeDepsResult=*/ null));
assertThat(actionResult.spawnResults()).isEmpty();
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionActionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionActionTest.java
index 58bd02c..2e8e50e 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionActionTest.java
@@ -21,6 +21,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionInputPrefetcher;
import com.google.devtools.build.lib.actions.ActionKeyContext;
import com.google.devtools.build.lib.actions.Artifact;
@@ -190,15 +191,16 @@
private ActionExecutionContext createContext(Executor executor) {
return new ActionExecutionContext(
executor,
- null,
+ /*actionInputFileCache=*/ null,
ActionInputPrefetcher.NONE,
actionKeyContext,
- null,
+ /*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
new FileOutErr(),
new StoredEventHandler(),
- ImmutableMap.of(),
- ImmutableMap.of(),
- null,
+ /*clientEnv=*/ ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
+ /*artifactExpander=*/ null,
/*actionFileSystem=*/ null,
/*skyframeDepsResult=*/ null);
}
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
index 6ded04e..f392669 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
@@ -34,6 +34,7 @@
import com.google.devtools.build.lib.actions.Action;
import com.google.devtools.build.lib.actions.ActionAnalysisMetadata;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionGraph;
import com.google.devtools.build.lib.actions.ActionInput;
import com.google.devtools.build.lib.actions.ActionKeyContext;
@@ -2241,10 +2242,11 @@
/*actionInputPrefetcher=*/ null,
actionKeyContext,
/*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
actionLogBufferPathGenerator.generate(ArtifactPathResolver.IDENTITY),
reporter,
clientEnv,
- ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
artifactExpander,
/*actionFileSystem=*/ null,
/*skyframeDepsResult*/ null);
diff --git a/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java b/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java
index f866227..7c05c80 100644
--- a/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java
+++ b/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java
@@ -95,18 +95,19 @@
public FakeActionExecutionContext(
FileOutErr fileOutErr, SpawnActionContext spawnActionContext) {
super(
- /* executor= */ null,
- /* actionInputFileCache= */ null,
+ /*executor=*/ null,
+ /*actionInputFileCache=*/ null,
ActionInputPrefetcher.NONE,
new ActionKeyContext(),
- /* metadataHandler= */ null,
+ /*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
fileOutErr,
/*eventHandler=*/ null,
- /* clientEnv= */ ImmutableMap.of(),
- /* topLevelFilesets= */ ImmutableMap.of(),
- /* artifactExpander= */ null,
- /* actionFileSystem= */ null,
- /* skyframeDepsResult= */ null);
+ /*clientEnv=*/ ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
+ /*artifactExpander=*/ null,
+ /*actionFileSystem=*/ null,
+ /*skyframeDepsResult=*/ null);
this.spawnActionContext = spawnActionContext;
}
diff --git a/src/test/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunnerTest.java b/src/test/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunnerTest.java
index d4daedf..1033ab8 100644
--- a/src/test/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunnerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunnerTest.java
@@ -276,6 +276,9 @@
public MetadataInjector getMetadataInjector() {
throw new UnsupportedOperationException();
}
+
+ @Override
+ public void checkForLostInputs() {}
}
private final MetadataProvider mockFileCache = mock(MetadataProvider.class);
diff --git a/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java b/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java
index 733ac65..5c93a05 100644
--- a/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java
+++ b/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnCacheTest.java
@@ -204,6 +204,9 @@
}
};
}
+
+ @Override
+ public void checkForLostInputs() {}
};
private static SimpleSpawn simpleSpawnWithExecutionInfo(
diff --git a/src/test/java/com/google/devtools/build/lib/remote/util/FakeSpawnExecutionContext.java b/src/test/java/com/google/devtools/build/lib/remote/util/FakeSpawnExecutionContext.java
index 82e43ab..aa6ed7b 100644
--- a/src/test/java/com/google/devtools/build/lib/remote/util/FakeSpawnExecutionContext.java
+++ b/src/test/java/com/google/devtools/build/lib/remote/util/FakeSpawnExecutionContext.java
@@ -144,4 +144,7 @@
}
};
}
+
+ @Override
+ public void checkForLostInputs() {}
}
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CreateIncSymlinkActionTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CreateIncSymlinkActionTest.java
index 5cde05f..98d2f4e 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CreateIncSymlinkActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CreateIncSymlinkActionTest.java
@@ -19,6 +19,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionKeyContext;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.ArtifactRoot;
@@ -122,6 +123,7 @@
/*actionInputPrefetcher=*/ null,
/*actionKeyContext=*/ null,
/*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
/*fileOutErr=*/ null,
new StoredEventHandler(),
/*clientEnv=*/ ImmutableMap.of(),
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/LtoBackendActionTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/LtoBackendActionTest.java
index 4604523..8545a43 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/LtoBackendActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/LtoBackendActionTest.java
@@ -20,6 +20,7 @@
import com.google.devtools.build.lib.actions.AbstractAction;
import com.google.devtools.build.lib.actions.Action;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionInputPrefetcher;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.Executor;
@@ -90,6 +91,7 @@
ActionInputPrefetcher.NONE,
actionKeyContext,
/*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
new FileOutErr(),
new StoredEventHandler(),
/*clientEnv=*/ ImmutableMap.of(),
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/BazelJ2ObjcLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/BazelJ2ObjcLibraryTest.java
index e89c793..87bfa7f 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/BazelJ2ObjcLibraryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/BazelJ2ObjcLibraryTest.java
@@ -26,6 +26,7 @@
import com.google.devtools.build.lib.actions.Action;
import com.google.devtools.build.lib.actions.ActionAnalysisMetadata;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionInputHelper;
import com.google.devtools.build.lib.actions.ActionInputPrefetcher;
import com.google.devtools.build.lib.actions.ActionTemplate.ActionTemplateExpansionException;
@@ -788,18 +789,19 @@
ActionExecutionContext dummyActionExecutionContext =
new ActionExecutionContext(
- null,
- null,
+ /*executor=*/ null,
+ /*actionInputFileCache=*/ null,
ActionInputPrefetcher.NONE,
actionKeyContext,
- null,
- null,
- null,
- ImmutableMap.<String, String>of(),
- ImmutableMap.of(),
+ /*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
+ /*fileOutErr=*/ null,
+ /*eventHandler=*/ null,
+ /*clientEnv=*/ ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
DUMMY_ARTIFACT_EXPANDER,
- null,
- null);
+ /*actionFileSystem=*/ null,
+ /*skyframeDepsResult=*/ null);
ByteArrayOutputStream moduleMapStream = new ByteArrayOutputStream();
ByteArrayOutputStream umbrellaHeaderStream = new ByteArrayOutputStream();
moduleMapAction.newDeterministicWriter(dummyActionExecutionContext)
@@ -841,18 +843,19 @@
ActionExecutionContext dummyActionExecutionContext =
new ActionExecutionContext(
- null,
- null,
+ /*executor=*/ null,
+ /*actionInputFileCache=*/ null,
ActionInputPrefetcher.NONE,
actionKeyContext,
- null,
- null,
- null,
- ImmutableMap.of(),
- ImmutableMap.of(),
+ /*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
+ /*fileOutErr=*/ null,
+ /*eventHandler=*/ null,
+ /*clientEnv=*/ ImmutableMap.of(),
+ /*topLevelFilesets=*/ ImmutableMap.of(),
DUMMY_ARTIFACT_EXPANDER,
- null,
- null);
+ /*actionFileSystem=*/ null,
+ /*skyframeDepsResult=*/ null);
ByteArrayOutputStream moduleMapStream = new ByteArrayOutputStream();
ByteArrayOutputStream umbrellaHeaderStream = new ByteArrayOutputStream();
diff --git a/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java b/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java
index 7c9ddc9..1a0ce10 100644
--- a/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java
+++ b/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java
@@ -22,6 +22,7 @@
import com.google.common.collect.Sets;
import com.google.common.eventbus.EventBus;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
+import com.google.devtools.build.lib.actions.ActionExecutionContext.LostInputsCheck;
import com.google.devtools.build.lib.actions.ActionInputPrefetcher;
import com.google.devtools.build.lib.actions.ActionKeyContext;
import com.google.devtools.build.lib.actions.Artifact;
@@ -190,6 +191,7 @@
ActionInputPrefetcher.NONE,
new ActionKeyContext(),
/*metadataHandler=*/ null,
+ LostInputsCheck.NONE,
outErr,
reporter,
/*clientEnv=*/ ImmutableMap.of(),