-
Notifications
You must be signed in to change notification settings - Fork 70
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
Support --include_imports equivalent in proto_library #57
Comments
Our internal solution for this, so far, is a tiny Skylark rule which concatenates the individual descriptors (protobuf's wire format allows for that) and exposes a single file. Then we wrap a I can run the code through the open-sourcing process and publish it, but really it's no more than |
I'm doing the same thing, but I couldn't figure out how to get the result to be treated like or usable in a native |
When I invoke @iirina, WDYT? Would it just be a matter of adding We need such a descriptor set for deploying to Service Management and if I understand right, this would also be useful for @djudd-stripe. Additionally, from protocolbuffers/protobuf#2725, it sounds like @cgrushko was interested in using this with |
My objection to My solution from https://github.com/bazelbuild/bazel/issues/4201#issuecomment-348673194 is really the way to go if you need to collect all transitive descriptors at a single point.
@djudd-stripe 's use case is special because he's trying to bridge two build systems. There's the possibility of controlling this using a configuration-wide option in Blaze, but we should be careful not to turn Bazel into a swamp of options. |
@cgrushko Thanks for the explanation! That's a good reason not to make it the default. We currently have a Skylark rule that converts EDIT: I found out that |
@cgrushko, you mentioned that Google's workaround may be open-sourced: is there any progress there / has this already happened? |
not that I know of - and I'm no longer at Google, so can't help :|
It should be relatively straightforward - use ctx.actions.run_shell() [1]
with command = 'cat ' + ' '.join(filenames) + ' > ' + output_filename
(output_filename should be also used in declare_file [2] to declare that
this rule produces this file)
or something like that.
[1] -
https://docs.bazel.build/versions/master/skylark/lib/actions.html#run_shell
[2] -
https://docs.bazel.build/versions/master/skylark/lib/actions.html#declare_file
…On Tue, Jun 19, 2018 at 3:39 PM Robin Nabel ***@***.***> wrote:
@cgrushko <https://github.com/cgrushko>, you mentioned that Google's
workaround may be open-sourced: is there any progress there / has this
already happened?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/bazelbuild/bazel/issues/4201#issuecomment-398423104>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB5_YRh1Jldl5Hl3UMpRqjFgHv9_gWTSks5t-Q0dgaJpZM4QxNke>
.
|
@RNabel Here's what we're using:
You can then use it like:
|
Thanks both for the super-fast response - really useful! |
Thanks, that's awesome! |
Thanks! PSA - for anybody using this rule
will no longer work with bazel 1.0.0 Replacing with
is compliant it seems |
@krlvi, thanks for pointing this out, I've updated the comment. |
In bazel 1.2.1, you will need |
It seems like this is resolved for now, but there could be some docs around it. |
Description of the feature request:
We would find it useful to have an attribute on the native
proto_library
rule which causes it to behave like protoc when passed--include_imports
, which would include all the transitive descriptor set contents in the output descriptor set. Supporting self-contained descriptor set outputs in this way would make it easier to write tooling that uses descriptor sets as the import/export unit for passing schemas between repos, which in our setting are not always built with Bazel, and it would bring the rule closer to feature parity with using protoc directly.The text was updated successfully, but these errors were encountered: