Skip to content

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:

sh
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:

sh
cargo run -p ferrixd -- run --dev

The quality gates ​

The Rust gates CI runs — all must pass:

sh
cargo test                                # unit + integration tests
cargo clippy --all-targets -- -D warnings # lints are errors
cargo fmt --check                         # formatting
cargo deny check                          # license/advisory/dependency audit

CI 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):

sh
npm ci
npm run typecheck   # tsc --noEmit
npm test            # vitest: protocol, SCRAM, chat model, accessibility
npm run build       # → web/dist

Two lint policies deserve a call-out, because they're unusual and non-negotiable:

  • unsafe_code = "forbid" at the workspace level — code that needs unsafe needs a different design.
  • panic!/unwrap/expect are clippy errors in the data path — use Result and 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; see ci/irctest/README.md to run it locally (install faketime so the time-dependent tests run quickly).

  • Spec drift: ci/ircv3-drafts.toml pins every implemented draft spec; the weekly spec-watch workflow reports upstream changes and likely ratifications (policy).

  • Fuzzing the protocol parser (nightly toolchain):

    sh
    cargo install cargo-fuzz
    cargo +nightly fuzz run parse_message

    The 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:

sh
cd loadtest
cargo run --release -- --help

It 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 ​

PathWhat 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 ​

sh
cd docs
npm ci
npm run dev      # live-reload dev server
npm run build    # what CI/Pages runs; also checks internal links

Cutting a release ​

  1. Bump version in the workspace Cargo.toml ([workspace.package]).
  2. 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.
  3. release.yml builds all 13 targets (musl statics + BSD/Android via cross, 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. A workflow_dispatch run is a dry run: builds everything, publishes nothing.

The full checklist lives in Releasing.

Conventions ​

  • Match the existing style; rustfmt settles formatting arguments.
  • Error handling: thiserror-style structured errors in library code, anyhow at 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.

Dual-licensed under MIT or Apache-2.0.