Building from source
For contributors. Build and run Simulacra from its Rust source, install the Linux libraries, run the tests and checks CI runs, and build this documentation.
Simulacra is one Rust program. Everything it needs at run time (illustrations, themes, palettes, seed data and translations) is embedded in the binary, so a build is a single executable.
Requirements
| What | Notes |
|---|---|
Rust via rustup | The toolchain is pinned in rust-toolchain.toml (Rust 1.100.0 with clippy and rustfmt). rustup installs it on the first cargo command in the checkout. |
| A C compiler | SQLite is compiled into the program (rusqlite with its bundled feature). The Linux packages below include clang. |
| Linux system libraries | X11, Wayland, Vulkan and fonts for the UI toolkit, GTK 3 for the native file dialog, ALSA for audio. |
On Debian and Ubuntu, the same packages CI installs (from .github/actions/setup-rust/action.yml):
sudo apt-get install -y --no-install-recommends pkg-config clang \
libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libx11-xcb-dev libxcb1-dev \
libvulkan-dev libfontconfig1-dev libfreetype-dev libgtk-3-dev libasound2-dev \
libssl-dev libzstd-devFor colour emoji on Linux, also install fonts-noto-color-emoji (see R4).
Build and run
git clone https://github.com/raitucarp/simulacra.git
cd simulacra
cargo run --releaseA debug build (cargo run) is slower but compiles faster. Debug builds read the illustration and palette assets from disk, release builds embed them. On Windows, .cargo/config.toml raises the main thread's stack size for the linker; release builds open no console window.
Use a scratch vault while you work, so your real one is never touched:
SIMULACRA_DB_PATH="$PWD/scratch/simulacra.db" cargo run(Create the scratch folder first.) Other variables are listed in Data and files.
Tests and checks
These are the commands CI runs; a pull request has to pass all of them.
| Check | Command |
|---|---|
| Build every target and run the tests | cargo test --locked --all-targets |
| Lints, warnings as errors | cargo clippy --locked --all-targets -- -D warnings |
| Dependency policy (licences, advisories, sources) | cargo deny --all-features check (cargo-deny 0.20.2, rules in deny.toml) |
CI also fails a build that prints any compiler warning, and runs the tests on Linux and Windows for pull requests, and on Linux, Windows and macOS for main.
Tests marked #[ignore] are manual tools:
| Purpose | Command |
|---|---|
| Search at 100,000 posts (see Q7) | cargo test --lib state::search::bench -- --ignored --nocapture |
| Write avatar previews as PNG files | SIMULACRA_PREVIEW_DIR=<folder> cargo test --lib render_avatar_previews -- --ignored |
To regenerate the emoji table from Unicode's emoji-test.txt:
cargo run --features codegen --bin emoji-table -- <path to emoji-test.txt>Installers
The release workflow builds the installers with cargo-packager 0.11.8: an NSIS setup for Windows, a DMG for macOS (11 and later), a .deb and an AppImage for Linux, plus a plain archive of the executable for each platform. The packaging settings are in [package.metadata.packager] of Cargo.toml.
This documentation
The guide lives in docs/ (Next.js and Fumadocs, MDX pages under docs/content/docs/).
| Task | Command (in docs/) |
|---|---|
| Install | npm install |
| Preview locally | npm run dev |
| Build the static site | npm run build |
| Check every page compiles and its screenshots are listed | node scripts/check-mdx.mjs |
How to write a page, the components and the screenshot lists are described in docs/WRITING.md; the capture scripts in docs/capture/README.md.
Related
Troubleshooting
What the app's warnings and error messages mean and what to do about them, from installer prompts and vault problems to missing keys, budgets, imports, emoji and resets.
Design decisions
Plain summaries of the architecture decision records in the repository, from colour emoji and video posters to the code runner's security review and the search benchmark.