โ† All docs  ยท  Home

ADR 0019 โ€” Deployment: musl static binaries, RocksDB durable backend, release pipeline

Context

The M10 core shipped a multi-stage Dockerfile (in-memory Oxigraph โ†’ no Clang/RocksDB), docker compose, and Pages serving the @context/ontology at stable URLs. Three items were explicitly deferred: a static x86_64-unknown-linux-musl build, a durable RocksDB backend, and a tagged release pipeline that publishes artifacts.

Decision

Static musl binaries via cargo-zigbuild

The release and CI builds target x86_64-unknown-linux-musl with cargo-zigbuild, which uses zig as the C cross-compiler. The only C in the default build is ring (rustls's crypto); every backend is otherwise pure Rust (in-memory Oxigraph) and every HTTP client is rustls, not OpenSSL (verified: no openssl-sys/native-tls in Cargo.lock). So a single fully static binary links with no glibc, no OpenSSL, and no RocksDB โ€” it runs on any x86-64 Linux. cargo-zigbuild was chosen over a musl-gcc cross toolchain because zig bundles the cross sysroot and handles ring cleanly with zero host setup.

A musl job is added to ci.yml so the target stays green and a tag never fails to cut; release.yml reuses it to produce the artifacts.

Durable RocksDB backend as an opt-in feature

oxigraph's on-disk store (Store::open) is gated behind its rocksdb feature (pulls oxrocksdb-sys, a C/C++ build). We expose it as:

The feature is opt-in, never default: it requires a C/C++ toolchain and is native-only (never wasm). The lightweight "one-command demo" image stays in-memory + snapshot (ADR 0008), so the common path needs no Clang.

Tagged release pipeline

release.yml triggers on v* tags: one job builds the musl binaries, one builds the wasm package (protocol core + cli-client + bundled ontology), and a third publishes both (with .sha256 sums) to the GitHub Release via softprops/action-gh-release. workflow_dispatch builds the artifacts without publishing, as a smoke test.

Consequences