Distributed rustc over a peer-to-peer farm of your own machines. Your notebook builds with your desktop's cores. The binaries run on Windows, macOS and Linux; a farm of Windows machines is what 1.0 distributes (see Status).
Website: https://crabfarm.renner.dev
Status: crabfarm 1.0 distributes builds between Windows machines (same compiler on every machine). Mixed-OS farms are planned. See docs/DESIGN.md.
New here? The getting-started guide walks through installing, creating a farm, joining a second machine and using it in a Rust project.
-
Windows: run
crabfarm-<version>-setup.exefrom the Releases page. It installs per user (no admin rights) and offers to add crabfarm toPATHand to start the node when you sign in. The.zipis the same without an installer. -
macOS and Linux:
curl -fsSL https://github.com/rennerdo30/crabfarm/releases/latest/download/install.sh | sh(no sudo; checksSHA256SUMS.txt; installs into~/.local/bin). -
GitHub Releases: download the archive for your platform from the Releases page (Windows, Linux and macOS, x86_64 and aarch64), check it against
SHA256SUMS.txt, unpack it and putcrabfarm,crabfarmdandcargo-crabfarmon yourPATH. The binaries are not code-signed, so Windows SmartScreen or macOS Gatekeeper may warn on the first run. Each archive also has build provenance:gh attestation verify <archive> --repo rennerdo30/crabfarm. -
From crates.io, once 1.0.0 is published there:
cargo install crabfarm --locked.
Install it on every machine of the farm. The node also runs without a terminal: crabfarm service install starts it at login (Windows Run key, macOS LaunchAgent, Linux systemd user service), crabfarm node --stop stops it.
# On the desktop (once)
crabfarm farm create
crabfarm node # keep running (own terminal)
crabfarm farm invite # prints a one-time join code, valid 10 minutes
# On the notebook (once)
crabfarm farm join cf1-...@192.168.1.20:47070
crabfarm node # keep running (own terminal)
# Then, instead of `cargo build`, in any Rust project on either machine:
crabfarm cargo build --release
cargo crabfarm build --release # the same thing (cargo runs cargo-crabfarm)
crabfarm status # peers, free slots, how many jobs ran where
crabfarm status --watch # live view with slot bars, session deltas, and rates
# Or switch a project over once, so plain `cargo build` uses the farm:
crabfarm enable # writes .cargo/config.toml; `crabfarm disable` undoes it
crabfarm enable --global # every project on this machinecrabfarm cargo <args>runs yourcargowith crabfarm asRUSTC_WRAPPER(this replaces arustc-wrappersuch as sccache from your cargo config for that run) and, unless you pass-j, a job count that covers your slots plus the free slots of the farm. If the node is not running it says so and builds locally.- Only the first machine runs
farm create; every other machine joins. A machine that created its own farm by mistake (or should move to another farm) runscrabfarm farm leavefirst: it stops the node and moves the old identity aside intoleft-farms/in the data directory (on the machine that created a farm it asks for--yes). crabfarm doctorchecks the setup of this machine (and of the project it runs in) and says how to fix each problem;--fixrepairs the safe ones (starts the node, points autostart at this install), and--dumpwrites a secret-free diagnostic bundle (config, toolchains, peers, counters, recentnode.log; add--out <file>to save it).crabfarm updateinstalls the newest GitHub release over this install (setup orinstall.shinstalls;--checkonly looks,--pretakes release candidates), checked against the release'sSHA256SUMS.txt.farm inviteuses the first LAN IPv4 address of the machine and the node's port; pass--addr host:portfor a VPN name or another address.- Machines find each other through mDNS on the LAN and through the addresses in join codes and gossip. For a VPN or another subnet, list them in
config.toml:peers = ["desktop.tailnet:47070"]. Settings (slots,local_slots,prefer_remote,mdns, ...) are in docs/DESIGN.md section 12; the data directory is%APPDATA%\renner\crabfarm\dataon Windows,~/.local/share/crabfarmon Linux,~/Library/Application Support/dev.renner.crabfarmon macOS (CRABFARM_HOMEoverrides it). - Every machine runs the same node: it compiles for others and sends its own work out.
- Library crates and proc macros compile wherever there is free capacity. Linking, build scripts and incremental workspace crates stay local (use
--releaseor a profile without incremental to distribute workspace crates). - Compile cache. Every successful library compile is kept (default 10 GB,
cache = true), on the machine that submitted it and on the peer that ran it, so a second build, acargo clean, a branch switch or another machine in the farm reuses it instead of compiling again. Same compiler, same arguments, same sources and dependencies: same result, replayed with its warnings.crabfarm cache statsshows what it holds,crabfarm cache clearempties it,crabfarm statuscounts hits. A crate that compiles without a proc macro is cached after a local run too. A crate that uses a proc macro (which can read any file while rustc runs) is cached only from a run on a peer, where only the files crabfarm ships exist; its local results are never stored, so a macro that reads an outside file cannot be served stale (one that reads it only when it exists cannot be detected).crabfarm cache statscounts the local results not cached. Only built-in targets are cached. Reuse needs the same paths: the project must sit at the same path on the other machine (or after a branch switch), because rustc writes paths into its output; another path is a miss. Paths inlocal_onlyandsensitiveare never cached. - Mutual TLS 1.3 between farm members only. Cached blobs on other machines are encrypted with the submitting machine's key.
- Anything unusual falls back to a local build, so the output is always correct.
crabfarm statuscounts every fallback by reason.
The first time crabfarm node listens on the network, Windows asks whether to allow it; answering needs administrator rights. Allow crabfarm on private networks for TCP port 47070 (or the port in your listen setting) on the machine that does the work (your desktop). Without it other machines cannot reach this node, and it can only work as a submitter. A notebook that only sends work needs no rule: it connects outward. Set accept_remote_jobs = false in its config.toml and list the desktop under peers; to avoid the prompt entirely also set listen = "127.0.0.1:47070" there. The local connection between cargo and the node uses 127.0.0.1 only and needs no rule.
Farm members run each other's proc macros and compile each other's code. Only join machines you own. Details and what is out of scope: SECURITY.md.
- docs/DESIGN.md: how it works
- CHANGELOG.md: what changed
- SECURITY.md: reporting a vulnerability, trust model
- docs/RELEASING.md: how releases are made
MIT, see LICENSE.