Files
socktop/socktop_agent/build.rs
T

17 lines
751 B
Rust
Raw Normal View History

2025-08-19 23:24:36 -07:00
fn main() {
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());
// 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);
}
// 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");
}