containerd / ttrpc-rust

Rust implementation of ttrpc (GRPC for low-memory environments)
Apache License 2.0
197 stars 47 forks source link

Well known proto support #168

Open powturns opened 1 year ago

powturns commented 1 year ago

When running Codegen on a proto file that relies on google's well known types (eg: google.protobuf.Timestamp / import "google/protobuf/timestamp.proto"), an error is thrown:

thread 'main' panicked at 'Gen code failed.: Custom { kind: Other, error: "protobuf path \"google/protobuf/timestamp.proto\" is not found in import path [\"src/protocols/protos\"]" }', build.rs:35:10

It appears this is because ttrpc_compiler::codegen isn't aware of these types, so it has trouble parsing the proto file. However, protobuf_codegen, which is responsible for generating the message classes handles the well known types without any problems. I suspect ttrpc_compiler doesn't actually need to know about the common types as it seems to be mostly interested in generating the RPC stubs.