2025-08-19 23:24:36 -07:00
|
|
|
fn main() {
|
2025-08-22 10:44:56 -07:00
|
|
|
println!("cargo:rerun-if-changed=proto/processes.proto");
|
2025-08-19 23:24:36 -07:00
|
|
|
|
|
|
|
|
// Compile protobuf definitions for processes
|
|
|
|
|
let mut cfg = prost_build::Config::new();
|
|
|
|
|
cfg.out_dir(std::env::var("OUT_DIR").unwrap());
|
2026-08-21 12:45:10 -07:00
|
|
|
// Vendored protoc for reproducible builds where available. It ships no
|
|
|
|
|
// riscv64 binary, so on such hosts fall through to $PROTOC / PATH
|
|
|
|
|
// (prost-build's default lookup) — apt: protobuf-compiler.
|
|
|
|
|
if let Ok(protoc) = protoc_bin_vendored::protoc_bin_path() {
|
|
|
|
|
cfg.protoc_executable(protoc);
|
|
|
|
|
}
|
2025-08-22 10:44:56 -07:00
|
|
|
// Use local path (ensures file is inside published crate tarball)
|
|
|
|
|
cfg.compile_protos(&["proto/processes.proto"], &["proto"]) // relative to CARGO_MANIFEST_DIR
|
2025-08-19 23:24:36 -07:00
|
|
|
.expect("compile protos");
|
|
|
|
|
}
|