Re: [protobuf] Generating a api descriptor proto in bazel for a grpc service

2018-02-08 Thread Marquis Taliaferro
This is my observation as well.  I assumed it was the proto team as at
least a collaborator in designing the rules but will ask the team. After
looking at the source code my conclusion was that not enough was exposed to
the yet to do this without just calling the compiler directly but figured I
would ask the experts.

On Thu, Feb 8, 2018 at 4:27 PM Feng Xiao  wrote:

> On Wed, Feb 7, 2018 at 7:14 PM, Marquis Taliaferro <
> marquis.taliafe...@gmail.com> wrote:
>
>> Is there a way to generating a api descriptor proto in bazel for a grpc
>> service.  I dont mind writing my own rule but i would prefer not to just
>> use a genrule for this.  What im trying to do is described here
>> 
>>  in
>> step 1.
>>
>> So basically given a proto_library rule like this
>>
>> proto_library(
>> name = "user_proto",
>> srcs = ["user.proto"],
>> deps = [
>> ":error_proto",
>> "//src/main/proto/overloaded/common:common_proto",
>>  "@googleapi//:annotations_proto"]
>> )
>>
>> how would i generate a descriptor proto that is equivalant to being
>> generated on the commend line such as
>>
>> protoc \
>> *--include_imports \*
>> *--include_source_info \*
>> --proto_path=. \
>> --descriptor_set_out=api_descriptor.pb \
>> user.proto
>>
>> If there are some docs that im missing that could help that would also be
>> very appreciated.
>>
>
> I think the bazel folks may answer this question better since they
> implemented the proto_library rule in bazel. You can post the question
> there as well. As I remember, the proto_library rule already produces a
> descriptor output but only for the proto in "srcs". So when you build
> "user_proto", a descriptor file for user.proto is produced but not with
> "include_imports", nor with "include_source_info". See:
> https://github.com/bazelbuild/bazel/issues/4201#issuecomment-348673194
> https://github.com/bazelbuild/bazel/issues/4201#issuecomment-351055194
>
>
>>
>> Thanks,
>> Marquis
>>
> --
>> You received this message because you are subscribed to the Google Groups
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to protobuf+unsubscr...@googlegroups.com.
>
>
>> To post to this group, send email to protobuf@googlegroups.com.
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Generating a api descriptor proto in bazel for a grpc service

2018-02-08 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Feb 7, 2018 at 7:14 PM, Marquis Taliaferro <
marquis.taliafe...@gmail.com> wrote:

> Is there a way to generating a api descriptor proto in bazel for a grpc
> service.  I dont mind writing my own rule but i would prefer not to just
> use a genrule for this.  What im trying to do is described here
> 
>  in
> step 1.
>
> So basically given a proto_library rule like this
>
> proto_library(
> name = "user_proto",
> srcs = ["user.proto"],
> deps = [
> ":error_proto",
> "//src/main/proto/overloaded/common:common_proto",
>  "@googleapi//:annotations_proto"]
> )
>
> how would i generate a descriptor proto that is equivalant to being
> generated on the commend line such as
>
> protoc \
> *--include_imports \*
> *--include_source_info \*
> --proto_path=. \
> --descriptor_set_out=api_descriptor.pb \
> user.proto
>
> If there are some docs that im missing that could help that would also be
> very appreciated.
>

I think the bazel folks may answer this question better since they
implemented the proto_library rule in bazel. You can post the question
there as well. As I remember, the proto_library rule already produces a
descriptor output but only for the proto in "srcs". So when you build
"user_proto", a descriptor file for user.proto is produced but not with
"include_imports", nor with "include_source_info". See:
https://github.com/bazelbuild/bazel/issues/4201#issuecomment-348673194
https://github.com/bazelbuild/bazel/issues/4201#issuecomment-351055194


>
> Thanks,
> Marquis
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Generating a api descriptor proto in bazel for a grpc service

2018-02-07 Thread Marquis Taliaferro
Is there a way to generating a api descriptor proto in bazel for a grpc 
service.  I dont mind writing my own rule but i would prefer not to just 
use a genrule for this.  What im trying to do is described here 

 in 
step 1.

So basically given a proto_library rule like this

proto_library(
name = "user_proto",
srcs = ["user.proto"],
deps = [
":error_proto",
"//src/main/proto/overloaded/common:common_proto",
 "@googleapi//:annotations_proto"]
) 

how would i generate a descriptor proto that is equivalant to being 
generated on the commend line such as

protoc \
*--include_imports \*
*--include_source_info \*
--proto_path=. \
--descriptor_set_out=api_descriptor.pb \
user.proto

If there are some docs that im missing that could help that would also be 
very appreciated.

Thanks,
Marquis 

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.