aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Liam Miller-Cushon <cushon@google.com>2016-04-27 16:59:50 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-04-27 17:12:33 +0000
commit8a79d0a86febe2dbe7ddebb0d3a1f7b39d2de1a2 (patch)
treeb015ab7d97c0a8529959591194b7826735e4d8ef
parent5735c25c0066f9563935334703a823c22f932505 (diff)
Run JavaBuilder with a UTF-8 charset
-- MOS_MIGRATED_REVID=120925801
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java
index 8d5324ff79..5c3d36d41e 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java
@@ -351,15 +351,23 @@ public final class JavaCompileAction extends AbstractAction {
return ImmutableList.copyOf(commandLine.arguments());
}
+ @VisibleForTesting
+ public Spawn createSpawn() {
+ return new BaseSpawn(
+ getCommand(),
+ ImmutableMap.of("LC_CTYPE", "en_US.UTF-8"),
+ /*executionInfo=*/ ImmutableMap.<String, String>of(),
+ this,
+ LOCAL_RESOURCES);
+ }
+
@Override
@ThreadCompatible
public void execute(ActionExecutionContext actionExecutionContext)
throws ActionExecutionException, InterruptedException {
Executor executor = actionExecutionContext.getExecutor();
try {
- Spawn spawn = new BaseSpawn(getCommand(), ImmutableMap.<String, String>of(),
- ImmutableMap.<String, String>of(), this, LOCAL_RESOURCES);
- getContext(executor).exec(spawn, actionExecutionContext);
+ getContext(executor).exec(createSpawn(), actionExecutionContext);
} catch (ExecException e) {
throw e.toActionExecutionException("Java compilation in rule '" + getOwner().getLabel() + "'",
executor.getVerboseFailures(), this);