Set up native builds
On this page
maligator build compiles Maligator's C runtime and Rust crate together with your application, so it needs a native toolchain on the build host. run, dev, and test use the runtime embedded in the distributed CLI for supported profiles with Intl, profiling, and C libraries disabled. The executables you build do not need these tools.
Install the requirements
- A C compiler and archive tool with C23 support: Apple clang, clang 19 or newer, or gcc 15 or newer. gcc 14 and older accept
-std=c2xbut lack#embed, sodoctorrejects them. - Rustup. Maligator builds its runtime with the Rust toolchain pinned by that runtime.
- A C++ compiler and runtime when
surface.webPlatformorsurface.nodeis enabled.
On macOS, Apple's command-line tools provide the C and C++ compilers:
xcode-select --installOn Linux, install a C23-capable compiler from your distribution. When its default gcc is older than 15, install clang 19 or newer and select it for Maligator. For example, on Ubuntu 26.04:
sudo apt install clang-21
export CC=clang-21 CXX=clang++-21Install Rust through Rustup on both platforms.
Check the toolchain
maligator doctor --verbosedoctor reports resolved paths, versions, C and Rust targets, tested capabilities, and probe-cache status, plus suggested fixes for anything missing. Every native build runs the same checks, so running doctor first is optional. CC and CXX override compiler selection; otherwise tools are resolved strictly from PATH.
Cross-build for another target
Pass a Rust target triple to build to cross-compile through Zig. Supported targets:
aarch64-apple-darwinx86_64-apple-darwinaarch64-unknown-linux-gnux86_64-unknown-linux-gnu
Install Zig on PATH (or point ZIG at it), add the Rust standard library for the target, and validate both halves before building:
rustup target add x86_64-unknown-linux-gnu
maligator doctor --target x86_64-unknown-linux-gnu --verbose
maligator build --production --target x86_64-unknown-linux-gnuZig provides the C and C++ compilers, archive tool, and linker for the target. maligator run always targets the build host. Test a cross-built executable on its intended host; see Build for production.