Skip to content

Building from Source

XiONDiGiTaL edited this page Nov 23, 2026 · 1 revision

Building from Source

The player release is built from the same tree. This page covers the Rust launcher, the command-line tools, the engine build and the verification scripts.

Requirements

Tool Version Used for
Rust stable, 1.85 or newer Launcher and Rust tools
Python 3.10 or newer The ZBIC decode helper and verification scripts
ziglang (Python package) recent Compiling emitted C during verification
Visual Studio C++ tools, LLVM, CMake, Ninja see System Requirements The engine build

Build the launcher

git clone https://github.com/XiONDiGiTaL/EmblemWeave.git
cd EmblemWeave
cargo build --release -p emblemweave

The launcher is target\release\EmblemWeave.exe. The command-line tools build alongside it:

Tool Purpose
ew-inspect Inspect an ExeFS and RomFS
ew-lift Run the recompiler, emit C, run verification campaigns and reports
ew-run Run the game in the console and print a stop report (--native uses the compiled library, --window shows frames)
ew-present Exercise the window and swap chain on their own
ew-native Lift, emit and compile the whole main module into ew_native.dll

Build the game

A normal checkout keeps the lifted libraries in engine/fefw-recomp/work/build/fefw, which is already the engine's default:

pwsh -NoProfile -File engine/fefw-recomp/game-build/scripts/build_fefw.ps1

Use -LibDir only when the lifted libraries are somewhere else. The script removes inherited PYTHONPATH and PYTHONHOME, sets PYTHONNOUSERSITE=1, and configures with the same response-file setting as the launcher's build.

Compiler jobs

The launcher chooses the job count from free CPU and memory. To override it for one build:

$env:NX_JOBS = 6

Valid values are 1–64. The chosen count and the reason are written to the job log.

Path handling check

The engine's path handling can be tested without building the game:

pwsh -NoProfile -File engine/fefw-recomp/recomp/tests/build_paths.ps1

It configures a small CMake/Ninja project from folders containing spaces, &, parentheses, non-ASCII text and long names. Pass -ClangCl <path> when LLVM is not on PATH.

Tests

cargo test --workspace

The repository also carries end-to-end checks that run on your own game data:

Script What it proves
tools/verify_cfg.sh 400 recovered functions produce identical registers in the interpreter and the compiled C
tools/verify_simd.sh Every distinct vector encoding behaves identically in both, on edge-case inputs
tools/oracle_lockstep.py The interpreter agrees with Unicorn, one instruction at a time, from a real snapshot

These need pip install ziglang unicorn. Gameplay checks (long sessions, battles, audio, mods, controller input) are the scenario list in GAMEPLAY_TESTING.md; they need a real dump and hardware and are not part of cargo test.

Shader translator

The release build uses the prebuilt translator. To build it yourself:

dotnet publish engine/fefw-recomp/tools/shaders/harness/SpirvHarness.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true

For Linux (the translator, not the game):

dotnet publish engine/fefw-recomp/tools/shaders/harness/SpirvHarness.csproj -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true

The build looks under tools/shaders/prebuilt/<platform>/.

Project layout

apps/emblemweave/     the launcher (egui)
assets/branding/      the EmblemWeave logo
crates/ew-format/     container and asset formats
crates/ew-lift/       decoder, recompiler and reference interpreter
crates/ew-boot/       experimental runtime: image, startup, scheduler, host services
crates/ew-gfx/        experimental host Vulkan device and presenter
crates/ew-runtime/    experimental guest memory and service registry
docs/                 status, architecture, graphics, legal, upstream, changelog
engine/fefw-recomp/   the integrated primary engine (GPL-3.0, its own notices)
tools/                decoding helper, release and verification scripts

Licence of contributions

The launcher and engine are GPL-3.0-only. Third-party code keeps its own licence; see THIRD_PARTY.md.

Related

Clone this wiki locally