Repository navigation
Building
TwilightMC targets stable Rust (edition 2024) and Node.js 22 for the Svelte
frontend. The GUI embeds the frontend at compile time, so the frontend build
must run before cargo build.
| Platform | Packages |
|---|---|
| All | stable Rust toolchain, Node.js 22 + npm, 7z on PATH
|
| Windows | Visual Studio Build Tools (MSVC) or MinGW-w64; WebView2 Runtime |
| macOS | Xcode Command Line Tools |
| Linux |
libwebkit2gtk-4.1-dev, build-essential, curl, wget, file, libxdo-dev, libssl-dev, libayatana-appindicator3-dev, librsvg2-dev
|
On Debian/Ubuntu:
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file \
libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev7z is only needed when the launch pipeline extracts natives; the CLI still
builds without it.
cd crates/twilight-ui/ui
npm ci
npm run build # writes ui/dist, embedded by tauri::generate_context!
cd ../../..
cargo build --release --locked
cargo test --workspaceThe release binaries land in target/release/:
-
twilight— CLI -
twilight-ui— desktop GUI
Every contribution must pass the same gates CI runs:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspaceThe frontend has its own gates:
npm --prefix crates/twilight-ui/ui run check:locales
npm --prefix crates/twilight-ui/ui run buildZero warnings are tolerated. clippy runs with -D warnings, and the locale
checker fails on missing or duplicate Fluent keys.
build.py wraps the common flows on Windows and Unix:
py build.py # frontend + cargo build (debug)
py build.py release # frontend + cargo build --release
py build.py gates # fmt --check / clippy -D warnings / test
py build.py pack # release + CI-style zip under dist/ (exe + docs + sha256)
py build.py all # gates + release + packAdd --workspace to build every workspace member instead of the default
binaries.
The release workflows build .deb, .rpm, .AppImage, .dmg, .msi and
NSIS .exe bundles. Locally:
cargo install tauri-cli --version '^2' --locked
cargo tauri build -c crates/twilight-ui/tauri.conf.json --bundles deb,rpmBundling needs the platform tooling (for example dpkg-deb/rpmbuild on
Linux). The portable archives are produced by the release workflow, not by
cargo build alone.
cargo test --workspaceNetwork paths use loopback HTTP servers; JSON fixtures are inline; DEFLATE
fixtures are committed hex blobs. Platform-specific tests are #[cfg]-gated,
so the full union only runs in CI's multi-platform matrix.
| Symptom | Fix |
|---|---|
failed to open icon .../icons/icon.png during generate_context!
|
regenerate the Tauri icon set from ui/public/logo.png (cargo tauri icon) |
frontendDist missing / blank window |
run npm run build in crates/twilight-ui/ui before cargo build
|
webkit2gtk-4.1 not found on Linux |
install libwebkit2gtk-4.1-dev
|
linker 'cc' not found on Linux |
install build-essential
|
7z not found at launch time |
install p7zip-full / 7zip, or skip natives-heavy versions |
| clippy passes locally but fails in CI | run the exact gate: cargo clippy --workspace --all-targets -- -D warnings
|
- Architecture — what each crate does.
- Release channels — how a build becomes a release.
- Contributing — the CLA, commit rules and agent policy.
TwilightMC is free software under AGPL-3.0-or-later · Report a bug · Releases · Discord
Start here
Using it
Under the hood
Project