Skip to main content
Voltaire orchestrates native, WASM, C, and Rust compilation through root build.zig, and JavaScript/TypeScript bundling through pnpm workspaces (pnpm@10.26.2, tsup, and tsc).

Zig Build Steps (build.zig)

Run all Zig commands from the repository root.

Core Build and Optimization Modes

Native FFI and WASM Artifacts

Code Generation & Examples

Test & Quality Steps in build.zig

build.zig has no test filter option. Its format, format-check, check, ci, and pre-commit steps are broken (zig build format and root pnpm format recurse forever), so format and check with the tools directly:

pnpm Workspace Scripts

Root package.json runs across all workspace packages; package-scoped commands use --filter:

Cross-Compilation

Zig cross-compiles native and WASM targets out of the box (Rust targets require the corresponding rustup target add toolchain):

Common Build Failures

  • Missing vendored C libraries (blst / c-kzg-4844): Run git submodule update --init --recursive (or check submodules exist under packages/voltaire-zig/lib/).
  • Missing Cargo / Rust target: build.zig invokes cargo for crypto_wrappers (BN254 + Keccak assembly). Install Rust via rustup and add cross-targets if cross-compiling.
  • Node heap OOM during TS build: packages/voltaire-ts/package.json sets NODE_OPTIONS=--max-old-space-size=8192 for build:dist and build:types. Keep that flag if invoking tsup or tsc directly.
  • Architecture — Module dependency graph
  • WASM — WASM compilation modes and browser bundler setup
  • Testing — Running and writing Zig and Vitest test suites