-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
Update for new bazel proto API #6163
Conversation
@acozzette think you could review this one? 🙏 |
The Bazel test run is showing this error:
Do you have any ideas on how to fix this? |
It looks like CI is running with a version of bazel that doesn't have this new provider. I don't see what version it's running, do you know? |
The test script is here: https://github.com/protocolbuffers/protobuf/blob/master/kokoro/linux/bazel/build.sh I'm not sure what the Bazel version is but I bet you're right that it's not very recent. Could you try updating that script to add the line |
This fixes issues if you build a `proto_gen` rule with the `--incompatible_disable_legacy_proto_provider` flag that will be enabled with an upcoming bazel release. bazelbuild/bazel#7152
Added that line, I don't see that script but that should "just work" on CI? |
Right, I was thinking that script should be present in the CI environment. I restarted the tests so we'll see if it works. |
Ah the problem has nothing to do with version, it's actually that I haven't changed Lines 169 to 175 in 9690f3f
I'm not sure yet what the replacement is for this, but I'm looking into it |
So I think the I guess this means that this rule should really return 2 providers, and add these variable fields in the second custom provider. But it would be nice to sanity check that approach if you understand what's going on here? |
@keith I am not too familiar with this legacy provider migration, so unfortunately I don't think I have much insight to offer. I would say let's just try your approach and see if it works. |
@lberki do you have any insight on how I should migrate this use case for |
Erm, sorry for the delay. This message got routed to my private e-mail account somehow. Well, I (embarrassingly) don't know much about how Line 170 in 9690f3f
supposed to interoperate with Bazel's internal Does
If you really need to create a /cc @hlopko |
+1 on proto_gen reason d'etre question. Why is it used and not proto_library? |
I can't comment on Keith's requirements, but I want to define a |
@Bocete yup that's where I'm heading, gen_proto has many disadvantages that proto_library doesn't have. If there are limitations to proto_library that prevented its use I'd like to know (and fix them in the proto_library). @acozzette Do you remember what was the problem with proto_library that forced you to go the gen_proto way? |
@hlopko I am not very familiar with this file, so I am not sure of the history of it or why we went with gen_proto. Unfortunately I think the people who did the most work on this code are no longer working on protobuf. It seems quite possible that there's no longer a good reason for using gen_proto instead of proto_library, so we could perhaps try going in that direction and see if it works. |
@hlopko my usecase is not as simple as using a I want to create my own, non-native rule that produces Why am I doing this: I'm developing a non-trivial system definition rule suite. The system would be composed of components. I wish for components in the system to be able to optionally point at various This may be done using macros (e.g. each component Anyhoo, that's an example of why one would want to avoid defining a |
@Bocete can you submit a issue on bazel to track this? |
After looking at this rule I think someone more familiar with how this is used is going to have to make this change, since I think it will be rather large and well tested. |
I suspect that Bazel #6901 should address this |
This fixes issues if you build a
proto_gen
rule with the--incompatible_disable_legacy_proto_provider
flag that will be enabledwith an upcoming bazel release. bazelbuild/bazel#7152