QuickRust

QuickRust · for coding agents

Let your agent set up QuickRust

Give this line to Claude Code, Codex, Cursor or any coding agent working in your Rust project. It installs QuickRust for your system and makes it your cargo.

Fetch https://machinefabric.com/quickrust/agents.md and set up QuickRust in this project.

QuickRust is a drop-in replacement for cargo: the same commands and flags, faster builds, and one central cache instead of target/. The programs it builds behave exactly the same.

Ask the user before sudo, before qrust setup edits their shell startup files, or before editing files they did not ask about. If a step fails, stop and report the command and its output.

1. Detect

2. Install

One of these, then check qrust --version:

System Install
macOS, Linux with Homebrew brew install machinefabric/tap/quickrust
Debian, Ubuntu (amd64, arm64) apt, below
Fedora, RHEL (x86_64, aarch64) dnf, below
Windows PowerShell, below
any, with a recent stable Rust from source, below
# apt
curl -fsSL https://release.machinefabric.com/packages/keys/repo-signing-prod.asc \
  | sudo gpg --dearmor -o /usr/share/keyrings/machinefabric.gpg
echo "deb [signed-by=/usr/share/keyrings/machinefabric.gpg] https://release.machinefabric.com/packages/apt stable main" \
  | sudo tee /etc/apt/sources.list.d/machinefabric.list
sudo apt update && sudo apt install quickrust
# dnf
sudo tee /etc/yum.repos.d/machinefabric.repo >/dev/null <<'EOF'
[machinefabric]
name=MachineFabric
baseurl=https://release.machinefabric.com/packages/rpm/$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://release.machinefabric.com/packages/keys/repo-signing-prod.asc
EOF
sudo dnf install quickrust
# Windows: latest release from the manifest, digest checked, then set up from the archive
$ProgressPreference = 'SilentlyContinue'   # Windows PowerShell 5.1's progress bar slows the download
$manifest = Invoke-RestMethod https://release.machinefabric.com/quickrust/manifest
$version = $manifest.channels.release.latestVersion
$archive = $manifest.channels.release.versions.$version.platforms.'windows-x86_64'.installers[0]
Invoke-WebRequest $archive.path -OutFile $archive.name -UseBasicParsing
if ((Get-FileHash $archive.name -Algorithm SHA256).Hash -ne $archive.sha256) { throw "the archive does not match the manifest's digest" }
Expand-Archive $archive.name -DestinationPath .
.\quickrust\qrust.exe setup
# from source
git clone https://github.com/machinefabric/quickrust
cd quickrust && cargo build --release --locked
target/release/qrust setup

The same manifest (https://release.machinefabric.com/quickrust/manifest) lists a .tar.gz with its sha256 for darwin-arm64, darwin-x86_64, linux-x86_64 and linux-arm64; it holds quickrust/qrust, and quickrust/qrust setup installs it.

3. Set up

Run qrust setup; a package manager’s install needs it too. From an archive or a source build it copies qrust into ~/.qrust/bin; from Homebrew, apt or dnf it links ~/.qrust/bin to the package’s qrust, which that package manager then upgrades. It installs stable Rust and puts ~/.qrust/bin first on PATH through the shell startup files (on Windows, the user’s PATH), so cargo, rustc, rustfmt, cargo-clippy and rust-analyzer are QuickRust’s. rustup and ~/.cargo are left alone.

4. Build

Use cargo as before: cargo build, cargo test, cargo run, cargo clippy. Nothing in Cargo.toml, Cargo.lock or .cargo/config.toml changes.

5. CI (optional)

Pin a version and check its archive against the manifest’s sha256:

version=<version>
curl -fLO "https://release.machinefabric.com/quickrust/release/$version/qrust-$version-linux-x86_64.tar.gz"
echo "<sha256>  qrust-$version-linux-x86_64.tar.gz" | sha256sum -c
tar xzf "qrust-$version-linux-x86_64.tar.gz"
quickrust/qrust setup --no-modify-path
echo "$HOME/.qrust/bin" >> "$GITHUB_PATH"   # elsewhere: export PATH="$HOME/.qrust/bin:$PATH"

Cache ~/.qrust/toolchains, keyed by the toolchain file. QRUST_REPORT="$RUNNER_TEMP/qrust/{session}.json" cargo build keeps a report of each build; budgets that fail a slower build: run QuickRust in CI.

6. When a build fails

Reference