Skip to content

Conversation

@limdor
Copy link
Contributor

@limdor limdor commented Nov 13, 2025

This adds a parameter to unix cc_toolchain_config and windows cc_toolchain_config to be able to inject a cc_feature. This allows a user to inject a feature (for example for custom warnings) without having to reimplement the full toolchain.

Resolves #517

@limdor
Copy link
Contributor Author

limdor commented Nov 13, 2025

I added to 0538f26 to see if the rest of the tests were passing. I believe that this is not wanted but I would ask for advice. The problem we have here is that the bzl file ends up in a generated repository. AFAIK there is no way or it is not a good practice to allow visibility to a specific named repository.

@armandomontanez
Copy link
Collaborator

Re: visibility

I'd expect adding "@local_config_cc/...", should do what you want.

@limdor
Copy link
Contributor Author

limdor commented Nov 20, 2025

@armandomontanez it does not work. It does not seem to be allowed to use the @ notation

Error in visibility: invalid package name '@local_config_cc//...': must start with '//' or be 'public' or 'private'

limdor added a commit to limdor/rules_cc that referenced this pull request Dec 2, 2025
limdor added a commit to limdor/rules_cc that referenced this pull request Dec 2, 2025
@limdor
Copy link
Contributor Author

limdor commented Dec 2, 2025

@armandomontanez could you provide guidance on which direction you would like me to take? For the providers file, if the direction is to make it public I created #540
For the file in impl, it is a bit more tricky. I could create another bzl file that only expose the interested conversion function, but I would need guidance on where to put such bzl file and how to call it.

@limdor limdor force-pushed the inject_features_support branch 3 times, most recently from 80a23eb to 9d5a4df Compare January 17, 2026 19:51
@limdor
Copy link
Contributor Author

limdor commented Jan 17, 2026

@armandomontanez can you take a look again? With the changes that I incorporated only the required parts are exposed.

This adds a parameter to unix cc_toolchain_config and windows
cc_toolchain_config to be able to inject a cc_feature.
This allows a user to inject a feature (for example for custom
warnings) without having to reimplement the full toolchain.

Resolves bazelbuild#517
@limdor limdor force-pushed the inject_features_support branch from 9d5a4df to a148085 Compare January 17, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for injecting custom toolchain features

2 participants