fn main() { capnpc::CompilerCommand::new() .file("schema/memory.capnp") .run() .expect("capnp compile failed (memory.capnp)"); capnpc::CompilerCommand::new() .file("schema/daemon.capnp") .run() .expect("capnp compile failed (daemon.capnp)"); capnpc::CompilerCommand::new() .file("schema/channel.capnp") .run() .expect("capnp compile failed (channel.capnp)"); // Generate salience.v1 gRPC client + message types from proto. // Server side (python) is generated separately via grpcio-tools. // Use vendored protoc so we don't require a system install. let protoc = protoc_bin_vendored::protoc_bin_path() .expect("vendored protoc not available for this platform"); // SAFETY: build script is single-threaded at this point; setting env // before invoking tonic_build is the documented way to point it at a // non-PATH protoc. unsafe { std::env::set_var("PROTOC", protoc); } tonic_build::configure() .build_server(false) .build_client(true) .compile_protos(&["proto/salience.proto"], &["proto"]) .expect("tonic_build compile failed (salience.proto)"); println!("cargo:rerun-if-changed=proto/salience.proto"); }