Skip to content

Conversation

@limdor
Copy link
Contributor

@limdor limdor commented Nov 12, 2025

Hi, this is just a draft how a proposal could look like to implement #517 on the legacy toolchain approach defining legacy toolchain features. Because there is no rule for that, rules for the providers should be created.

Another approach would be to support the injection of toolchain features in a legacy toolchain but require that such injected feature should be a rule-base feature and then the implementation just calls https://github.com/bazelbuild/rules_cc/blob/main/cc/toolchains/impl/legacy_converter.bzl#L105 before injecting it.

Let me know your opinion

If you want to try it out just run:

bazel build //examples/inject_extra_features:main --extra_toolchains=//examples/inject_extra_features/toolchain:my_linux_toolchain --toolchain_resolution_debug=.* --subcommands=pretty_print --features=foo

@limdor limdor changed the title Draft proposal to inject extra features Draft proposal to inject extra features (inject legacy features) Nov 13, 2025
@limdor limdor changed the title Draft proposal to inject extra features (inject legacy features) Support for injecting custom toolchain features (approach injecting legacy features with example) Nov 13, 2025
@armandomontanez
Copy link
Collaborator

armandomontanez commented Nov 18, 2025

Because there is no rule for that, rules for the providers should be created.

This is actually how the rules-based toolchain rules started. The returned providers diverged over time because we wanted to enrich the experience. It'd be best to just go all-in on the existing toolchain rules (like in #524) rather than introducing a new derivative.

@limdor limdor closed this Nov 18, 2025
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