Skip to content
machinefabricPublic

About

A drop-in replacement for the cargo command that makes Rust builds faster, with nothing to configure. Every build goes into one centrally managed cache, which stays within its limits and gives space back on its own as the disk fills, so Rust builds don't fill up your disk.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

QuickRust

QuickRust is a drop-in replacement for the cargo command that makes Rust builds faster, with nothing to configure. It is the only thing you install: it downloads and manages the Rust toolchains itself (+toolchain, RUSTUP_TOOLCHAIN and rust-toolchain.toml choose, as with rustup) and runs every command, argument for argument, through the toolchain's own Cargo and rustc. Around them it adds what makes builds fast, and it records every build so that it can explain where the time and the disk space went.

OK   Built: 12 compiled, 140 fresh, 37 restored from QuickRust's cache [4.21s]
WARN 23 warnings in app and util: unused_variables x17, dead_code x4, +2 more; `qrust warnings` shows them

What you get on top of an unchanged Cargo:

  • faster builds by default: lighter debug information, rustc's parallel frontend, the wild linker when installed, a global artifact cache shared by every checkout, and early cut-off, which stops a rebuild at a crate whose interface an edit did not change. The program you build behaves exactly the same; settings you make yourself always win.
  • no target/ in your projects: builds live in QuickRust's cache, which keeps itself within a size and a free-space bound.
  • readable output: one status line, errors in full, warnings counted and kept, one line per outcome (OK, FAIL, WARN, NOTE), plain ASCII.
  • answers about builds: timing and the critical path, why each crate rebuilt, duplicated dependencies, build scripts and procedural macros, cache behaviour, disk use.
  • measurement: benchmarks, A/B experiments of build settings, baselines and CI budgets.

How much faster, measured against plain Cargo on real projects: benchmarks/PROGRESS.md. At the latest checkpoint the speed index (the geometric mean of Cargo's time over QuickRust's, across a developer's build loop) is 2.16.

Install

brew install machinefabric/tap/quickrust && qrust setup
# apt, dnf, Windows and archives for every platform: docs/how-to/install.md

From source, with Rust 1.80 or newer:

cargo build --release --locked
target/release/qrust setup

Then open a new shell: cargo is now QuickRust. Details, updates and uninstalling: How to install, update and uninstall QuickRust.

A first look

cargo build                      # through QuickRust
qrust warnings                   # the warnings it counted, in full
qrust analyze                    # everything about the latest build
qrust analyze rebuilds           # why each crate rebuilt
qrust path                       # where the build went
qrust upstream build             # the toolchain's own Cargo with nothing added

Your first build with QuickRust takes ten minutes and shows the rest.

Documentation

The documentation has four parts:

Development

cargo test                      # unit tests, the compatibility corpus and the management-surface suite (real builds)
cargo clippy --all-targets

The suites build with toolchains QuickRust installs into a store shared between runs (QRUSTTEST_TOOLCHAINS, default ~/.cache/qrust-test-toolchains; the first run downloads them), and with crates from a registry served by the test itself. The documentation follows the four-part structure described in docs/README.md; output shown in it is copied from real runs.

About

A drop-in replacement for the cargo command that makes Rust builds faster, with nothing to configure. Every build goes into one centrally managed cache, which stays within its limits and gives space back on its own as the disk fills, so Rust builds don't fill up your disk.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages