You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to do this within build.rs - something like:
fnmain() -> Result<(),Box<dyn std::error::Error>>{
protobuf_codegen::Codegen::new()// Use `protoc` parser, optional..protoc()// Use `protoc-bin-vendored` bundled protoc command, optional..protoc_path(&protoc_bin_vendored::protoc_bin_path().unwrap())// All inputs and imports from the inputs must reside in `includes` directories.// Inputs must reside in some of include paths..protoc_extra_arg("--descriptor_set_in=protos/dish.protoset").includes(&["spacex/api/device"]).input("spacex/api/device/device.proto")// Specify output directory relative to Cargo output directory..cargo_out_dir("protoout").run_from_script();Ok(())}
However, doing so yields this output:
Compiling rusty-space-dish v0.1.0 (/home/justin/git/rusty-space-dish)
error: failed to run custom build command for `rusty-space-dish v0.1.0 (/home/justin/git/rusty-space-dish)`
Caused by:
process didn't exit successfully: `/home/justin/git/rusty-space-dish/target/debug/build/rusty-space-dish-ecceed33977cb51e/build-script-build` (exit status: 1)
--- stderr
spacex/api/device: warning: directory does not exist.
Could not make proto path relative: spacex/api/device/device.proto: No such file or directory
codegen failed: parse and typecheck
Caused by:
0: using protoc parser
1: protoc command "/home/justin/.cargo/registry/src/github.com-1ecc6299db9ec823/protoc-bin-vendored-linux-x86_64-3.0.0/bin/protoc" "-Ispacex/api/device" "--descriptor_set_out=/tmp/protobuf-parseHkQe9P/descriptor.pbbin" "--include_imports" "spacex/api/device/device.proto" exited with non-zero code
My extra arg to protoc was not passed in according to cause #1.
The text was updated successfully, but these errors were encountered:
All right. Almost one year ago. I had the same issue and found that the protobuf-codegen/src/codegen/mod.rs doesn't apply extra args. A temporary way is adding the following code at line 144:
parser.protoc_extra_args(&self.protoc_extra_args);///<-- add this code to apply extra args.
parser.inputs(&self.inputs);
parser.includes(&self.includes);
Context on the situation: I have a Starlink that provides a
.protoset
file from this command:...and I would like to interact with the Starlink gRPC through Rust through the protoset it provides.
With
cargo install protobuf-codegen
, I can generatedevice.rs
andmod.rs
files no problem:I'd like to do this within
build.rs
- something like:However, doing so yields this output:
My extra arg to
protoc
was not passed in according to cause #1.The text was updated successfully, but these errors were encountered: