bazelbuild / bazelbuild/rules_android

`Desugar` actions don't run on multiplex workers

Open
#539 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
203
Forks
95
PR merge metrics
No merged PRs in 30d

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:

```python
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.