Open alexeagle opened 9 months ago
I think there are 3 pieces that would need to be part of a centralized repo, the toolchain_type
, any provider definitions that get used in the ToolchainInfo
, and the rule that constructs that ToolchainInfo
.
In general, I agree this is the right direction. However, we also need to think about how to migrate existing definitions to this central repo in a less intrusive way for users. For example, when we moved most of java toolchains from bazel_tools
to rules_java
, we had to leave the java toolchain in bazel_tools
to be backwards compatible.
/cc @comius probably has more thoughts on this.
Toolchains are like Providers:
toolchain_type
definition must be canonical. Everyone must agree on the symbol to use, e.g.@someones_repo//toolchains:grep_toolchain
grep
executable for example. They could leave it for users to choose one of the concrete toolchain implementations.Currently the world is broken because rulesets that define a concrete toolchain (e.g. the
tar_toolchain
in aspect bazel-lib) ALSO define atoolchain_type
symbol.On Slack, @rickvanprim proposed that a new
toolchains
repo could be created. I think it's a good idea. Note that it must be suitable to be a common dependency of many rulesets, like https://registry.bazel.build/modules/bazel_features