Reussir Language Reference

Building Reussir

Building Reussir

Building from source is intended for compiler development, unsupported hosts, and changes that have not reached a release. If the goal is only to write and run Reussir programs, the prebuilt installation avoids the LLVM/MLIR development toolchain entirely.

The repository combines a Rust frontend and runtime with a C++23 MLIR backend. CMake is the top-level build driver: it generates the Reussir dialect, builds the C++ libraries and command-line tools, and invokes Cargo for the Rust crates.

Requirements

A full build needs:

  • CMake 3.28 or newer and Ninja;
  • a C and C++23 compiler, with Clang recommended;
  • LLVM and MLIR 22.x, including LLVMConfig.cmakeLLVMConfig.cmake, MLIRConfig.cmakeMLIRConfig.cmake, and the TableGen tools—other LLVM major versions are rejected at configure time;
  • Rust and Cargo. The repository’s rust-toolchain.tomlrust-toolchain.toml selects nightly-2026-02-15nightly-2026-02-15 and requests rust-srcrust-src;
  • Git and network access during configuration, because CMake fetches pinned copies of Immer and mlir-syncmlir-sync, plus TPDE on ELF platforms;
  • spdlog, and—when tests are enabled—GoogleTest/GoogleMock, Python 3, and LLVM litlit.

The repository README contains the concise build commands. The recipes below also reflect the project’s current CI configuration.

Recommended: the Nix development shell

On Linux or macOS with Nix and flakes enabled, the repository flake provides LLVM/MLIR 22, the pinned Rust nightly, CMake, Ninja, test dependencies, and the required discovery variables. It also writes the nix-devnix-dev CMake user preset when the shell starts:

git clone https://github.com/reussir-lang/reussir.git
cd reussir
nix develop
cmake --preset nix-dev -B build
cmake --build build --parallel
git clone https://github.com/reussir-lang/reussir.git
cd reussir
nix develop
cmake --preset nix-dev -B build
cmake --build build --parallel

These commands keep dependencies in the Nix store and put build products in build/build/. Re-enter nix developnix develop before rebuilding in a new terminal.

Manual build on Linux or macOS

The manual route must expose one LLVM/MLIR 22 installation prefix to both CMake and the Rust backend build scripts.

Install dependencies

The Linux CI runs on Ubuntu 24.04 and installs LLVM 22 from apt.llvm.org. After enabling that repository, a comparable dependency set is:

sudo apt install cmake ninja-build clang-22 lld-22 \
llvm-22-dev llvm-22-tools libclang-22-dev libmlir-22-dev \
mlir-22-tools libpolly-22-dev libgtest-dev libgmock-dev \
libspdlog-dev libgmp-dev python3 python3-venv
python3 -m venv .venv
. .venv/bin/activate
python -m pip install lit
export LLVM_PREFIX=/usr/lib/llvm-22
sudo apt install cmake ninja-build clang-22 lld-22 \
llvm-22-dev llvm-22-tools libclang-22-dev libmlir-22-dev \
mlir-22-tools libpolly-22-dev libgtest-dev libgmock-dev \
libspdlog-dev libgmp-dev python3 python3-venv
python3 -m venv .venv
. .venv/bin/activate
python -m pip install lit
export LLVM_PREFIX=/usr/lib/llvm-22

On macOS, the release job uses Homebrew and Apple’s command-line developer tools:

xcode-select --install
brew install cmake ninja llvm spdlog googletest python@3
python3 -m venv .venv
. .venv/bin/activate
python -m pip install lit
export LLVM_PREFIX="$(brew --prefix llvm)"
"$LLVM_PREFIX/bin/llvm-config" --version
xcode-select --install
brew install cmake ninja llvm spdlog googletest python@3
python3 -m venv .venv
. .venv/bin/activate
python -m pip install lit
export LLVM_PREFIX="$(brew --prefix llvm)"
"$LLVM_PREFIX/bin/llvm-config" --version

The last command must report a 22.x release. If Homebrew’s unversioned llvmllvm formula has moved to a newer major version, use an LLVM 22 package or the Nix development shell instead.

Install rustup before configuring. Running Cargo anywhere under the cloned repository makes rustup honor rust-toolchain.tomlrust-toolchain.toml; this command installs the toolchain explicitly so configuration does not stop halfway through:

rustup toolchain install nightly-2026-02-15 --component rust-src
rustup toolchain install nightly-2026-02-15 --component rust-src

Configure and compile

Clone the source if it is not already present, then configure the same RelWithDebInfoRelWithDebInfo, pedantic, test-enabled build used by the release workflow:

git clone https://github.com/reussir-lang/reussir.git
cd reussir
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER="$LLVM_PREFIX/bin/clang" \
-DCMAKE_CXX_COMPILER="$LLVM_PREFIX/bin/clang++" \
-DLLVM_USE_LINKER=lld \
-DLLVM_DIR="$LLVM_PREFIX/lib/cmake/llvm" \
-DMLIR_DIR="$LLVM_PREFIX/lib/cmake/mlir" \
-DREUSSIR_ENABLE_PEDANTIC=ON \
-DREUSSIR_ENABLE_TESTS=ON
cmake --build build --parallel
git clone https://github.com/reussir-lang/reussir.git
cd reussir
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER="$LLVM_PREFIX/bin/clang" \
-DCMAKE_CXX_COMPILER="$LLVM_PREFIX/bin/clang++" \
-DLLVM_USE_LINKER=lld \
-DLLVM_DIR="$LLVM_PREFIX/lib/cmake/llvm" \
-DMLIR_DIR="$LLVM_PREFIX/lib/cmake/mlir" \
-DREUSSIR_ENABLE_PEDANTIC=ON \
-DREUSSIR_ENABLE_TESTS=ON
cmake --build build --parallel

