1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Rust — what a repo with a Cargo.toml needs in order to be worked on.
#
# Every provide states what it buys (`because`) and, where somebody has taken
# one, what it costs (`measured`). Costs are measured and benefits are argued;
# they are different kinds of claim and this file keeps them apart, exactly as
# the base set does.
= "rust"
= "Cargo.toml"
# Three things here are not obvious, and each was got wrong first:
#
# RUSTUP_HOME/CARGO_HOME under /usr/local — `install` runs as root, so the
# default `$HOME/.rustup` is `/root/.rustup`, and `/root` is mode 700. The
# agent could not read it even if it looked there.
#
# The *toolchain's* binaries are linked, not rustup's shims. A shim resolves
# its toolchain through `$HOME/.rustup` at run time, so a root-installed one
# sends the agent looking in `/home/agent/.rustup`, which does not exist —
# `could not create home directory ... Permission denied`. The real binaries
# under `toolchains/*/bin` need no environment at all.
#
# `-c rustfmt -c clippy` — the minimal profile ships neither, and rustup's
# install-on-demand only happens through the shims this deliberately avoids.
[[]]
= "toolchain"
= ["cargo", "rustc", "rustfmt", "cargo-clippy"]
= "export RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal -c rustfmt -c clippy --no-modify-path && ln -sf /usr/local/rustup/toolchains/*/bin/* /usr/local/bin/ && chmod -R a+rX /usr/local/rustup /usr/local/cargo"
= "cargo is how a rust project is built, tested and formatted; without it neither the agent nor the human can check a change"
# Taken with a *default* profile, which is not what this recipe installs —
# said plainly rather than converted into an estimate, because a number
# nobody took reads exactly like one somebody did.
[[]]
= "on disk, default profile (this recipe installs minimal plus rustfmt and clippy)"
= "1.5 GB"
= "du -sh ~/.rustup after `rustup -y --profile default`, aarch64"
= "2026-08-14"
[[]]
= "of that, the documentation --profile minimal omits"
= "904 MB"
= "du -sh ~/.rustup/toolchains/*/share/doc, same install"
= "2026-08-14"
# rustup delivers a working `cargo` and still cannot produce a binary without a
# linker. The recipe above succeeded on an image with no `cc`, `ld` or `ar`, and
# `cargo test` failed at the last step — which is why `needs` and `install` are
# separate fields, and why this is a provide of its own rather than a line in
# the one above.
[[]]
= "linker"
= ["cc", "ld", "ar"]
= "apt-get update && apt-get install -y --no-install-recommends gcc libc6-dev && rm -rf /var/lib/apt/lists/*"
= "rustc compiles without a linker and then cannot link, so every build fails at the last step"
[[]]
= "on disk"
= "124 MB"
= "sum of dpkg Installed-Size for gcc, gcc-12, libc6-dev, binutils and their deps, aarch64"
= "2026-08-14"