-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add ProtoInfo constructor to Starlark #11061
Add ProtoInfo constructor to Starlark #11061
Conversation
cc: @Yannic |
f6b9737
to
bf1ef07
Compare
@lberki are you still the right person to look at this PR? This feature would let us fix another problem with the IJ plugin not recognizing proto files because we have to make a custom ProtoInfo object for our Proto Rules because there is no way in StarLark to create a native ProtoInfo object. |
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.
Have you considered implementing it as a default constructor? That is exposing ProtoInfo() call to Starlark, like it is done for JavaInfo, CcInfo.
Also rebase is needed, FakeApi has mostly been removed, so no changes are needed on FakeProtoCommon.
I haven't done a more thorough review, but the newly added signatures look ok.
Friendly ping. This code has gone stale. |
bf1ef07
to
7d24cf1
Compare
Thanks for looking at the change. The PR has been updated so it is now a ProtoInfo constructor instead of proto_common.createProtoInfo. It probably still needs one or two more integration tests to make sure a ProtoInfo object built in Starlark will work along with native ProtoInfo objects. |
7d24cf1
to
e8c9773
Compare
I added an integration test that exposes a problem with the hidden |
Hello, thank you very much for this change. We are in the process of starlarkifying all the rules right now. We haven't reached proto rules yet but will do so in Q4. As part of that starlarkification process the ProtoInfo constructor will be in Starlark too. But for now in order not to interfere with that process we rather not expose any APIs publicly. Count on next year this being possible though. Thanks! |
@oquenchil The starlarkification process has been promised for 3 years now, is there any work actually started for the proto rules? The point of having a ProtoInfo constructor in Starlark is so you could transition from the native proto rules to the Starlark rules with the native ProtoInfo object. Is the plan to try to move everyone to a Starlark built ProtoInfo object all at once? That seems like that will break backwards compatibility. |
Work on the proto rules should start during Q4 this year. Unlike previous Starlarkification promises we are actually moving forward this year and have already starlarkified a number of rules. The plan is to have the current native rules in Starlark without any incompatible changes, the ProtoInfo constructor for the native provider will be in Starlark, then that will be replaced by a purely Starlark provider. We don't want to add public APIs before this happens precisely to avoid running into incompatible changes. |
You say: Unless you mean you're just going to move to a purely Starlark ProtoInfo provider all at once, which will break backwards compatibly with native rules. |
This is a follow up to #10966 to allow users to create a ProtoInfo provider in Starlark. The corresponding issue is #11060
It also allows the native proto_library to have deps and exports that are not proto_library rules.