aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java b/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
index a8b460e823..7919529da0 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
@@ -174,8 +174,7 @@ public abstract class AbstractAction implements Action, SkylarkValue {
}
@Override
- public synchronized Iterable<Artifact> discoverInputs(
- ActionExecutionContext actionExecutionContext)
+ public Iterable<Artifact> discoverInputs(ActionExecutionContext actionExecutionContext)
throws ActionExecutionException, InterruptedException {
throw new IllegalStateException("discoverInputs cannot be called for " + this.prettyPrint()
+ " since it does not discover inputs");
@@ -496,6 +495,27 @@ public abstract class AbstractAction implements Action, SkylarkValue {
return ImmutableSet.of();
}
+ /**
+ * Returns input files that need to be present to allow extra_action rules to shadow this action
+ * correctly when run remotely. This is at least the normal inputs of the action, but may include
+ * other files as well. For example C(++) compilation may perform include file header scanning.
+ * This needs to be mirrored by the extra_action rule. Called by
+ * {@link com.google.devtools.build.lib.rules.extra.ExtraAction} at execution time.
+ *
+ * <p>As this method is called from the ExtraAction, make sure it is ok to call
+ * this method from a different thread than the one this action is executed on.
+ *
+ * @param actionExecutionContext Services in the scope of the action, like the Out/Err streams.
+ * @throws ActionExecutionException only when code called from this method
+ * throws that exception.
+ * @throws InterruptedException if interrupted
+ */
+ public Iterable<Artifact> getInputFilesForExtraAction(
+ ActionExecutionContext actionExecutionContext)
+ throws ActionExecutionException, InterruptedException {
+ return getInputs();
+ }
+
@SkylarkCallable(
name = "inputs",
doc = "A set of the input files of this action.",