Skip to Content
Simulacra

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

WhatNotes
Rust via rustupThe 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 compilerSQLite is compiled into the program (rusqlite with its bundled feature). The Linux packages below include clang.
Linux system librariesX11, 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-dev

For 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 --release

A 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.

CheckCommand
Build every target and run the testscargo test --locked --all-targets
Lints, warnings as errorscargo 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:

PurposeCommand
Search at 100,000 posts (see Q7)cargo test --lib state::search::bench -- --ignored --nocapture
Write avatar previews as PNG filesSIMULACRA_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/).

TaskCommand (in docs/)
Installnpm install
Preview locallynpm run dev
Build the static sitenpm run build
Check every page compiles and its screenshots are listednode 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.

On this page