Bug Report
Version
$ cargo tree | grep -e tonic -e prost
├── prost v0.10.0
│ └── prost-derive v0.10.0 (proc-macro)
├── prost-types v0.10.0
│ └── prost v0.10.0 (*)
└── tonic v0.7.1
├── prost v0.10.0 (*)
├── prost-derive v0.10.0 (proc-macro) (*)
├── tonic-build v0.7.0
│ ├── prost-build v0.10.0
│ │ ├── prost v0.10.0
│ │ │ └── prost-derive v0.10.0 (proc-macro) (*)
│ │ ├── prost-types v0.10.0
│ │ │ └── prost v0.10.0 (*)
Platform
Fedora release 35 (Thirty Five)
Linux 5.16.16-200.fc35.x86_64
Crates
Description
After updating to tonic{,-build} v0.7 and prost{,-types} v0.10 cargo build fails with
error: couldn't read /.../target/debug/build/.../out/google.protobuf.rs: No such file or directory (os error 2)
--> /.../target/debug/build/.../out/grpc_api_mod.rs:3:9
|
3 | include!("google.protobuf.rs");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
error: could not compile `...` due to previous error
build.rs calls:
fn gen_grpc_srv(include_file: &str, protos: Vec<String>) -> Result<(), Box<dyn std::error::Error>> {
let proto_path = env::var("OUT_DIR").unwrap() + "/proto";
tonic_build::configure()
.build_server(true)
.include_file(&include_file)
.compile(&protos, &[proto_path])?;
Ok(())
}
The google.protobuf.rs isn't available in the target directory:
$ find target -name google.protobuf.rs | wc -l
0
Using tonic-build's .compile_well_known_types(true) instead of prost-types works.
Bug Report
Version
Platform
Fedora release 35 (Thirty Five)Linux 5.16.16-200.fc35.x86_64Crates
Description
After updating to tonic{,-build} v0.7 and prost{,-types} v0.10 cargo build fails with
build.rs calls:
The
google.protobuf.rsisn't available in the target directory:Using tonic-build's
.compile_well_known_types(true)instead of prost-types works.