aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2015-04-13 14:54:27 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2015-04-14 14:30:13 +0000
commite6402cbf8c574891790ed97550681f1c4c16e109 (patch)
tree8e6ec64a39a341f50edf7ba011ca19a72853f0af /src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java
parent57892bd6aa565e3557fc05ddd50a842757aa606a (diff)
Support running extra_actions on [].
-- MOS_MIGRATED_REVID=90988858
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java b/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java
index 75bc0e135d..5075aba013 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java
@@ -235,8 +235,7 @@ public final class CommandHelper {
*/
public List<String> buildCommandLine(
String command, NestedSetBuilder<Artifact> inputs, String scriptPostFix) {
- return buildCommandLine(command, inputs, scriptPostFix,
- ruleContext.getConfiguration().getShExecutable());
+ return buildCommandLine(command, inputs, scriptPostFix, ImmutableMap.<String, String>of());
}
/**
@@ -244,11 +243,15 @@ public final class CommandHelper {
* if the command line is longer than the allowed maximum {@link #maxCommandLength}.
* Fixes up the input artifact list with the created bash script when required.
*
- * @param shellPath path to the shell that should invoke this command
+ * @param executionInfo an execution info map of the action associated with the command line to be
+ * built.
*/
public List<String> buildCommandLine(
String command, NestedSetBuilder<Artifact> inputs, String scriptPostFix,
- PathFragment shellPath) {
+ Map<String, String> executionInfo) {
+ // Use vanilla /bin/bash for actions running on mac machines.
+ PathFragment shellPath = executionInfo.containsKey("requires-darwin")
+ ? new PathFragment("/bin/bash") : ruleContext.getConfiguration().getShExecutable();
Pair<List<String>, Artifact> argvAndScriptFile =
buildCommandLineMaybeWithScriptFile(ruleContext, command, scriptPostFix, shellPath);
if (argvAndScriptFile.second != null) {