aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar tomlu <tomlu@google.com>2017-08-28 19:33:50 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-08-29 13:31:30 +0200
commit4b4403f9ef6f174dcb94c8370d3e9643eb5dd280 (patch)
tree2b2f07d96e0b0e033b8cb766bf4d6f02fdd91d3a /src/main/java/com/google/devtools
parent2ae3eaea447820c5fd33f3b3eeb1cb0f9df4768c (diff)
Use CustomCommandLine directly instead of via SpawnAction.Builder.
This change forces use of CustomCommandLine.Builder, which has a richer interface for constructing memory-efficient command lines. It will also permit surveying the code base for inefficient patterns using an IDE. This change was done by hand and split using Rosie to assist with rollbacks in case of bugs. Reviewers, please pay particular attention to: * Each all to addInputArgument/addOutputArgument should come with a corresponding matching pair to SpawnAction.Builder#addInput and CustomCommandLine.Builder#addExecPath (eg.). * The commandLine must be set on the SpawnAction using SpawnAction.Builder#setCommandLine. Note that most calls to addPrefixed("arg=", val) should be more idiomatically expressed as add("arg", val), but this involves changing tests and making sure that the command line tools can accept the format. PiperOrigin-RevId: 166723076
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java
index 222ae75ff5..87f43cc057 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java
@@ -32,6 +32,7 @@ import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.StaticallyLinkedMarkerProvider;
import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
+import com.google.devtools.build.lib.analysis.actions.CustomCommandLine;
import com.google.devtools.build.lib.analysis.actions.SpawnAction;
import com.google.devtools.build.lib.analysis.actions.SymlinkAction;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration;
@@ -660,10 +661,10 @@ public class CppHelper {
.addOutput(output)
.useDefaultShellEnvironment()
.setExecutable(stripTool.getToolPath(cppConfiguration.getCrosstoolTopPathFragment()))
- .addArguments(commandLine)
.setExecutionInfo(executionInfoBuilder.build())
.setProgressMessage("Stripping %s for %s", output.prettyPrint(), context.getLabel())
.setMnemonic("CcStrip")
+ .setCommandLine(CustomCommandLine.builder().addAll(commandLine).build())
.build(context);
context.registerAction(stripAction);
}