Building from source

Reesql is a Rust project (edition 2021). You only need this to work on Reesql itself or to build for a platform that isn't in the prebuilt releases - most users should follow Installation.

Prerequisites

Install Rust via rustup.

Build targets

build.sh wraps cargo for local builds. It runs on macOS - the intel and universal targets use lipo, and linux cross-compiles from macOS. It defaults to native when you pass no argument:

./build.sh native      # current macOS architecture (arm64)
./build.sh intel       # Intel macOS (requires the x86_64-apple-darwin target)
./build.sh universal   # macOS universal binary (arm64 + x64)
./build.sh linux       # Linux x64 (requires the cross toolchain)
./build.sh all         # every supported target

Linux cross-compilation on macOS

rustup target add x86_64-apple-darwin x86_64-unknown-linux-gnu

brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-gnu

The build script checks for these dependencies and prints helpful errors if anything is missing.

Plain cargo

cargo build --release
# binary at ./target/release/reesql

Testing

Reesql ships integration tests that format sample inputs and compare them against golden files:

cargo test

Test inputs and expected outputs live in tests/data/ - each case is an .input.sql file paired with a .golden.sql file. To add a case, create a new pair and add a test function in tests/integration_test.rs.

Releasing

Maintainers cut releases with release.sh from macOS. Reesql is pure Rust with no native dependencies, so a single run cross-compiles every supported target and publishes them as one GitHub Release - there is no per-platform release loop:

  • macOS (arm64, x64) - native cargo build
  • Linux (x64, arm64) - cargo zigbuild, which uses the Zig linker to handle glibc versioning
  • Windows (x64, arm64) - cargo xwin build, which downloads the MSVC SDK and CRT automatically
bash release.sh
FlagDescription
--draftCreate the release as a draft (default: published).
--minorBump the month component instead of the patch version.
--forceRelease the current Cargo.toml version even if it is ahead of the tag.

Version numbers are date-based: YY.MM.PATCH.

The release toolchain needs a few one-time installs:

brew install zig
cargo install cargo-zigbuild cargo-xwin
rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu \
                  x86_64-pc-windows-msvc aarch64-pc-windows-msvc
gh auth login   # the gh CLI must be authenticated

Contributing

Issues and pull requests are welcome on GitHub. Reesql is part of the Reepolee toolchain - see reepolee.com for the wider project.