From ba5ed4e6b1a1154d33ce82038199534b51f20e03 Mon Sep 17 00:00:00 2001 From: Omar Ashour Date: Fri, 15 May 2026 16:41:33 +0300 Subject: [PATCH] chore: auto-install cargo-nextest in `just test` `just verify` calls `cargo nextest run` but the justfile did not install cargo-nextest, so new contributors hit `error: no such command: nextest`. Mirror the existing `_target-installed` pattern by adding a `_nextest-installed` recipe that installs cargo-nextest if missing, falling back to 0.9.128 when the latest release's MSRV exceeds the toolchain pinned in `rust-toolchain.toml`. --- justfile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index d52df38..c7374bf 100644 --- a/justfile +++ b/justfile @@ -63,7 +63,7 @@ build *flags: (_target-installed target) print-target: @echo {{ _resolved_target }} -test: (_target-installed target) +test: (_target-installed target) _nextest-installed cargo nextest run {{ _target-option }} --all-features --workspace doctest: @@ -81,3 +81,14 @@ _target-installed target: if ! rustup target list --installed |grep -qF '{{ target }}' 2>/dev/null ; then rustup target add '{{ target }}' fi + +_nextest-installed: + #!/usr/bin/env bash + set -euo pipefail + if cargo nextest --version >/dev/null 2>&1; then + exit 0 + fi + if ! cargo install cargo-nextest --locked; then + echo "Latest cargo-nextest incompatible with current rustc; falling back to 0.9.128" + cargo install cargo-nextest --locked --version 0.9.128 + fi