Skip to content

RFC: rust_toolchains submodule#3857

Open
dzbarsky wants to merge 1 commit intomainfrom
rust_toolchains
Open

RFC: rust_toolchains submodule#3857
dzbarsky wants to merge 1 commit intomainfrom
rust_toolchains

Conversation

@dzbarsky
Copy link
Contributor

@dzbarsky dzbarsky commented Feb 16, 2026

This unblocks alternative rulesets from providing their own toolchain definitions while reusing rules_rust for compilation. Also it lays groundwork for splitting cargo and clippy to their own toolchains, so we can slim down rustc toolchain and optimize fetches

Copy link
Contributor

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

bazel_dep(name = "bazel_features", version = "1.32.0")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rust_toolchains", version = "0.68.1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: there's an existing convention on BCR to prefix instead, so toolchains_rust ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a super strong opinion on this bikeshed, i just want it built. That said, if you take a look at https://registry.bazel.build/search?q=toolchains you'll see that:

  • 5 CC toolchains followed this convention (and toolchains_llvm_boostrapped only did because we were strongly urged, it will get renamed though)
  • 5 CC toolchains did xxx_toolchain instead
  • proto_toolchains also followed it, probably because you/Fabian picked the name :)
  • No other language did anything like this

So it doesn't feel like we necessarily need to draw a trend from a few isolated points, we should just pick whatever name is clearest IMO

@@ -0,0 +1,5 @@
package(default_visibility = ["//visibility:public"])

toolchain_type(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we comment explicitly that these are all meant to resolve to the exec platform? I dunno why it would be useful to have target-platform for these tools but I can imagine the feature request

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, we can :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I can imagine a scenario where your target platform is meant for execution. Imagine you are building dev VM images or similar and want to package a compiler.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and you could also have clippy run as a test, and use target platform for tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this landed first to unblock progress and then we can do target-platform toolchains as a followup

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

Comments