diff options
author | Janak Ramakrishnan <janakr@google.com> | 2015-05-27 00:46:16 +0000 |
---|---|---|
committer | Laurent Le Brun <laurentlb@google.com> | 2015-05-27 16:49:42 +0000 |
commit | 1ea9cfbd5155ca7eaff29ef5504c2134afc7e62f (patch) | |
tree | ab2d7f190dac9dc65cb25c3213a733c5a3bdf3d4 /src/main/java/com/google | |
parent | 531fc042bba338613978cf65d86a6299859f5e1e (diff) |
Give each extra action script file a unique name to avoid action conflicts when there are multiple extra actions attached to a given configured target, each with a long command line.
--
MOS_MIGRATED_REVID=94529604
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java index 323cbe8741..2df7a8ffd5 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java +++ b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java @@ -125,8 +125,12 @@ public final class ExtraActionSpec implements TransitiveInfoProvider { ImmutableList.<FilesToRunProvider>of(), ImmutableMap.<Label, Iterable<Artifact>>of()); + // Multiple actions in the same configured target need to have different names for the artifact + // that might be created here, so we append something that should be unique for each action. + String actionUniquifier = actionToShadow.getPrimaryOutput().getExecPath().getBaseName() + "." + + actionToShadow.getKey(); List<String> argv = commandHelper.buildCommandLine(command, extraActionInputs, - ".extra_action_script.sh", executionInfo); + "." + actionUniquifier + ".extra_action_script.sh", executionInfo); String commandMessage = String.format("Executing extra_action %s on %s", label, ownerLabel); owningRule.registerAction(new ExtraAction( |