ADR-0004: Building wgpu-native from source through CMake
Status: Accepted, 2026-11-08
Context #
The mission requires every dependency to be vendored as a submodule and built from source with CMake
in native/. wgpu-native is a Rust crate (cargo build) that exposes webgpu.h and wgpu.h. It
cannot be compiled by CMake directly.
Decision #
third_party/wgpu-nativeis pinned to tagv29.0.1.1.native/CMakeLists.txtadds anExternalProjectstep that invokescargo build --release --lockedin the submodule using the Rust toolchain pinned by the submodule's ownrust-toolchain.toml(or, when absent at that tag, the version recorded indocs/TOOLCHAIN.md), with--lockedso the vendoredCargo.lockis authoritative. The producedlibwgpu_native.{so,dylib}and the two headers are installed into the native build tree and linked bylibcinder_native.- Prebuilt release binaries from GitHub are not used, so that the exact source is auditable and sanitizer or debug builds can be produced when needed.
Consequences #
- The Linux CI image and the macOS runner need
rustup; the docker toolchain image installs it. - Build time for wgpu-native (several minutes cold) is cached in CI by
target/hash ofCargo.lock. - This is the only non-CMake build step in the tree, and it is driven by CMake, which satisfies the
intent of the rule: one
cmake --buildbuilds all native code.