Description
Feature Request
Would be very useful to be able to use tonic as a plugin for protoc. We are currently trying to coordinate our .proto files using a dedicated repo and use CI to generate the code. for our other languages we can use protoc (or actually buf/build which is a drop in replacement for protoc).
Having a protoc plugin would make it much easier to integrate tonic with other tooling.
I have made a naive attempt at creating a protoc-plugin by using tonic_build
to generate files to a tmp directory and reading those.
Althoug a bit clunky it worked, but i dont think its an ideal solution
- Generating files and reading them is a bit of a workaround (due to my lacking knowledge of rust and tonic)
- It has several runtime dependencies that make the container very bloated (protoc is used under the hood for the prost part i believe)
- rustfmt is a runtime dependency requiring the rust toolchain in the container.
I think tooling for generating and sharing protobuf/grpc implementations is getting more prevalent, so i think having a protoc-plugin would be valuable, and i would be happy to dig in and contribute to that, im curious if that is already somthing that is being considered and/or welcomed.