Skip to content

Stop registering Swift toolchains transitively - #1815

Open
dzbarsky wants to merge 1 commit into
bazelbuild:mainfrom
dzbarsky:zbarsky/toolchains
Open

Stop registering Swift toolchains transitively#1815
dzbarsky wants to merge 1 commit into
bazelbuild:mainfrom
dzbarsky:zbarsky/toolchains

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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:all registration in rules_swift's MODULE.bazel as 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.md and .github/generate-notes.sh so release snippets include the required explicit registration. rules_swift development continues to register //swift/toolchains:all because rules_swift is the root module during development.

@dzbarsky dzbarsky changed the title [codex] Stop registering Swift toolchains transitively Stop registering Swift toolchains transitively Jun 22, 2026
@dzbarsky
dzbarsky marked this pull request as ready for review June 22, 2026 02:37
@keith

keith commented Jun 22, 2026

Copy link
Copy Markdown
Member

which case is this eagerly fetched now vs your override (if you need it at all) taking over?

@dzbarsky

Copy link
Copy Markdown
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 :)

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.

2 participants