Skip to content
CommonLayer
Documentation menu
On this page

ADR-0013: protox compiles protobuf definitions in build.rs

Status: Accepted (plan decision D13). Implemented: proto/commonlayer/v1/*.proto compile through crates/commonlayer-proto/build.rs (amended 2026-11-10).

Context

Tonic's usual code generation calls the system protoc binary, which is an extra, version-sensitive build dependency on every developer machine and CI image.

Decision

Compile proto/commonlayer/v1/*.proto with protox (a pure-Rust protobuf compiler) inside build.rs and feed the descriptors to the Tonic/Prost generators.

Consequences

  • cargo build works without protoc.
  • WP-01 verified the build integration once with a temporary probe file (since removed); the real service definitions arrive with the gRPC work package.

Amendment, 2026-11-10

  • The service definitions exist since WP-41 (proto/commonlayer/v1/, 13 files); the descriptor set also feeds server reflection. buf lint and, on pull requests, buf breaking run in CI (.github/workflows/ci.yml, job protobuf).