diff options
author | Philipp Wollermann <philwo@google.com> | 2016-07-29 13:04:16 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-07-29 16:02:03 +0000 |
commit | 490f250b27183a886cf70a5fe9e99d9428141b34 (patch) | |
tree | c9d2f7356531bc8b584e80660ee82df2b249105b /src | |
parent | f9bc66571bf738134dc2796249d08b55f240bb63 (diff) |
workers: Use workers by default for Javac.
RELNOTES: Persistent workers are now used by default for Java compilation in Bazel, which should speed up your Java builds by ~4x. You can switch back to the old behavior via --strategy=Javac=standalone. Check out http://www.bazel.io/blog/2015/12/10/java-workers.html for more details.
--
MOS_MIGRATED_REVID=128801059
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java | 4 | ||||
-rwxr-xr-x | src/test/shell/bazel/bazel_worker_test.sh | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java index c4e9b7a780..4cf042b782 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java @@ -46,7 +46,6 @@ import com.google.devtools.build.lib.util.ResourceFileLoader; import com.google.devtools.common.options.Converters.AssignmentConverter; import com.google.devtools.common.options.Option; import com.google.devtools.common.options.OptionsBase; - import java.io.IOException; import java.util.List; import java.util.Map; @@ -107,6 +106,9 @@ public class BazelRulesModule extends BlazeModule { public ImmutableMap<String, String> getSpawnActionContexts() { Map<String, String> contexts = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); + // Default strategies for certain mnemonics - they can be overridden by --strategy= flags. + contexts.put("Javac", "worker"); + contexts.put("Genrule", options.genruleStrategy); for (Map.Entry<String, String> strategy : options.strategy) { diff --git a/src/test/shell/bazel/bazel_worker_test.sh b/src/test/shell/bazel/bazel_worker_test.sh index 130da344e5..6fecea28c4 100755 --- a/src/test/shell/bazel/bazel_worker_test.sh +++ b/src/test/shell/bazel/bazel_worker_test.sh @@ -396,7 +396,7 @@ EOF expect_log "Created new Work worker (id [0-9]\+)" - worker_log=$(egrep -o -- 'logging to .*/worker-logs/.*' "$TEST_log" | sed 's/^logging to //') + worker_log=$(egrep -o -- 'logging to .*/worker-logs/worker-[0-9]-Work.log' "$TEST_log" | sed 's/^logging to //') [ -e "$worker_log" ] \ || fail "Worker log was not found" |