Skip to content

[9.2.0] Implement transition.and_then#29888

Merged
iancha1992 merged 1 commit into
bazelbuild:release-9.2.0from
fmeum:and-then
Jun 22, 2026
Merged

[9.2.0] Implement transition.and_then#29888
iancha1992 merged 1 commit into
bazelbuild:release-9.2.0from
fmeum:and-then

Conversation

@fmeum

@fmeum fmeum commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Implements the proposal https://github.com/bazelbuild/proposals/blob/main/designs/2024-04-16-transition-composition.md.

This change in particular allows non-toolchain dependencies of rules to inherit both the execution platform (via config.exec()) as well as the current target platform (via a custom transition that records //command_line_option:platforms), which is important for certain cross-compilation scenarios.

Yes, as discussed and approved in https://github.com/bazelbuild/proposals/blob/main/designs/2024-04-16-transition-composition.md.

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

RELNOTES[NEW]: The and_then method on transitions can be used to compose transitions. Both Starlark transitions and native transitions (e.g. config.exec()) are supported.

Closes #29542.

PiperOrigin-RevId: 934095515
Change-Id: I3f36ec0907c4af5bdf43e38323d166422b47051c
(cherry picked from commit d089ae2)

Description

Motivation

Build API Changes

No

Checklist

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

Release Notes

RELNOTES: None

@fmeum fmeum requested a review from a team as a code owner June 18, 2026 12:12
@fmeum fmeum requested a review from gregestren June 18, 2026 12:12
@github-actions github-actions Bot added team-Configurability platforms, toolchains, cquery, select(), config transitions team-Documentation Documentation improvements that cannot be directly linked to other team labels awaiting-review PR is awaiting review from an assigned reviewer team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts labels Jun 18, 2026
Implements the proposal https://github.com/bazelbuild/proposals/blob/main/designs/2024-04-16-transition-composition.md.

This change in particular allows non-toolchain dependencies of rules to inherit both the execution platform (via `config.exec()`) as well as the current target platform (via a custom transition that records `//command_line_option:platforms`), which is important for certain cross-compilation scenarios.

Yes, as discussed and approved in https://github.com/bazelbuild/proposals/blob/main/designs/2024-04-16-transition-composition.md.

- [x] I have added tests for the new use cases (if any).
- [x] I have updated the documentation (if applicable).

RELNOTES[NEW]: The `and_then` method on `transition`s can be used to compose transitions. Both Starlark transitions and native transitions (e.g. `config.exec()`) are supported.

Closes bazelbuild#29542.

PiperOrigin-RevId: 934095515
Change-Id: I3f36ec0907c4af5bdf43e38323d166422b47051c
(cherry picked from commit d089ae2)
@iancha1992 iancha1992 added this pull request to the merge queue Jun 22, 2026
@gregestren gregestren added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Jun 22, 2026
Merged via the queue into bazelbuild:release-9.2.0 with commit 94cc17d Jun 22, 2026
45 checks passed
@github-actions github-actions Bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Jun 22, 2026
@fmeum fmeum deleted the and-then branch June 22, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Configurability platforms, toolchains, cquery, select(), config transitions team-Documentation Documentation improvements that cannot be directly linked to other team labels team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants