Skip to content

Honor persistent worker flags for Desugar actions - #575

Open
lukaciko wants to merge 3 commits into
bazelbuild:mainfrom
lukaciko:fix-desugar-multiplex-workers
Open

lukaciko wants to merge 3 commits into
bazelbuild:mainfrom
lukaciko:fix-desugar-multiplex-workers

Conversation

@lukaciko

@lukaciko lukaciko commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #539.

Desugar always advertises singleplex worker support, so --persistent_multiplex_android_dex_desugar has no effect on its actions. This still happens in rules_android 0.8.0.

Copy DexBuilder's flag checks from rules/dex.bzl. Enable workers when the persistent flag is set, then enable multiplex workers when the multiplex flag is also set. Both Java tools already use WorkRequestHandler, which supports multiplex requests.

Tests reuse the R8 app fixture and cover all four flag combinations on Bazel 9.2.0 and Bazel 10 (last_green).

Comment thread test/rules/desugar/test.bzl Outdated
fields = ["execution_requirements"],
)

def _desugar_action_impl(ctx):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to have a higher-level integration test (i.e. using rules_bazel_integration_test), rather than an analysis test for the action itself. In its current state, this test relies on many implementation details surrounding the desugar worker support.

@ted-xie

ted-xie commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

The tests cover all four flag combinations. They pass on Bazel 8.8, 9.0.0rc3, and 9.1.1.

The important scenarios to capture here are before vs after Bazel 10. So if you decide to go forward with my suggestion in test.bzl (i.e. create a new integration test), it would be sufficient to just test against 9.x and 10.x.

@ted-xie

ted-xie commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

It looks like presubmit failed for WORKSPACE support (sorry, we still support this until Bazel 8 deprecation).

It might make more sense to create a dedicated task in presubmit.yml for this, where only bzlmod is supported.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desugar actions don't run on multiplex workers

2 participants