rules-proto-grpc / rules_proto_grpc

Bazel rules for building Protobuf and gRPC code and libraries from proto_library targets
https://rules-proto-grpc.com
Apache License 2.0
255 stars 160 forks source link

Add Rust Tonic and Prost support #143

Closed aaliddell closed 1 year ago

aaliddell commented 3 years ago

Either as additional rules or to replace the current rules as breaking change. These are better supported than the current grpcio etc crates and avoid the flakeyness of the current grpc-sys workarounds.

To do this requires that they have protoc plugins, which neither currently have since they share the same builder core. Currently blocked on:

titanous commented 2 years ago

I'm interested in implementing this. I think it would make sense to remove the existing rules and replace them with new rules (that have tonic and prost in the rule names in case other libraries become popular in the future).

aaliddell commented 2 years ago

Do the upstream libraries actually have working protoc plugins yet? There seem to be some external ones, but are these official?

titanous commented 2 years ago

They aren't official but they seem to work fine.

UebelAndre commented 2 years ago

https://github.com/bazelbuild/rules_rust/issues/915#issuecomment-1079742714 may be useful here.

titanous commented 2 years ago

I've made good progress implementing this, but I've run into an issue where the tonic (gRPC) plugin wants to write to the output files from the prost plugin, and I can't see an existing way to make this happen in compile.bzl. Suggestions?

titanous commented 2 years ago

I've implemented this in #202.

aaliddell commented 1 year ago

Closed by #265