[9.2.0] Implement transition.and_then#29888
Merged
Merged
Conversation
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)
This was referenced Jun 18, 2026
gregestren
approved these changes
Jun 22, 2026
Merged
via the queue into
bazelbuild:release-9.2.0
with commit Jun 22, 2026
94cc17d
45 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
RELNOTES[NEW]: The
and_thenmethod ontransitions 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
Release Notes
RELNOTES: None