From 41c2a26eef89167e807cbc9f33487dc66bb757d3 Mon Sep 17 00:00:00 2001 From: Lukacs Berki Date: Fri, 3 Feb 2017 08:40:51 +0000 Subject: Remove AbstractAction#getInputFilesForExtraAction(). This method was used to return the discovered inputs for extra actions, but it turns out that we can use #discoverInputs() just as well. Note that this makes it possible for #discoverInputs() to be called more than once per action instance (once for the action and once for each extra action), but this appears to work. A followup change may be able to dispense with that, but let's take baby steps for now. Also note that this introduces synchronization between an action and its associated extra action. -- PiperOrigin-RevId: 146450132 MOS_MIGRATED_REVID=146450132 --- .../devtools/build/lib/actions/AbstractAction.java | 24 ++-------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/actions') 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 7919529da0..a8b460e823 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,7 +174,8 @@ public abstract class AbstractAction implements Action, SkylarkValue { } @Override - public Iterable discoverInputs(ActionExecutionContext actionExecutionContext) + public synchronized Iterable discoverInputs( + ActionExecutionContext actionExecutionContext) throws ActionExecutionException, InterruptedException { throw new IllegalStateException("discoverInputs cannot be called for " + this.prettyPrint() + " since it does not discover inputs"); @@ -495,27 +496,6 @@ 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. - * - *

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 getInputFilesForExtraAction( - ActionExecutionContext actionExecutionContext) - throws ActionExecutionException, InterruptedException { - return getInputs(); - } - @SkylarkCallable( name = "inputs", doc = "A set of the input files of this action.", -- cgit v1.2.3