-
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
Please document proto_library providers #3527
Comments
Maybe relatedly, it doesn't appear possible to return these providers from a custom rule. To specify that a rule accepts |
@djudd-stripe for this to work, we need to expose ProtoSourceProvider [1] to Skylark. I haven't done something like this, but in general it means adding a function to a top-level Skylark module. It's straightforward but we never got around to doing this. This will allow you to write a custom |
Thanks for the response! We've written custom proto_library-equivalent rules to get features like those requested in https://github.com/bazelbuild/bazel/issues/4201 and #3867 Another use case involves tooling for passing schema definitions between repos. Our implementation involves uploading proto descriptor sets to a shared blob store in a build step, and then downloading them for import at build time elsewhere. Often the import uses Bazel, and it would be nice to be able to use those descriptor sets like native proto_libraries without assuming the exporting repo also uses Bazel. The current workaround here is to turn the descriptor sets back to .proto files using the C++ library's DebugString in a repository rule, but that's fairly awkward (especially because it requires pre-preparing a compiled binary unless/until #4069 is implemented). |
I'd be happy to take on implementing this sometime in the next few weeks, but might need some support. |
@brandjon for help in exposing provider instantiation to Skylark. |
It turns out that there's already a ticket that actually covers the ask I made in the comment here: #3701 |
Closing because https://docs.bazel.build/versions/master/skylark/lib/ProtoInfo.html exists now. |
From reading the source it seems there exist Skylark providers for
proto_library
targets (ProtoSourcesProvider
andProtoSupportDataProvider
), but the documentation on built-in providers (https://docs.bazel.build/versions/master/skylark/lib/skylark-provider.html) doesn't mention them. Please document these providers.Even a brief overview such as https://docs.bazel.build/versions/master/skylark/lib/JavaSkylarkApiProvider.html would be very useful.
The text was updated successfully, but these errors were encountered: