Support for injecting custom toolchain features (approach injecting rule-based features with example)#524
Conversation
This is a draft proposal to inject rules-based toolchain features into the legacy toolchain.
f8959db to
4295909
Compare
|
yea i think something like this would be great. i wouldn't be surprised if there was a bit of pushback on using the new API in the older style toolchains |
armandomontanez
left a comment
There was a problem hiding this comment.
I like this idea. While this isn't necessarily an ideal state for anyone to live in long term, I think it's still overall a net positive.
| @@ -0,0 +1,6 @@ | |||
| load("@rules_cc//cc:cc_binary.bzl", "cc_binary") | |||
|
|
|||
| cc_binary( | |||
There was a problem hiding this comment.
Was this intended to be built with the toolchain in //examples/inject_extra_features/toolchain? The toolchain isn't registered.
There was a problem hiding this comment.
@armandomontanez it was intended that it is not register. For the moment I just wanted to add an example in the draft in this way people could play around with the command line that I mentioned in the PR description.
If between #523 and #524 you also agree that #524 is the preferred approach, then I would just close both of them and we can continue the discussion in #525. You will see that in #525 I did not add any example, I believe that it is quite simple as to need an example, but if you want one let me know.
|
Thanks all for the feedback. I will close this and bring the implementation in #525 |
Hi, this is just a draft how a proposal could look like to implement #517 on the legacy toolchain approach but injecting features defined with the new rules-based toolchain approach. In my opinion it looks much more elegant than #523 and it would also be easier for users to later migrate to the new rules-based toolchain approach.
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