fix(build): fall back to system protoc

This commit is contained in:
lbl
2026-08-22 23:16:41 +08:00
parent 7675a6868c
commit e216416e21
2 changed files with 21 additions and 8 deletions
+10 -4
View File
@@ -1,10 +1,16 @@
fn main() {
let protoc_path =
protoc_bin_vendored::protoc_bin_path().expect("failed to find vendored protoc");
let mut config = prost_build::Config::new();
config.protoc_executable(protoc_path);
match protoc_bin_vendored::protoc_bin_path() {
Ok(protoc_path) => {
config.protoc_executable(protoc_path);
}
Err(error) => {
println!(
"cargo:warning=vendored protoc unavailable ({error:?}); falling back to protoc from PATH"
);
}
}
config.protoc_arg("--experimental_allow_proto3_optional");
+11 -4
View File
@@ -1,10 +1,17 @@
fn main() {
let protoc_path =
protoc_bin_vendored::protoc_bin_path().expect("failed to find vendored protoc");
let mut config = prost_build::Config::new();
config.protoc_executable(protoc_path);
match protoc_bin_vendored::protoc_bin_path() {
Ok(protoc_path) => {
config.protoc_executable(protoc_path);
}
Err(error) => {
println!(
"cargo:warning=vendored protoc unavailable ({error:?}); falling back to protoc from PATH"
);
}
}
config.protoc_arg("--experimental_allow_proto3_optional");
config
.compile_protos(&["proto/local_ipc.proto"], &["proto"])