Skip to content

Support for toolchains aspects wildcard "*"#29415

Open
darkrift wants to merge 3 commits intobazelbuild:masterfrom
darkrift:toolchains_aspects_wildcard
Open

Support for toolchains aspects wildcard "*"#29415
darkrift wants to merge 3 commits intobazelbuild:masterfrom
darkrift:toolchains_aspects_wildcard

Conversation

@darkrift
Copy link
Copy Markdown

@darkrift darkrift commented Apr 28, 2026

Description

This adds support for "*" in toolchains_aspects the same way as attr_aspects does.

Disclaimer, all of it was produced by codex AI.

Fixes #29258

Motivation

This allows for generic aspects to not know in advance all the toolchains it would have to interact with when those toolchains adds various generic provides

Build API Changes

This changes allows for toolchain_types to be iterated on where applicable as a sequence such as for toolchain_type in ctx.rule.toolchains.toolchain_types():

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: None

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 28, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

If a build_setting is marked as repeatable = True or allow_multiple = True,
then in the command line events we should emit a separate Option message
for each instance of the corresponding flag.

The simplest way to do so is to store the set of repeatable/allow_multiple
flag names, and pass it through the options provider.

Otherwise, we end up with nonsense like `--//my:cflags=[-DX,-DY,-DZ]` in
the emitted events, which cannot be pasted back into the terminal.

PiperOrigin-RevId: 906478500
Change-Id: I6a8ed27682417b23ac22e6800e5e695fe841ed6e
@darkrift darkrift force-pushed the toolchains_aspects_wildcard branch 4 times, most recently from 3ed25f0 to 90644f0 Compare April 28, 2026 15:52
@darkrift darkrift force-pushed the toolchains_aspects_wildcard branch from 90644f0 to 49d6b49 Compare April 28, 2026 15:58
@darkrift darkrift marked this pull request as ready for review April 28, 2026 16:49
@darkrift darkrift requested a review from a team as a code owner April 28, 2026 16:49
@darkrift darkrift requested review from gregestren and removed request for a team April 28, 2026 16:49
@github-actions github-actions Bot added team-Configurability platforms, toolchains, cquery, select(), config transitions team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols awaiting-review PR is awaiting review from an assigned reviewer team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts team-Loading-API BUILD file and macro processing: labels, package(), visibility, glob labels Apr 28, 2026
@darkrift
Copy link
Copy Markdown
Author

@susinmotion @fmeum if you could review. It would also be nice to backport to 9 afterward and possibly 8 if possible.

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

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Configurability platforms, toolchains, cquery, select(), config transitions team-Loading-API BUILD file and macro processing: labels, package(), visibility, glob team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow "*" support for aspects.toolchains_aspects

2 participants