-
Notifications
You must be signed in to change notification settings - Fork 70
Add proto_toolchain rule #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e3d417c
to
0c8e3b9
Compare
5b33509
to
42e6845
Compare
This change exposes the values of `--protoc` and `--proto_options` to Starlark, thus making it possible to implement `proto_toolchain` in Starlark. See bazelbuild/rules_proto#82 for the implementation of `proto_toolchain`. Working towards bazelbuild#10005
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. If you know any good alternatives for the transition, feel free to suggest them. Otherwise LGTM.
(I'll fix the nits later today) I agree that we should migrate away from the command-line flags, however, I'd like to start with using |
I would rather see that proto_toolchain rule looks like the final version, that is with a mandatory attribute for protoc, with a default value set. Then add a flag --incompatible_use_toolchain_resolution_for_proto_rules, which is used in the actual rule implementation and decides either to use the toolchain's protoc or the one from flag. This direction won't block you, when you'll need to add multiple proto_toolchain definitions with protoc for different OS and CPUs. You will still need an implicit dependency in the proto rules. But even before proto rules are in Starlark, we can flip the toolchain resolution flag and remove protoc flag. |
Sure, I can create something similar to what C++/Java do |
42e6845
to
4874999
Compare
4874999
to
35184b3
Compare
May I suggest that you write a proposal for proto rules toolchainization? See https://github.com/bazelbuild/proposals |
35184b3
to
74faad4
Compare
Done (https://docs.google.com/document/d/1go3UMwm2nM8JHhI3MZrtyoFEy3BYg5omGqQmOwcjmNE/edit) PTAL |
I'm closing this because it's outdated, and we probably don't need proto_toolchain rule. |
No description provided.