repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

build: bootstrap gate tools through mise and cargo x bootstrap

977023e1334b1e9c406ee0b3eea4b72d15b2c25d

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

cargo-nextest is pinned in mise.toml (aqua prebuilt, checksummed);
cargo_pup ships no binaries, so cargo x bootstrap installs its pinned
version on the pinned nightly after adding rust-src, rustc-dev, and
llvm-tools. cargo x check now runs end to end on a fresh clone with
mise install plus cargo x bootstrap.

Changed files (3)

+80 / −2 text lines

Diff layout

.gitignore

Modified

+2 / −0 text lines

1818# Editor / OS
1919*.swp
2020.DS_Store
22.pup/

mise.toml

Added
new file mode 100644

+9 / −0 text lines

1# Smith tooling.
2# Source of truth: .system/RULES.md (build gates), xtask/src/main.rs (invocation).
3# aqua ships prebuilt cargo-nextest; cargo_pup has no binaries and must be
4# built from source on the pinned nightly, see xtask's bootstrap command.
5[tools]
6"aqua:nextest-rs/nextest/cargo-nextest" = "0.9.144"
7
8[settings]
9experimental = true

xtask/src/main.rs

Modified

+69 / −2 text lines

1414};
1616const HELP: &str = concat!(
17 "usage: cargo x <check|lint|fmt|test|doc|arch|pup|audit>\n",
17 "usage: cargo x <check|lint|fmt|test|doc|arch|pup|audit|bootstrap>\n",
1818 " cargo x dev [args...] build and launch the dev smith binary\n",
1919);
21/// Nightly toolchain pinned for the cargo-pup architecture gate.
22const PINNED_NIGHTLY: &str = "+nightly-2026-01-22";
24/// Version of `cargo_pup` used by the architecture gate.
25const PUP_VERSION: &str = "0.1.8";
2026const CRATES: &[&str] = &[
2127 "smith",
2228 "smith-core",
4955 Some("arch") => arch(),
5056 Some("pup") => cargo_pup(),
5157 Some("audit") => audit(),
58 Some("bootstrap") => bootstrap(),
5259 _ => fail(HELP),
5360 }
99106fn cargo_pup() -> ExitCode {
100 cargo(&["+nightly-2026-01-22", "pup"])
107 cargo(&[PINNED_NIGHTLY, "pup"])
108}
110/// Install the external gate tools that Cargo cannot ship.
111///
112/// `cargo-nextest` comes from mise (see mise.toml); `cargo_pup` has no
113/// published
114/// binaries, so it is built from source on the pinned nightly with its
115/// rustc-dev dependency, which `rustup component add` provides.
116fn bootstrap() -> ExitCode {
117 let steps: [Step; 3] = [add_pup_components, install_pup, report_nextest];
118 sequence(&steps)
119}
121fn add_pup_components() -> ExitCode {
122 run(
123 "rustup",
124 &[
125 "component",
126 "add",
127 "--toolchain",
128 PINNED_NIGHTLY.trim_start_matches('+'),
129 "rust-src",
130 "rustc-dev",
131 "llvm-tools",
132 ],
133 )
134}
136fn install_pup() -> ExitCode {
137 let already = Command::new("cargo")
138 .args([PINNED_NIGHTLY, "pup", "--help"])
139 .stdout(std::process::Stdio::null())
140 .stderr(std::process::Stdio::null())
141 .status()
142 .is_ok_and(|status| status.success());
143 if already {
144 return ExitCode::SUCCESS;
145 }
146 cargo(&[
147 PINNED_NIGHTLY,
148 "install",
149 "cargo_pup",
150 "--version",
151 PUP_VERSION,
152 ])
153}
155fn report_nextest() -> ExitCode {
156 match Command::new("cargo")
157 .args(["nextest", "--version"])
158 .stdout(std::process::Stdio::null())
159 .stderr(std::process::Stdio::null())
160 .status()
161 {
162 Ok(status) if status.success() => ExitCode::SUCCESS,
163 _ => fail(concat!(
164 "cargo-nextest is missing: run `mise install` once,\n",
165 "it provides the pinned cargo-nextest from mise.toml\n",
166 )),
167 }
103170fn cargo_doc() -> ExitCode {