grpc icon indicating copy to clipboard operation
grpc copied to clipboard

Google protobuf struct in include folder generation for elixir

Open azzahidK opened this issue 3 years ago • 3 comments
trafficstars

Description So I am trying to use grpc in elixir for calling from golang based grpc server using shared proto file. I realized that after doing the command below: protoc --proto_path=./<path-to-proto-folder>/ --elixir_out=plugins=grpc:./gen/grpc kargo-protobuff/company_service/*.proto

It doesn't automatically generate the google/struct.proto that is included in the $PROTO_PATH/include folder. And it caused an error.

Right now i am generating it manually but there is a need to move the include folder because there is a conflict when i try to generate it.

Question: Is there a way to generate the dependency in include folder automatically ?

azzahidK avatar Oct 12 '22 04:10 azzahidK

This seems like an issue with the upstream protobuf library.

Although perhaps @sleipnir or @wingyplus can help answer the question

polvalente avatar Oct 12 '22 17:10 polvalente

As far as i know, the protobuf library doesn’t compile but just do only generate a type in your proto file. So you need to compile includes proto file by yourself.

In this case, you’re using google struct, you may use https://github.com/elixir-protobuf/google-protos which’s generated google probuffer code, you may need to use it as git dependency since it didn’t publish for a while.

wingyplus avatar Oct 14 '22 06:10 wingyplus

As far as I know it's not possible to do that. You need to compile all dependencies individually. Only well-known types are automatically resolved.

sleipnir avatar Oct 14 '22 16:10 sleipnir