Desugar action runs on a singleplex workers even when --persistent_multiplex_android_dex_desugar is set.
rules/desugar.bzl hardcodes execution_requirements = {"supports-workers": "1"} — it never checks persistent_multiplex_android_dex_desugar, so the --persistent_multiplex_android_dex_desugar flag has no effect on Desugar actions. This is apparently a Starlark migration regression. rules/dex.bzl does this correctly for DexBuilder.
Fixing this issue on the Spotify app brought down Desugar's critical path contribution from 60s to 7s on our API change scenario.
Fix
Mirror what dex.bzl already does:
execution_requirements = {}
if ctx.fragments.android.persistent_android_dex_desugar:
execution_requirements["supports-workers"] = "1"
if ctx.fragments.android.persistent_multiplex_android_dex_desugar:
execution_requirements["supports-multiplex-workers"] = "1"
Everything else is already wired — the flag expands correctly (bazel canonicalize-flags shows --internal_persistent_multiplex_android_dex_desugar=1), AndroidConfigurationApi exposes the field to Starlark, and the Desugar tool uses WorkRequestHandler which supports multiplex.
Confirmed still present in v0.7.3. Tested against v0.7.1 / Bazel 8.6.0.
Desugaraction runs on a singleplex workers even when--persistent_multiplex_android_dex_desugaris set.rules/desugar.bzlhardcodesexecution_requirements = {"supports-workers": "1"}— it never checkspersistent_multiplex_android_dex_desugar, so the--persistent_multiplex_android_dex_desugarflag has no effect on Desugar actions. This is apparently a Starlark migration regression.rules/dex.bzldoes this correctly for DexBuilder.Fixing this issue on the Spotify app brought down Desugar's critical path contribution from 60s to 7s on our API change scenario.
Fix
Mirror what
dex.bzlalready does:Everything else is already wired — the flag expands correctly (
bazel canonicalize-flagsshows--internal_persistent_multiplex_android_dex_desugar=1),AndroidConfigurationApiexposes the field to Starlark, and the Desugar tool usesWorkRequestHandlerwhich supports multiplex.Confirmed still present in v0.7.3. Tested against v0.7.1 / Bazel 8.6.0.