diff options
author | 2017-02-24 06:02:20 +0000 | |
---|---|---|
committer | 2017-02-24 08:32:05 +0000 | |
commit | e716ae46f359dc1361574f44569811ff80a758ac (patch) | |
tree | 56ccf4f827e52f76b95b65a2ef3100a4cd917016 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java | |
parent | 3adcef45a8fcf646fb3260738fd68d6f81372d51 (diff) |
Encore of commit 41c2a26eef89167e807cbc9f33487dc66bb757d3 that removed AbstractAction#getInputFilesForExtraAction().
Turns out, we didn't add *mandatory* inputs of the shadowed action to the extra action, thus, breakage.
Original description:
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: 148429641
MOS_MIGRATED_REVID=148429641
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java index 9936319435..3f8437087f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java @@ -436,7 +436,8 @@ public class CppCompileAction extends AbstractAction @Nullable @Override - public Iterable<Artifact> discoverInputs(ActionExecutionContext actionExecutionContext) + public synchronized Iterable<Artifact> discoverInputs( + ActionExecutionContext actionExecutionContext) throws ActionExecutionException, InterruptedException { Executor executor = actionExecutionContext.getExecutor(); Iterable<Artifact> initialResult; @@ -1263,32 +1264,6 @@ public class CppCompileAction extends AbstractAction } } - /** - * Provides list of include files needed for performing extra actions on this action when run - * remotely. The list of include files is created by performing a header scan on the known input - * files. - */ - @Override - public Iterable<Artifact> getInputFilesForExtraAction( - ActionExecutionContext actionExecutionContext) - throws ActionExecutionException, InterruptedException { - Iterable<Artifact> scannedIncludes; - try { - scannedIncludes = actionExecutionContext.getExecutor().getContext(actionContext) - .findAdditionalInputs(this, actionExecutionContext, cppSemantics.getIncludeProcessing()); - } catch (ExecException e) { - throw e.toActionExecutionException(this); - } - - if (scannedIncludes == null) { - return ImmutableList.of(); - } - - // Use a set to eliminate duplicates. - ImmutableSet.Builder<Artifact> result = ImmutableSet.builder(); - return result.addAll(getInputs()).addAll(scannedIncludes).build(); - } - @Override public String getMnemonic() { return "CppCompile"; } |