Building from Source
Clone the engine and build the editor, the game runtime and the plugin SDK for the machine you are sitting at.
Build for your own machine with cargo renzora. It is an ordinary native Cargo build: no Docker, no images, no container. Docker is for one job, cross-compiling for platforms you do not own.
Stuck on a build? Ask in the development chat on Discord: https://discord.gg/9UHUGUyDJv.
Why native is enough
The host binary, the editor image and every installed plugin must share one compiled copy of Bevy and of the contract crates. Building everything from source in one environment gives you that by construction, and rust-toolchain.toml pins the same rustc the toolchain images use, so a native build matches a container build.
Native plugins remove the last reason to want a canonical build environment: they ship as source and are compiled on the machine that installs them, against an SDK cut from the engine sitting beside them. When the engine moves, a plugin's content-hash stamp stops matching and it rebuilds itself. There is no environment to match, because a plugin is always built in the one it will run in.
Prerequisites
- Git.
- Rust via rustup.
rust-toolchain.tomlpins the version (currently 1.100.0), so rustup installs and selects it on the first build. Nightly is not needed. - Your platform's native build tools. On Windows, the Visual Studio Build Tools (the MSVC target's C compiler and the Windows SDK). On macOS, the Xcode command line tools. On Linux, a C toolchain plus
clang,moldand the X11, Wayland, ALSA and udev development headers.
On Linux, cargo renzora checks for the packages it needs before it builds and installs any that are missing with your distribution's package manager (apt, dnf, pacman or zypper; sudo asks for your password). Set RENZORA_NO_AUTO_INSTALL=1 to have the install command printed instead. On NixOS it prints a nix-shell -p ... line, because NixOS has no imperative install.
You do not need Docker for anything on this page.
Clone and build
git clone https://github.com/renzora/engine.git
cd engine
cargo renzora dist
cargo renzora dist compiles the workspace and stages a complete, runnable engine into dist/<platform>/ (for example dist/windows-x64/). Run it from the repository root: the alias finds xtask by a relative path. The first build takes a while because Bevy is large; later builds are incremental.
To build and then launch the editor in one step, use plain cargo renzora. Both build and stage exactly the same thing; the plain form only adds the launch.
What a build does
Every cargo renzora build runs the same steps, in order:
- Sync the plugin wiring. Regenerates the committed plugin lists from every crate's
[[package.metadata.renzora.plugin]]tables (see Architecture). - Check Bevy's source. Fails if anything in the build graph pulls a Bevy crate from crates.io instead of
bevy/orvendor/, and names the crate that did. Two Bevys in one program build fine and corrupt theWorldat run time, so this is caught before the compile. - Compile with
cargo build --profile dist --workspace(minus the mobile crates and the companion, which is built on its own). The exact command is printed as[xtask] cargo build .... - Stage
dist/<platform>/: therenzoraexecutable, the editor image beside it, the shared images it imports (bevy_dylib,renzora_dyliband the Rust standard library), the companion (renzora-companion) and the update sidecar (renzora-update). - Cut the plugin SDK into
dist/<platform>/sdk/, from cargo's own record of what it built. - Compile installed plugins. If
dist/<platform>/plugins/holds any, the staged binary compiles the stale ones (renzora --build-plugins), so the editor does not have to on its next launch. A plugin that fails is reported and skipped; the build still succeeds.
A bare cargo run or cargo build does step 3 only. The binary then cannot start, because the shared images it links by name are scattered through target/dist/ instead of sitting beside it.
The dist profile, and only the dist profile
Every cargo command in this repository takes --profile dist, or goes through cargo renzora. A bare cargo build, check, clippy or test uses the dev profile and creates a second full set of artefacts under target/debug/. This workspace is far too large for two of them.
cargo renzora dist # build + stage, the normal way to work
cargo check --profile dist -p <crate> # fast gate while editing one crate
cargo clippy --profile dist -p <crate> # lint one crate
cargo test --profile dist -p <crate> # test one crate, natively
A full disk does not fail cleanly. rustc writes truncated .rmeta and .rlib files, and the next crate to read them fails with errors that look like source bugs: hundreds of "not found in this scope" errors for bevy::prelude items, a missing module, a wrong argument count, or the linker crashing. A compile error in a crate you did not touch, that disappears when you run again, is a disk-space error. Check your free space before believing it. If target/debug/ exists, delete it; nothing needs it.
Even within dist, cargo keeps a separate copy of every crate for each way it is compiled: check output is stored apart from build output, and a different feature set compiles a second Bevy. So use the per-crate commands above for iterating on one crate, and go through cargo renzora dist for a whole-workspace build. When you want every error a workspace build has rather than the stop at the first failing crate, rerun the command it printed with --keep-going added.
dist inherits release with opt-level = 2, no LTO, stripped symbols and incremental compilation: fast to link, which is what you want all day. Bevy's own crates are the exception and build without incremental, because an incremental crate loses cross-crate inlining and Bevy only changes when it is pulled. The size-optimised release profile exists for shipping and is described in Releases.
cargo renzora commands
| Command | What it does |
|---|---|
cargo renzora dist | Build and stage dist/<platform>/. The one to use from scripts and agents. |
cargo renzora dist --bundle | The same, then wrap it the way it ships: an AppImage on Linux, a .app on macOS (Windows is already a flat folder) |
cargo renzora | Build, stage, and launch the editor |
cargo renzora xr | Build, stage, and launch the XR-capable editor (passes --xr) |
cargo renzora profile | Build with the profiling feature (Bevy's Tracy instrumentation) and launch |
cargo renzora wasm | Build the web runtime and web editor into dist/web-wasm32/, serve them on localhost and open the editor |
cargo renzora sync [--check] | Regenerate the plugin wiring; --check fails if the committed files are stale (CI runs this) |
cargo renzora check-bevy | Fail if any Bevy crate in the build comes from anywhere but bevy/ |
cargo renzora sdk | Re-cut only the plugin SDK from the last build |
cargo renzora remove <crate> | Delete a plugin crate and every reference to it |
cargo renzora coverage | Measure line coverage; see Testing |
Arguments after the command are forwarded to the binary when it launches, so cargo renzora run --server starts a headless server instead of the editor.
Two more aliases live in .cargo/config.toml: cargo dist (compile only, no staging) and cargo check-plugins, which compiles a directory of native plugins against a staged SDK (see Releases).
Environment variables
| Variable | Effect |
|---|---|
RENZORA_PROFILE | Cargo profile to build and stage (default dist). CI's desktop lanes set it |
RENZORA_NO_AUTO_INSTALL | Linux: print missing packages instead of installing them |
DLSS_SDK | Path to the NVIDIA DLSS SDK. When it, the Vulkan SDK and clang are all present, cargo renzora builds with --features dlss and stages the DLSS libraries. See DLSS |
RENZORA_DLSS=0 | Build without DLSS on a machine that has the SDK |
RENZORA_DLSS_LIBS=0 | Compile DLSS in but do not stage NVIDIA's libraries |
Note the DLSS consequence for the rule above: on a machine with DLSS_SDK set, cargo renzora compiles with a feature a plain cargo check --profile dist --workspace does not, so that check builds a second engine's worth of artefacts. Keep check per crate.
Running the build
./dist/linux-x64/renzora # Linux
./dist/macos-arm64/renzora # macOS
.\dist\windows-x64\renzora.exe # Windows
renzora is one binary with several roles, chosen at launch:
| Launch | Role |
|---|---|
| no flags, editor image present | the editor |
| no flags, editor image absent | the game |
--no-editor | the game, even with the editor image present |
--server | headless dedicated server: no window, no GPU |
--host | windowed listen server, client and server in one process (wins over --server) |
--vr | the game, rendered into an OpenXR headset |
--xr (or RENZORA_XR=1) | the editor with the XR path on, for editing in a headset |
The editor image is renzora_editor.dll on Windows, librenzora_editor.so on Linux and librenzora_editor.dylib on macOS. A --server, --host or --vr launch is never an editor session. Server launches also accept --port, --addr (or --address), --tick-rate and --max-clients, which override the project's network settings.
The plain editor boots flat and pipelined. The XR boot is opt-in because it turns off pipelined rendering and runs the render sub-app on the main thread, which costs a large share of the frame; use it only to edit in a headset.
Testing the web build
cargo renzora wasm sets itself up: it adds the wasm32-unknown-unknown target and the matching wasm-bindgen CLI if they are missing, builds both bundles, serves dist/web-wasm32/ at http://localhost:8000 (or the next free port) and opens renzora-editor.html in your browser. Use a browser with WebGPU. Press Ctrl+C to stop the server.
| Flag | Effect |
|---|---|
--no-opt | Skip the slow wasm-opt size pass: the quick loop while iterating |
--no-serve | Build and stage only, for example to produce the web export template |
The web build uses its own target directories (target/wasm and target/wasm-editor), each a full build for the web, so the first run is slow and needs plenty of free disk.
What native does not do
cargo renzora builds for the machine it runs on, plus the web. For Windows, macOS, Linux, Android or iOS builds from one host, see Cross-Compiling.
Where to go next
- Architecture: one binary, a loadable editor image, and the layered contract.
- Project Structure: where things live in the repository.
- Cross-Compiling: Docker, the toolchain images and the
renzoraCLI. - Contributing Guide: the workflow for sending a change.