Building & Testing
Everything you need to hack on ferrixd.
Toolchain
rust-toolchain.toml selects the current stable toolchain (with rustfmt and clippy); with rustup, it is installed automatically. The minimum supported Rust version is 1.95 (rust-version in Cargo.toml), and CI builds on exactly that toolchain too:
git clone https://github.com/josunlp/ferrixd
cd ferrixd
cargo build # debug
cargo build --release # optimized (release profile strips symbols)No system libraries needed for the default build — SQLite is bundled (rusqlite/bundled) and the WASM interpreter (wasmi) is pure Rust.
Run a development server from the checkout:
cargo run -p ferrixd -- run --devThe quality gates
The Rust gates CI runs — all must pass:
cargo test # unit + integration tests
cargo clippy --all-targets -- -D warnings # lints are errors
cargo fmt --check # formatting
cargo deny check # license/advisory/dependency auditCI additionally checks the MSRV (cargo check on Rust 1.95), builds and tests the web client, builds the example plugin for wasm32 and inspects it with ferrixd plugin inspect, and runs the irctest conformance suite. The web client's gates, from web/ (Node 24):
npm ci
npm run typecheck # tsc --noEmit
npm test # vitest: protocol, SCRAM, chat model, accessibility
npm run build # → web/distTwo lint policies deserve a call-out, because they're unusual and non-negotiable:
unsafe_code = "forbid"at the workspace level — code that needsunsafeneeds a different design.panic!/unwrap/expectare clippy errors in the data path — useResultand structured errors. Tests are exempt.
Testing philosophy
Unit tests live beside their modules; integration tests drive real connections (including TLS) against an in-process server.
Conformance: capabilities are implemented against the IRCv3 spec text, and CI runs the irctest suite (
not implementation-specific and not deprecated) against a release build with ferrixd's controller (ci/irctest/ferrixd.py). The expected-failures baseline (ci/irctest/expected-failures.txt) is empty, so any failure fails the job; seeci/irctest/README.mdto run it locally (installfaketimeso the time-dependent tests run quickly).Spec drift:
ci/ircv3-drafts.tomlpins every implemented draft spec; the weeklyspec-watchworkflow reports upstream changes and likely ratifications (policy).Fuzzing the protocol parser (nightly toolchain):
shcargo install cargo-fuzz cargo +nightly fuzz run parse_messageThe harness asserts the parser never panics and respects its length budgets on arbitrary input. If you touch
ferrix-protocol, run the fuzzer for a while before opening a PR.
Load testing
The loadtest/ crate (excluded from the workspace build) is the connection-density generator behind the 100k figure:
cd loadtest
cargo run --release -- --helpIt opens tens of thousands of registered connections with configurable join/message behavior and reports latency and throughput. Methodology notes live in loadtest/'s README. The headline result: ~100,000 concurrent connections on an 8-core host at ~1.38 GB RSS (~13.8 KB per connection), scaling linearly with connection count.
Repository layout for contributors
| Path | What lives there |
|---|---|
crates/ferrix-protocol/ | wire model, parser, encoder — dependency-light, fuzz-facing |
crates/ferrixd/src/ | the daemon (module map in Architecture) |
web/ | web client + admin dashboard (TypeScript, bQuery, Vite); npm run dev proxies to a local ferrixd |
examples/plugins/ | example plugins built for wasm32 in CI (the LLM assistant) |
ci/ | irctest controller + baseline, ircv3-drafts.toml draft-spec pins |
fuzz/ | cargo-fuzz targets |
loadtest/ | density load generator (own crate, excluded) |
scripts/ | installer scripts (POSIX sh — must stay dash/BusyBox/Termux-compatible — and PowerShell) |
docs/ | this documentation (VitePress) |
.github/workflows/ | ci.yml (gates above), docs.yml (this site), spec-watch.yml (weekly draft check) and release.yml (13-target build matrix, web bundle, container image) |
Working on the docs
cd docs
npm ci
npm run dev # live-reload dev server
npm run build # what CI/Pages runs; also checks internal linksCutting a release
- Bump
versionin the workspaceCargo.toml([workspace.package]). - Commit and push, then publish a GitHub Release tagged
vX.Y.Z(gh release create vX.Y.Z --generate-notes, or the GitHub UI). The tag must equal the crate version — the workflow refuses mismatches. Publishing the Release is what triggers the build; a bare tag push does not. release.ymlbuilds all 13 targets (musl statics + BSD/Android viacross, native macOS/Windows) and the web bundle (ferrixd-web.tar.gz), generates SHA-256 checksums, attaches them to the release, and pushes a multi-arch container image to ghcr.io. Aworkflow_dispatchrun is a dry run: builds everything, publishes nothing.
The full checklist lives in Releasing.
Conventions
- Match the existing style;
rustfmtsettles formatting arguments. - Error handling:
thiserror-style structured errors in library code,anyhowat the CLI boundary. - New capabilities: implement against the IRCv3 spec text, add integration tests, and cover negotiation (LS/REQ/ACK/NAK) — not just the happy path.
- New limits: every bound needs a defined consequence, a log line, and — if clients can hit it — a metric.