`Desugar` actions don't run on multiplex workers
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- android
- Domain
- build-system, mobile
Research direction
Read rules/desugar.bzl and compare its execution requirements with rules/dex.bzl, using the persistent Android desugar configuration fields exposed through AndroidConfigurationApi as the entry point. Verify that the requirements differ correctly for persistent and persistent multiplex workers, then confirm the relevant flag behavior with the Bazel flag expansion described in the issue.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Java
- Stars
- 203
- Forks
- 95
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bazelbuild/rules_android
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bazelbuild/rules_android#535 · 2 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bazelbuild/rules_android#485 · 4 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
bazelbuild/rules_android#564 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
bazelbuild/rules_android#560 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
bazelbuild/rules_android#558 ·
All issues in bazelbuild/rules_android
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100