Remove -DLLVM_USE_LINKER=lld-DLLVM_USE_LINKER=lld if lldlld is not installed. For a smaller build that omits the test tree, set -DREUSSIR_ENABLE_TESTS=OFF-DREUSSIR_ENABLE_TESTS=OFF.

Windows source builds

Windows CI uses an x64 MSVC developer environment and a Miniforge environment containing LLVM/MLIR 22.1.8. From an x64 Native Tools PowerShell, create and activate the checked-in environment:

git clone https://github.com/reussir-lang/reussir.git
cd reussir
conda env create --prefix .conda\reussir -f .github\conda\windows-msvc.yml
conda activate .\.conda\reussir
rustup toolchain install nightly-2026-02-15 --component rust-src
$llvmRoot = Join-Path $env:CONDA_PREFIX "Library"
$env:PATH = "$llvmRoot\bin;$env:PATH"
cmake -S . -B build -G Ninja `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_C_COMPILER="$llvmRoot\bin\clang.exe" `
-DCMAKE_CXX_COMPILER="$llvmRoot\bin\clang++.exe" `
-DLLVM_DIR="$llvmRoot\lib\cmake\llvm" `
-DMLIR_DIR="$llvmRoot\lib\cmake\mlir" `
-DREUSSIR_ENABLE_PEDANTIC=ON `
-DREUSSIR_ENABLE_TESTS=ON
cmake --build build --parallel
git clone https://github.com/reussir-lang/reussir.git
cd reussir
conda env create --prefix .conda\reussir -f .github\conda\windows-msvc.yml
conda activate .\.conda\reussir
rustup toolchain install nightly-2026-02-15 --component rust-src
$llvmRoot = Join-Path $env:CONDA_PREFIX "Library"
$env:PATH = "$llvmRoot\bin;$env:PATH"
cmake -S . -B build -G Ninja `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_C_COMPILER="$llvmRoot\bin\clang.exe" `
-DCMAKE_CXX_COMPILER="$llvmRoot\bin\clang++.exe" `
-DLLVM_DIR="$llvmRoot\lib\cmake\llvm" `
-DMLIR_DIR="$llvmRoot\lib\cmake\mlir" `
-DREUSSIR_ENABLE_PEDANTIC=ON `
-DREUSSIR_ENABLE_TESTS=ON
cmake --build build --parallel

Conda’s LLVM packages occasionally expose libxml2libxml2, zstd, or FileCheck under names that CMake does not expect. The Windows CI workflow is the canonical reference for the compatibility aliases and environment setup when that occurs.

Build products

User-facing commands are staged in build/bin/build/bin/:

  • rrcrrc compiles Reussir source and can emit intermediate representations;
  • renerene resolves and builds Reussir packages;
  • rreplrrepl runs the interactive REPL;
  • reussir-syntaxreussir-syntax parses source and emits the JSON syntax tree.

The same directory contains backend tools such as reussir-optreussir-opt and reussir-translatereussir-translate. Runtime and backend libraries are written to build/lib/build/lib/. Build an individual target when a full rebuild is unnecessary:

cmake --build build --target rrc
cmake --build build --target rrepl
cmake --build build --target rene
cmake --build build --target reussir-opt
cmake --build build --target rrc
cmake --build build --target rrepl
cmake --build build --target rene
cmake --build build --target reussir-opt

Run the test suites

Run the C++ unit tests through their CMake target and CTest:

cmake --build build --target reussir-ut
ctest --test-dir build --output-on-failure
cmake --build build --target reussir-ut
ctest --test-dir build --output-on-failure

Rust crates have explicit CMake test targets. The complete set is:

cmake --build build --target \
rrc-test reussir-codegen-test reussir-backend-test \
reussir-core-test reussir-syntax-test reussir-jit-test \
rrepl-test rene-test
cmake --build build --target \
rrc-test reussir-codegen-test reussir-backend-test \
reussir-core-test reussir-syntax-test reussir-jit-test \
rrepl-test rene-test

LLVM litlit provides the end-to-end and pass-level integration suite. Build the REPL first so that the repl-rsrepl-rs tests are enabled, then run checkcheck:

cmake --build build --target rrepl
cmake --build build --target check
cmake --build build --target rrepl
cmake --build build --target check

Some integration suites probe for optional tools: LLDB or GDB for debug-info tests, OpenMP for threaded drivers, LTO-capable linkers for cross-language tests, Wasmer and the WASI Rust targets for WebAssembly, and sanitizer runtime variants for ASan, LSan, MSan, or TSan. A missing optional dependency marks its tests UNSUPPORTEDUNSUPPORTED; it does not make the basic build fail.

What CI verifies

The release workflow builds with tests and pedantic warnings enabled, runs the unit and integration suites, and then packages the user-facing tools. Linux is tested on x86_64 and AArch64 with LLVM 22; macOS uses an Apple-silicon runner; Windows uses x64 MSVC with LLVM/MLIR 22.1.8 from conda-forge. A successful push to mainmain replaces the rolling nightlynightly prerelease, while a v*v* tag publishes an immutable versioned release through the same matrix.

For exact automation details, see the release workflow and the Linux CI workflow.