Stop registering Swift toolchains transitively - #1815
Open
dzbarsky wants to merge 1 commit into
Open
Conversation
dzbarsky
marked this pull request as ready for review
June 22, 2026 02:37
dzbarsky
requested review from
aaronsky,
adincebic,
brentleyjones,
keith,
luispadron and
mattrobmattrob
as code owners
June 22, 2026 02:37
Member
|
which case is this eagerly fetched now vs your override (if you need it at all) taking over? |
Contributor
Author
|
My primary interest is making sure the pattern fixed in #1651 isn't accidentally reintroduced. But also in Adins PR there are repeated references to needing to register toolchains in the right order so they don't override each other. I think it's simplest to just let the consumer issue the 1-line call and have full control :) |
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.
Summary
It's bad practice for rules to autoregister toolchains, as it takes away control from end users and can cause undesired fetches. Especially when the toolchain in question triggers non-hermetic repo rule executions.
Mark
//swift/toolchains:allregistration inrules_swift'sMODULE.bazelas a development dependency. Dependent Bazel modules no longer inherit the autoconfigured Swift toolchain registration and must explicitly register@rules_swift//swift/toolchains:all.Update
README.mdand.github/generate-notes.shso release snippets include the required explicit registration.rules_swiftdevelopment continues to register//swift/toolchains:allbecauserules_swiftis the root module during development.