Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/dwarves

crates/nornir-warehouse-embed/build.rs

// build.rs — compile the trimmed `proto/*.proto` into a prost+tonic CLIENT (plus a
// server binding, so the crate's own tests can stand up mocks). Pure-Rust codegen
// (the nordisk zero-shell charter): `protox` parses the .proto files into a
// FileDescriptorSet, then `tonic-build` emits the bindings — no `protoc` binary, no
// C. Mirrors `nornir-funnel-embed`.

fn main() {
    println!("cargo:rerun-if-changed=proto/telemetry.proto");
    println!("cargo:rerun-if-changed=proto/workspaces.proto");
    println!("cargo:rerun-if-changed=proto/warehouse.proto");
    println!("cargo:rerun-if-changed=proto/mimir.proto");
    println!("cargo:rerun-if-changed=proto/bench.proto");
    println!("cargo:rerun-if-changed=proto/viz.proto");
    println!("cargo:rerun-if-changed=proto/coderoom.proto");
    println!("cargo:rerun-if-changed=build.rs");

    let fds = protox::compile(
        [
            "proto/telemetry.proto",
            "proto/workspaces.proto",
            "proto/warehouse.proto",
            "proto/mimir.proto",
            "proto/bench.proto",
            "proto/viz.proto",
            "proto/coderoom.proto",
        ],
        ["proto"],
    )
    .expect(
        "protox: compile telemetry.proto + workspaces.proto + warehouse.proto + mimir.proto \
         + bench.proto + viz.proto + coderoom.proto",
    );

    // Client for the real submit/read paths; server binding too, so the crate's own
    // integration tests can stand up MOCK `Telemetry` / `Workspaces` / `Warehouse` /
    // `Mimir` servers and assert the wire end-to-end (mirroring nornir's
    // `tests/data_submit_rpcs.rs`).
    tonic_prost_build::configure()
        .build_server(true)
        .build_client(true)
        .compile_fds(fds)
        .expect("tonic-build: codegen");
}