zccache 1.12.2

Local-first compiler cache for C/C++/Rust/Emscripten
Documentation
fn main() {
    println!("cargo:rerun-if-changed=build.rs");
    compile_zccache_wire_proto();

    // Expose the build's target triple at runtime so `zccache symbols install`
    // can construct the matching GitHub Release asset URL without asking the
    // user to type it. `TARGET` is set by cargo for build scripts.
    let target = std::env::var("TARGET").expect("cargo sets TARGET for build scripts");
    println!("cargo:rustc-env=ZCCACHE_BUILD_TARGET={target}");
}

fn compile_zccache_wire_proto() {
    println!("cargo:rerun-if-changed=proto/zccache_v1.proto");

    let protoc = protoc_bin_vendored::protoc_bin_path()
        .expect("vendored protoc is available for zccache wire protobufs");
    std::env::set_var("PROTOC", protoc);

    prost_build::Config::new()
        .compile_protos(&["proto/zccache_v1.proto"], &["proto"])
        .expect("zccache wire protobufs compile");
}