tower-grpc
tower-grpc copied to clipboard
No substitutions for well-known types
Prost substitutes protobuf well-known types, but because tower-grpc-build's Config::generate doesn't use prost's built-in Config::generate, those substitutions never occur. As a result, protobufs that use well-known types will fail to compile with tower-grpc-build, producing errors like this:
error[E0433]: failed to resolve: maybe a missing `extern crate google;`?
--> /Users/yusuf/work/pachyderm/target/debug/build/pachyderm-20082e160c80a681/out/pfs_1_7.rs:930:123
|
930 | pub fn get_tag<R>(&mut self, request: grpc::Request<Tag>) -> grpc::server_streaming::ResponseFuture<super::super::google::protobuf::BytesValue, T::Future>
| ^^^^^^ maybe a missing `extern crate google;`?
As a workaround, I'm replacing references to super::super::google::protobuf::... with their equivalents in our build.rs.
I think this may be the same #81? It seems like a good idea to allow configuring the usage of well known types.
@seanmonstar I'm not sure. It seems that in #81 the substitution is kinda-sorta happening for a well-known type, which suggests that my assumption about substitutions not working is wrong.