-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support single include file #745
Comments
I have the same errors. It actually seems like at least some of them are coming from mod hashicorp {
mod nomad {
pub mod plugins {
pub mod drivers {
include!(concat!(env!("OUT_DIR"), "/hashicorp.nomad.plugins.drivers.proto.rs"));
}
}
pub mod shared {
pub mod hclspec {
include!(concat!(env!("OUT_DIR"), "/hashicorp.nomad.plugins.shared.hclspec.rs"));
}
pub mod structs {
include!(concat!(env!("OUT_DIR"), "/hashicorp.nomad.plugins.shared.structs.rs"));
}
}
}
} |
There is a google protobuf example. I believe using the new feature from prost-build to generate a single include file should fix a lot of this. We can look into adding similar support into tonic. |
It did for me 😸 |
I'm running into similar issues. I've synced a subset of the googleapis repo into the fn main() {
tonic_build::configure()
.build_server(false)
.compile(
&["proto/googleapis/google/cloud/secretmanager/v1/service.proto"],
&["proto/googleapis"],
).unwrap();
} However, this ends up with up to four (I think this is the same thing as #767?) |
The feature should be supported on the latest tonic? |
Okay, yes, I got that to work. Not sure why this isn't/couldn't be the default? Also might be nice to extend the documentation to mention that you might want to use something like |
For others reading this issue looking for a workaround, the thing that worked for me specifically when consuming google cloud protos was to add |
For what it's worth, I wrote some code for opentelemetry-stackdriver that uses an integration test to drive code generation and generate it into a neat module hierarchy inside you're crate's |
@djc thank you very much for generating the opentelemetry-proto. I just did not get it to work for the opentelemetry trace collector stuff. Now I can just use your module. It's my first rust project so perhaps that's why I do not get it to work even with the hints here. But I have the feeling that gRPC code generation is a lot easier when I'm developing in python or golang. |
For anyone trying to follow those links, opentelemetry-stackdriver has been moved to the opentelemetry-rust-contrib repo. Updated links (unfortunately not permalinks): |
tonic-build
: 0.5.2Trying to use googleapi. Google api proto files are in their own directory within the project
projectname/protos
.projectname/
projectname/protos
projectname/src
projectname/src/speech
projectname/build.rs
projectname/target
etc
cargo build
and the .rs files are generated insrc/speech
. Now the problem.The text was updated successfully, but these errors were encountered: