From a9fc454acba6d8f783a0a41924d9b454fe1bdc05 Mon Sep 17 00:00:00 2001 From: Jingwen Chen Date: Wed, 29 May 2019 11:28:11 -0700 Subject: [PATCH] Enable persistent workers for Desugar by default for Bazel Default Desugar to use persistent workers as a sane default. Measured to reduce local build times by up to 20%. RELNOTES: Android desugaring actions now use persistent workers by default. This has been measured to provide up to 20% reduction in build times. To disable it, use the `--strategy=Desugar=sandboxed` flag. See https://github.com/bazelbuild/bazel/issues/8342 and https://github.com/bazelbuild/bazel/issues/8427 for more details on local build speed optimization for Android apps. Closes #8448. PiperOrigin-RevId: 250531699 --- .../devtools/build/lib/bazel/rules/BazelStrategyModule.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelStrategyModule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelStrategyModule.java index f3db244406e56b..0b7ca22edc7467 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelStrategyModule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelStrategyModule.java @@ -70,6 +70,7 @@ public void executorInit(CommandEnvironment env, BuildRequest request, ExecutorB builder.addStrategyByMnemonic("Javac", ImmutableList.of("worker")); builder.addStrategyByMnemonic("Closure", ImmutableList.of("worker")); builder.addStrategyByMnemonic("DexBuilder", ImmutableList.of("worker")); + builder.addStrategyByMnemonic("Desugar", ImmutableList.of("worker")); // The --spawn_strategy= flag is a bit special: If it's set to the empty string, we actually // have to pass a literal empty string to the builder to trigger the "use the strategy that