Building from Source
QuantaBox is a Rust Cargo workspace plus a Tauri desktop app. This guide covers building the CLI, the core libraries, and the GUI, and packaging a release.
Prerequisites #
| Tool | Purpose |
|---|---|
| Rust (stable, 2021 edition) | Building all crates. Install via rustup. |
| Node.js + npm | Building the Svelte frontend for the GUI. |
| Tauri CLI | Building the desktop app. cargo install tauri-cli --version "^1". |
| QEMU | Runtime engine (qemu-system-x86_64, qemu-img) -- needed to run VMs, not to build. |
| Platform webview | Linux: WebKitGTK and related -dev packages. Windows/macOS: provided by the OS. |
Get the Source #
git clone https://github.com/dyber-pqc/quantabox.git
cd quantabox
Build the Workspace (CLI + Libraries) #
# Debug build of everything
cargo build --workspace
# Optimized release build
cargo build --workspace --release
The quantabox CLI binary lands in target/debug/ or target/release/.
Run the test suite:
cargo test --workspace
Build the Desktop App #
The GUI lives in gui/ (Svelte frontend) and gui/src-tauri/ (Tauri Rust backend).
cd gui
npm install # first time only
npm run tauri dev # run the app in development
For a production build, use the Tauri CLI rather than plain cargo build -- this compiles the frontend and embeds it into the binary:
# from gui/
cargo tauri build # full build + platform bundles
cargo tauri build --bundles none # just the executable, no installer bundles
custom-protocol feature. Production Tauri builds must enable the custom-protocol feature so the app serves its embedded frontend through the tauri:// protocol instead of a dev server. The GUI crate declares:
[features]
custom-protocol = ["tauri/custom-protocol"]
cargo tauri build enables this automatically. A plain cargo build of the GUI does not embed the frontend and will try to load http://localhost:<port> at runtime -- resulting in a blank "can't reach this page" window.Frontend output directory
The Svelte build (adapter-static) emits to gui/build/, and the Tauri config's distDir points there. If you change the static adapter's output location, update distDir in gui/src-tauri/tauri.conf.json to match.
Packaging Installers #
QuantaBox ships platform installers built from the release binary:
- Windows -- an installer is produced from
target/release/QuantaBox.exeplus the app icon and license, bundling the QEMU engine optionally. See theinstaller/directory. - Linux --
.deb,.rpm, and AppImage can be produced viacargo tauri build's bundlers or distro tooling. - macOS -- a
.dmgviacargo tauri build.
Common Build Issues #
| Symptom | Fix |
|---|---|
| GUI window shows "can't reach this page" after install | Build with cargo tauri build and ensure the custom-protocol feature exists (see above). |
target directory locked on Windows | Close any running app/dev server holding the binary, then rebuild. |
| Frontend changes not reflected | Re-run npm run build (or cargo tauri build, which runs it for you). |
| Webview/link errors on Linux | Install WebKitGTK and the platform -dev dependencies. |
Cross-Platform Notes #
- The codebase routes every subprocess spawn through a helper that suppresses console windows on Windows (
CREATE_NO_WINDOW). Preserve this when adding newCommandinvocations -- see Components: theprochelper. - The GUI's
main.rsuses#![cfg_attr(all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows")]so release builds run without a console window.
Next #
See Contributing for coding conventions and the pull-request process.