From 605f45346557f044ca9b4819859986952936abaa Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Thu, 5 Nov 2026 19:02:23 -0600 Subject: [PATCH 1/5] fix(ci): migrate nightly jobs to new dtolnay/rust-toolchain schema The dtolnay/rust-toolchain action removed the `toolchain:` input (it now installs the rust-toolchain.toml toolchain). Bumping the pin (as #2847 does) silently installs stable 1.96.0 in nightly jobs, breaking the Pyodide wheel (-Z flags), Miri, ASAN (-Z build-std) and fuzz jobs. Install the pinned nightlies explicitly via `rustup toolchain install` (targets/components preserved) and drop the now-dead matrix toolchain input. Supersedes #2847. --- .github/workflows/apidocs-drift.yml | 2 +- .github/workflows/ci.yml | 24 ++++++++++++---------- .github/workflows/coverage.yml | 8 ++++---- .github/workflows/fuzz.yml | 12 +++++++---- .github/workflows/js.yml | 6 +++--- .github/workflows/nightly.yml | 30 +++++++++++++++++----------- .github/workflows/publish-js.yml | 10 +++++----- .github/workflows/publish-python.yml | 13 ++++++------ .github/workflows/python.yml | 13 ++++++------ .github/workflows/site.yml | 2 +- 10 files changed, 68 insertions(+), 52 deletions(-) diff --git a/.github/workflows/apidocs-drift.yml b/.github/workflows/apidocs-drift.yml index 7756fa669..c750974f4 100644 --- a/.github/workflows/apidocs-drift.yml +++ b/.github/workflows/apidocs-drift.yml @@ -82,7 +82,7 @@ jobs: workspaces: crates/bashkit-js - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 # pnpm/action-setup v6 no longer ships a default version; it reads # `packageManager` from the root package.json, which this repo does # not have (the field lives in crates/bashkit-js/package.json). Pin diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f60b274ae..3b7c3eb57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -214,7 +214,7 @@ jobs: # override even for `cargo install`), which broke this job. A prebuilt # binary is immune to future tool-dependency MSRV bumps. - name: Install cargo-audit - uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2 + uses: taiki-e/install-action@b80e2bb2635f28eb98b9fce1e2f0887e1535c6b2 # v2 with: tool: cargo-audit @@ -223,7 +223,7 @@ jobs: # from pnpm-lock.yaml, and the PyPI scan reads uv.lock with the stdlib, # so neither ecosystem costs an install here. - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.33.0 @@ -247,7 +247,7 @@ jobs: command: check licenses sources - name: Install cargo-vet - uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2 + uses: taiki-e/install-action@b80e2bb2635f28eb98b9fce1e2f0887e1535c6b2 # v2 with: # 0.10.2+ parses trusted-publisher entries in imports.lock (wasmtime # crates publish via GitHub trusted publishing); 0.10.0 rejects them. @@ -298,7 +298,7 @@ jobs: - name: Install uutils coreutils multicall for differential tests id: install_uutils continue-on-error: true - uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2 + uses: taiki-e/install-action@b80e2bb2635f28eb98b9fce1e2f0887e1535c6b2 # v2 with: tool: coreutils - name: Verify uutils on PATH @@ -416,9 +416,9 @@ jobs: persist-credentials: false - name: Install Rust toolchain + # 1.96.0 comes from rust-toolchain.toml (the matrix pins the same); + # the action no longer accepts a `toolchain:` input. uses: dtolnay/rust-toolchain@d86e0fa8f147d6539442c26a61ebba8becc19489 # 1.96.0 - with: - toolchain: ${{ matrix.rust }} - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 @@ -650,13 +650,17 @@ jobs: with: persist-credentials: false - - name: Install Rust nightly - uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # nightly - with: + - name: Install Rust stable (default toolchain) + uses: dtolnay/rust-toolchain@d86e0fa8f147d6539442c26a61ebba8becc19489 # 1.96.0 + + # The action no longer accepts a `toolchain:` input (it installs + # the rust-toolchain.toml toolchain), so install the pinned nightly + # explicitly below. # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a # later nightly builds `cargo +nightly check -p bashkit --lib`. - toolchain: nightly-2026-10-30 + - name: Install Rust nightly + run: rustup toolchain install nightly-2026-10-30 --profile minimal - name: Install cargo-fuzz uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2fb0e79b3..65abb7708 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -42,7 +42,7 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 - name: Install cargo-tarpaulin - uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2 + uses: taiki-e/install-action@b80e2bb2635f28eb98b9fce1e2f0887e1535c6b2 # v2 with: tool: cargo-tarpaulin @@ -100,7 +100,7 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 - name: Install cargo-llvm-cov - uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2 + uses: taiki-e/install-action@b80e2bb2635f28eb98b9fce1e2f0887e1535c6b2 # v2 with: tool: cargo-llvm-cov @@ -151,12 +151,12 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 - name: Install cargo-llvm-cov - uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2 + uses: taiki-e/install-action@b80e2bb2635f28eb98b9fce1e2f0887e1535c6b2 # v2 with: tool: cargo-llvm-cov - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.33.0 diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 25a14055d..7ef4e8776 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -33,13 +33,17 @@ jobs: with: persist-credentials: false - - name: Install Rust nightly - uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # nightly - with: + - name: Install Rust stable (default toolchain) + uses: dtolnay/rust-toolchain@d86e0fa8f147d6539442c26a61ebba8becc19489 # 1.96.0 + + # The action no longer accepts a `toolchain:` input (it installs + # the rust-toolchain.toml toolchain), so install the pinned nightly + # explicitly below. # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a # later nightly builds `cargo +nightly check -p bashkit --lib`. - toolchain: nightly-2026-10-30 + - name: Install Rust nightly + run: rustup toolchain install nightly-2026-10-30 --profile minimal - name: Install cargo-fuzz run: cargo install cargo-fuzz --locked diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 7aa5578f7..cc5a5fff8 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -47,7 +47,7 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.33.0 @@ -116,7 +116,7 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.33.0 @@ -275,7 +275,7 @@ jobs: # and an OS, and a restored arm64 `target/` must not reach the x64 # build. prefix-key: v0-rust-${{ matrix.target || 'host' }} - - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.33.0 - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 47ee364a7..542b3debf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -25,14 +25,17 @@ jobs: with: persist-credentials: false - - name: Install Rust nightly with Miri - uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # nightly - with: + - name: Install Rust stable (default toolchain) + uses: dtolnay/rust-toolchain@d86e0fa8f147d6539442c26a61ebba8becc19489 # 1.96.0 + + # The action no longer accepts a `toolchain:` input (it installs + # the rust-toolchain.toml toolchain), so install the pinned nightly + # explicitly below. # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a # later nightly builds `cargo +nightly check -p bashkit --lib`. - toolchain: nightly-2026-10-30 - components: miri + - name: Install Rust nightly with Miri + run: rustup toolchain install nightly-2026-10-30 --profile minimal --component miri - name: Setup Miri run: cargo +nightly-2026-10-30 miri setup @@ -67,14 +70,14 @@ jobs: # dependencies resolve unlocked, and an MSRV bump in one of them past our # pinned toolchain broke this step once already in CI. - name: Install cargo-audit - uses: taiki-e/install-action@682ce6c3c696a4cd5168a05f98e51aa02b877941 # v2 + uses: taiki-e/install-action@b80e2bb2635f28eb98b9fce1e2f0887e1535c6b2 # v2 with: tool: cargo-audit # pnpm (and the node it needs) for the npm half of the scan; the PyPI # half reads uv.lock with the stdlib. Neither needs an install step. - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.33.0 @@ -147,14 +150,17 @@ jobs: - name: Free disk space uses: ./.github/actions/free-disk-space - - name: Install Rust nightly - uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # nightly - with: + - name: Install Rust stable (default toolchain) + uses: dtolnay/rust-toolchain@d86e0fa8f147d6539442c26a61ebba8becc19489 # 1.96.0 + + # The action no longer accepts a `toolchain:` input (it installs + # the rust-toolchain.toml toolchain), so install the pinned nightly + # explicitly below. # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a # later nightly builds `cargo +nightly check -p bashkit --lib`. - toolchain: nightly-2026-10-30 - components: rust-src + - name: Install Rust nightly with rust-src for build-std + run: rustup toolchain install nightly-2026-10-30 --profile minimal --component rust-src - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 with: diff --git a/.github/workflows/publish-js.yml b/.github/workflows/publish-js.yml index 039d7421d..1a9eb3604 100644 --- a/.github/workflows/publish-js.yml +++ b/.github/workflows/publish-js.yml @@ -98,7 +98,7 @@ jobs: persist-credentials: false - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.33.0 @@ -217,7 +217,7 @@ jobs: git checkout FETCH_HEAD -- crates/bashkit-js/__test__ - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.33.0 @@ -353,7 +353,7 @@ jobs: git checkout FETCH_HEAD -- crates/bashkit-js/__test__ - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.33.0 @@ -479,7 +479,7 @@ jobs: # steps: # - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # - name: Setup pnpm - # uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + # uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 # with: # version: 10.33.0 # - name: Setup node @@ -536,7 +536,7 @@ jobs: run: test "$(git rev-parse HEAD)" = "$SOURCE_SHA" - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.33.0 diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index cc8e80f90..1358c9e3a 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -151,13 +151,14 @@ jobs: # nightly satisfies our deps' MSRV (monty needs 1.96) + edition 2024; # its LLVM matches Emscripten 4.0.9's binaryen. pyodide-build manages its # own matching emsdk via the cross-build env (no setup-emsdk needed). + - name: Install Rust stable (default toolchain) + uses: dtolnay/rust-toolchain@d86e0fa8f147d6539442c26a61ebba8becc19489 # 1.96.0 + + # The action no longer accepts a `toolchain:` input (it installs + # the rust-toolchain.toml toolchain), so install the pinned nightly + # explicitly below. - name: Install nightly Rust with the Emscripten target - # @nightly matches the repo's other nightly jobs; the exact nightly is - # pinned via the toolchain: input below. - uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # nightly - with: - toolchain: ${{ env.RUST_NIGHTLY }} - targets: wasm32-unknown-emscripten + run: rustup toolchain install ${{ env.RUST_NIGHTLY }} --profile minimal --target wasm32-unknown-emscripten - name: Install pyodide-build run: pip install "pyodide-build==${PYODIDE_BUILD_VERSION}" diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 524b33b4c..da8d21080 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -285,13 +285,14 @@ jobs: # so it has to be recent; its LLVM (19+) matches Emscripten 4.0.9's # binaryen, which is what avoids the wasm-opt target-feature skew that # older Emscripten (3.1.x) hit. See knowledge/runtimes/emscripten-wheels.md. + - name: Install Rust stable (default toolchain) + uses: dtolnay/rust-toolchain@d86e0fa8f147d6539442c26a61ebba8becc19489 # 1.96.0 + + # The action no longer accepts a `toolchain:` input (it installs + # the rust-toolchain.toml toolchain), so install the pinned nightly + # explicitly below. - name: Install nightly Rust with the Emscripten target - # @nightly matches the repo's other nightly jobs (fuzz.yml, nightly.yml, - # ci.yml); the exact nightly is pinned via the toolchain: input below. - uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # nightly - with: - toolchain: ${{ env.RUST_NIGHTLY }} - targets: wasm32-unknown-emscripten + run: rustup toolchain install ${{ env.RUST_NIGHTLY }} --profile minimal --target wasm32-unknown-emscripten - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index c0d2e7181..4d687a466 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -60,7 +60,7 @@ jobs: with: persist-credentials: false - name: Setup pnpm - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: version: 10.11.1 - name: Setup Node.js From 5e9f320cf10d9f21d1c7ab3d577f162da25a99e8 Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Thu, 5 Nov 2026 23:00:06 -0600 Subject: [PATCH 2/5] test(ci): teach pin test the explicit rustup nightly spelling The toolchain action dropped its toolchain: input, so nightly jobs now install via run: rustup toolchain install nightly-.... The exempt-nightly detector only knew the legacy # nightly action-ref spelling and failed the migrated jobs (plus misclassified cargo-fuzz). Detect both; the discovery guard accepts either. --- scripts/tests/test_pinned_ci_tools.py | 37 +++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/scripts/tests/test_pinned_ci_tools.py b/scripts/tests/test_pinned_ci_tools.py index 7a452bc1d..cabbd489e 100644 --- a/scripts/tests/test_pinned_ci_tools.py +++ b/scripts/tests/test_pinned_ci_tools.py @@ -6,7 +6,7 @@ tool resolves to the newest release and an upstream MSRV bump breaks a tree that has not changed: cargo-geiger 0.14.0 shipped on 2026-10-12 requiring rustc 1.97, and nightly run 259 went red the next morning with the unsafe-code audit -skipped. A job that installs the nightly toolchain is exempt — nightly outruns +skipped. A job that installs a pinned nightly toolchain is exempt (either spelling below) — nightly outruns any released MSRV — which is why `cargo-fuzz` in the fuzz job needs no pin. The first attempt at pinning geiger passed `version: 0.13.0`. That action has @@ -64,6 +64,19 @@ def nightly_toolchain_shas(): return shas +# The toolchain action removed its `toolchain:` input, so newer jobs install +# the pinned nightly with an explicit run step instead of a `# nightly`-marked +# action ref. Both spellings mark a nightly job. +RUSTUP_NIGHTLY_INSTALL = re.compile(r'rustup\s+toolchain\s+install\s+\S*nightly') + + +def job_installs_nightly_via_rustup(job): + for step in job.get('steps') or []: + if RUSTUP_NIGHTLY_INSTALL.search(step.get('run') or ''): + return True + return False + + def job_uses_nightly(job, nightly_shas): for step in job.get('steps') or []: uses = step.get('uses') or '' @@ -71,7 +84,19 @@ def job_uses_nightly(job, nightly_shas): _, _, ref = uses.partition('@') if ref in nightly_shas: return True - return False + return job_installs_nightly_via_rustup(job) + + +def nightly_job_ids(): + """`workflow:job` ids installing a nightly toolchain, either spelling.""" + shas = nightly_toolchain_shas() + ids = set() + for path in sorted(WORKFLOWS.glob('*.yml')): + spec = yaml.safe_load(path.read_text()) + for job_name, job in (spec.get('jobs') or {}).items(): + if job_uses_nightly(job, shas): + ids.add(f'{path.name}:{job_name}') + return ids def source_build_steps(): @@ -93,9 +118,11 @@ def test_discovery_finds_both_kinds_of_job(self): steps = list(source_build_steps()) self.assertTrue(steps, f'no {SOURCE_BUILD_ACTION} steps found') self.assertTrue( - nightly_toolchain_shas(), - f'no `{TOOLCHAIN_ACTION}@ # nightly` ref found; the comment ' - 'spelling this parser relies on may have changed', + nightly_job_ids(), + f'no nightly toolchain install found (neither a ' + f'`{TOOLCHAIN_ACTION}@ # nightly` ref nor a ' + '`rustup toolchain install nightly-...` step); the spelling ' + 'this parser relies on may have changed', ) def test_tools_on_the_pinned_toolchain_pin_a_version(self): From ca08a8ee3b3183c0fccc4d2842ba75af36523107 Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Sat, 7 Nov 2026 12:39:02 +0000 Subject: [PATCH 3/5] fix(ci): keep source-built cargo-fuzz on the nightly after the toolchain migration The toolchain action no longer accepts `toolchain:`, so the nightly jobs install the pinned nightly alongside a stable default and select it per command. `cargo install` does not follow that selection: both cargo-fuzz installs (the cache-cargo-install-action step in ci.yml's fuzz-check and the bare `cargo install` in fuzz.yml) silently moved onto the pinned stable, where an unpinned source build resolves to the newest release and an upstream MSRV bump breaks an unchanged tree. That is the cargo-geiger 0.14.0 failure the pin test exists to prevent. test_pinned_ci_tools read the nightly exemption per job, so a job that merely installed a nightly somewhere exempted every source build in it. It now reads per step: a step is exempt only when its own cargo resolves to a nightly, via `RUSTUP_TOOLCHAIN` or `cargo +nightly-...`. The check also covers bare `cargo install` run steps, which carry the same hazard in a spelling the test did not look at. Also re-indents the nightly pin comment the migration orphaned at `with:` depth in ci.yml, fuzz.yml and nightly.yml. Claude-Session: https://claude.ai/code/session_01Wy7MByvAMwapenBYpmq9HN --- .github/workflows/ci.yml | 13 ++- .github/workflows/fuzz.yml | 10 ++- .github/workflows/nightly.yml | 12 +-- knowledge/operations/dependencies.md | 28 ++++++ scripts/tests/test_pinned_ci_tools.py | 123 ++++++++++++++++++++++++-- 5 files changed, 164 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 847ecd1ee..7e1aefa93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -661,14 +661,21 @@ jobs: # The action no longer accepts a `toolchain:` input (it installs # the rust-toolchain.toml toolchain), so install the pinned nightly # explicitly below. - # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit - # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a - # later nightly builds `cargo +nightly check -p bashkit --lib`. + # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit + # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a + # later nightly builds `cargo +nightly check -p bashkit --lib`. - name: Install Rust nightly run: rustup toolchain install nightly-2026-10-30 --profile minimal + # Builds from source on the job's default toolchain, which is now the + # pinned stable; without this the unpinned tool would resolve to the + # newest release and an upstream MSRV bump would break an unchanged + # tree (the cargo-geiger 0.14.0 failure). Nightly outruns any released + # MSRV, so build it there, as the `toolchain:` input used to. - name: Install cargo-fuzz uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3 + env: + RUSTUP_TOOLCHAIN: nightly-2026-10-30 with: tool: cargo-fuzz locked: true diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index bf1d79e39..eaf135246 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -39,14 +39,16 @@ jobs: # The action no longer accepts a `toolchain:` input (it installs # the rust-toolchain.toml toolchain), so install the pinned nightly # explicitly below. - # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit - # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a - # later nightly builds `cargo +nightly check -p bashkit --lib`. + # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit + # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a + # later nightly builds `cargo +nightly check -p bashkit --lib`. - name: Install Rust nightly run: rustup toolchain install nightly-2026-10-30 --profile minimal + # On the nightly, not the pinned stable default: an unpinned source + # build on a pinned toolchain breaks when upstream raises its MSRV. - name: Install cargo-fuzz - run: cargo install cargo-fuzz --locked + run: cargo +nightly-2026-10-30 install cargo-fuzz --locked - name: Cache fuzz corpus uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d92052163..67681132f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -31,9 +31,9 @@ jobs: # The action no longer accepts a `toolchain:` input (it installs # the rust-toolchain.toml toolchain), so install the pinned nightly # explicitly below. - # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit - # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a - # later nightly builds `cargo +nightly check -p bashkit --lib`. + # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit + # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a + # later nightly builds `cargo +nightly check -p bashkit --lib`. - name: Install Rust nightly with Miri run: rustup toolchain install nightly-2026-10-30 --profile minimal --component miri @@ -156,9 +156,9 @@ jobs: # The action no longer accepts a `toolchain:` input (it installs # the rust-toolchain.toml toolchain), so install the pinned nightly # explicitly below. - # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit - # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a - # later nightly builds `cargo +nightly check -p bashkit --lib`. + # Pinned: nightly 2026-10-31 (rustc f9ceb4a4d) fails to compile bashkit + # (E0391 async-drop cycle on parser::ast::CommandList). Unpin once a + # later nightly builds `cargo +nightly check -p bashkit --lib`. - name: Install Rust nightly with rust-src for build-std run: rustup toolchain install nightly-2026-10-30 --profile minimal --component rust-src diff --git a/knowledge/operations/dependencies.md b/knowledge/operations/dependencies.md index 0b9878e81..4b0b008e6 100644 --- a/knowledge/operations/dependencies.md +++ b/knowledge/operations/dependencies.md @@ -210,6 +210,34 @@ the vendored parser in one deliberate change — not inside an aggregated `scripts/tests/test_dependabot_coverage.py` enforces all three. +## A source-built CI tool rides the toolchain of the step that installs it + +`taiki-e/cache-cargo-install-action` and a bare `cargo install` both build from +source, so the tool version they can resolve is bounded by the toolchain active +*in that step*. On the pinned toolchain an unpinned tool resolves to the newest +release, and an upstream MSRV bump then breaks a tree that has not changed: +cargo-geiger 0.14.0 shipped requiring rustc 1.97 and nightly run 259 went red +the next morning with the unsafe-code audit skipped. + +Two ways out, and the choice is per step: pin the version (`tool: name@version` +where the action reads it, or `--version`), or build on a nightly, which +outruns any released MSRV. + +Which toolchain a step gets changed with the `dtolnay/rust-toolchain` schema. +The action dropped its `toolchain:` input and now always installs the +`rust-toolchain.toml` toolchain, so a job wanting nightly installs it +*alongside* the stable default (`rustup toolchain install nightly-`) and +selects it per command (`cargo +nightly- fuzz build`). A `cargo install` +in such a job therefore gets **stable**, not nightly, unless it says otherwise +— via `RUSTUP_TOOLCHAIN` on the step or `cargo +nightly-` in its `run`. +Both cargo-fuzz installs needed that opt-in when the jobs migrated; reading the +exemption per job instead of per step would have reopened the geiger hole. + +`scripts/tests/test_pinned_ci_tools.py` enforces this, and also rejects an +input the action silently drops — a pin that looks right and does nothing is +worse than no pin, because the job keeps reporting the failure it was meant to +fix. + ## Measure size and audit surface separately The `idna_adapter` pin removes 21 crates but only **15 KB (0.16%)** from the diff --git a/scripts/tests/test_pinned_ci_tools.py b/scripts/tests/test_pinned_ci_tools.py index cabbd489e..9ed266ee9 100644 --- a/scripts/tests/test_pinned_ci_tools.py +++ b/scripts/tests/test_pinned_ci_tools.py @@ -6,8 +6,17 @@ tool resolves to the newest release and an upstream MSRV bump breaks a tree that has not changed: cargo-geiger 0.14.0 shipped on 2026-10-12 requiring rustc 1.97, and nightly run 259 went red the next morning with the unsafe-code audit -skipped. A job that installs a pinned nightly toolchain is exempt (either spelling below) — nightly outruns -any released MSRV — which is why `cargo-fuzz` in the fuzz job needs no pin. +skipped. A step that *runs on* a pinned nightly is exempt — nightly outruns any +released MSRV — which is why `cargo-fuzz` needs no pin. + +"Runs on nightly" is a property of the step, not of the job. The toolchain +action dropped its `toolchain:` input, so a job that wants nightly now installs +it alongside a stable default (`rustup toolchain install nightly-...`) and +selects it per command (`cargo +nightly-... fuzz build`). A `cargo install` in +such a job gets the *stable* default unless it opts in, so merely containing a +nightly install no longer exempts a step: it must name the nightly itself, via +`RUSTUP_TOOLCHAIN` on the step or `cargo +nightly-...` in its `run`. Exempting +per job here would have silently reopened the geiger hole for `cargo-fuzz`. The first attempt at pinning geiger passed `version: 0.13.0`. That action has no `version` input, and GitHub Actions treats an unknown input as a warning @@ -66,9 +75,16 @@ def nightly_toolchain_shas(): # The toolchain action removed its `toolchain:` input, so newer jobs install # the pinned nightly with an explicit run step instead of a `# nightly`-marked -# action ref. Both spellings mark a nightly job. +# action ref. Either spelling marks the job as *having* a nightly available. RUSTUP_NIGHTLY_INSTALL = re.compile(r'rustup\s+toolchain\s+install\s+\S*nightly') +# `cargo +nightly-2026-10-30 install ...` — the per-command toolchain selector. +CARGO_PLUS_NIGHTLY = re.compile(r'cargo\s+\+\S*nightly') + + +def _is_nightly(name): + return 'nightly' in (name or '') + def job_installs_nightly_via_rustup(job): for step in job.get('steps') or []: @@ -77,24 +93,48 @@ def job_installs_nightly_via_rustup(job): return False -def job_uses_nightly(job, nightly_shas): +def job_default_is_nightly(job, nightly_shas): + """True when the job's *default* toolchain is a nightly. + + Only the old `dtolnay/rust-toolchain@ # nightly` ref does this. The + rustup spelling installs nightly next to the stable default, so commands + there get stable unless they ask for nightly. + """ for step in job.get('steps') or []: uses = step.get('uses') or '' if TOOLCHAIN_ACTION in uses: _, _, ref = uses.partition('@') if ref in nightly_shas: return True - return job_installs_nightly_via_rustup(job) + return False + + +def job_has_nightly(job, nightly_shas): + """True when the job sets up a nightly at all, in either spelling.""" + return job_default_is_nightly(job, nightly_shas) or ( + job_installs_nightly_via_rustup(job) + ) + + +def step_runs_on_nightly(job, step, nightly_shas): + """True when this step's `cargo` resolves to a nightly toolchain.""" + if job_default_is_nightly(job, nightly_shas): + return True + # Opt-in, in the two spellings that actually redirect cargo. + env = {**(job.get('env') or {}), **(step.get('env') or {})} + if _is_nightly(env.get('RUSTUP_TOOLCHAIN')): + return True + return bool(CARGO_PLUS_NIGHTLY.search(step.get('run') or '')) def nightly_job_ids(): - """`workflow:job` ids installing a nightly toolchain, either spelling.""" + """`workflow:job` ids setting up a nightly toolchain, either spelling.""" shas = nightly_toolchain_shas() ids = set() for path in sorted(WORKFLOWS.glob('*.yml')): spec = yaml.safe_load(path.read_text()) for job_name, job in (spec.get('jobs') or {}).items(): - if job_uses_nightly(job, shas): + if job_has_nightly(job, shas): ids.add(f'{path.name}:{job_name}') return ids @@ -105,10 +145,45 @@ def source_build_steps(): for path in sorted(WORKFLOWS.glob('*.yml')): spec = yaml.safe_load(path.read_text()) for job_name, job in (spec.get('jobs') or {}).items(): - on_nightly = job_uses_nightly(job, nightly_shas) for step in job.get('steps') or []: if SOURCE_BUILD_ACTION in (step.get('uses') or ''): - yield path.name, job_name, step, on_nightly + yield ( + path.name, + job_name, + step, + step_runs_on_nightly(job, step, nightly_shas), + ) + + +# `cargo install ` in a `run:` block builds from source just like the +# action does, so it carries the same MSRV hazard and needs the same pin. +CARGO_INSTALL = re.compile( + r'cargo\s+(?:\+\S+\s+)?install\s+(?P[^\n]*)' +) + + +def cargo_install_run_steps(): + """(workflow, job, tool, pinned, on_nightly) per `cargo install` run step.""" + nightly_shas = nightly_toolchain_shas() + for path in sorted(WORKFLOWS.glob('*.yml')): + spec = yaml.safe_load(path.read_text()) + for job_name, job in (spec.get('jobs') or {}).items(): + for step in job.get('steps') or []: + run = step.get('run') or '' + for match in CARGO_INSTALL.finditer(run): + rest = match.group('rest').split() + tools = [arg for arg in rest if not arg.startswith('-')] + if not tools: + continue + tool = tools[0] + pinned = '--version' in rest or '@' in tool + yield ( + path.name, + job_name, + tool, + pinned, + step_runs_on_nightly(job, step, nightly_shas), + ) class PinnedCiToolTests(unittest.TestCase): @@ -124,6 +199,36 @@ def test_discovery_finds_both_kinds_of_job(self): '`rustup toolchain install nightly-...` step); the spelling ' 'this parser relies on may have changed', ) + self.assertTrue( + list(cargo_install_run_steps()), + 'no `cargo install` run steps found; the spelling this parser ' + 'relies on may have changed', + ) + # The exemption is worth nothing if nothing is ever exempt. + on_nightly = [ + True for *_, nightly in source_build_steps() if nightly + ] + [True for *_, nightly in cargo_install_run_steps() if nightly] + self.assertTrue( + on_nightly, + 'no source-built tool runs on nightly; the opt-in spellings ' + '(`RUSTUP_TOOLCHAIN`, `cargo +nightly-...`) may have changed', + ) + + def test_cargo_install_on_the_pinned_toolchain_pins_a_version(self): + # Same hazard as the action, different spelling: an unpinned + # `cargo install` on the pinned stable resolves to the newest release. + for workflow, job, tool, pinned, on_nightly in cargo_install_run_steps(): + if on_nightly: + continue + with self.subTest(workflow=workflow, job=job, tool=tool): + self.assertTrue( + pinned, + f'{workflow}:{job} runs `cargo install {tool}` on the ' + 'pinned toolchain with no version; pass `--version ` ' + 'or run it on the nightly (`cargo +nightly-... install`) ' + 'so an upstream MSRV bump cannot break a tree that has ' + 'not changed', + ) def test_tools_on_the_pinned_toolchain_pin_a_version(self): for workflow, job, step, on_nightly in source_build_steps(): From 8292ef9667087f47da43fff9ddf7b07cccdb6116 Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Sat, 7 Nov 2026 13:16:41 +0000 Subject: [PATCH 4/5] fix(test): give the tenant stress soak room under the session exec() cap The nightly soak job added in #2874 has never passed. It runs python_tenant_stress_tests at BASHKIT_STRESS_ROUNDS=300, and one_session_reuses_its_budget_across_many_calls makes 10 * rounds() calls in a single session: 3,000 against a default max_exec_calls of 1,000. It died at call 1,000 on "session exec() call limit exceeded", never reaching what it asserts, which is that memory charged in one call is released at its end. The session cap is not what these tests measure, so tenant() now sets its own with room for the largest soak the file can ask for. MAX_ROUNDS is one constant behind both the BASHKIT_STRESS_ROUNDS bound and that headroom, so the two cannot drift apart again the way they just did. Reproduced at BASHKIT_STRESS_ROUNDS=101 (1,010 calls), which fails identically on the cap and passes with this change. Claude-Session: https://claude.ai/code/session_01Wy7MByvAMwapenBYpmq9HN --- .../integration/python_tenant_stress_tests.rs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/crates/bashkit/tests/integration/python_tenant_stress_tests.rs b/crates/bashkit/tests/integration/python_tenant_stress_tests.rs index 12b923df2..8eef08868 100644 --- a/crates/bashkit/tests/integration/python_tenant_stress_tests.rs +++ b/crates/bashkit/tests/integration/python_tenant_stress_tests.rs @@ -10,17 +10,24 @@ #![cfg(feature = "python")] -use bashkit::{Bash, PythonLimits}; +use bashkit::{Bash, PythonLimits, SessionLimits}; use std::time::Duration; +/// Largest `BASHKIT_STRESS_ROUNDS` accepted, and the basis for the session +/// exec() headroom in `tenant`. Keep the two together: they drifted apart once +/// (see `tenant`) and the soak failed on the cap rather than on its subject. +const MAX_ROUNDS: usize = 1000; + fn rounds() -> usize { std::env::var("BASHKIT_STRESS_ROUNDS") .ok() .map(|v| { v.parse::() .ok() - .filter(|n| (1..=1000).contains(n)) - .unwrap_or_else(|| panic!("BASHKIT_STRESS_ROUNDS must be 1..=1000, got {v:?}")) + .filter(|n| (1..=MAX_ROUNDS).contains(n)) + .unwrap_or_else(|| { + panic!("BASHKIT_STRESS_ROUNDS must be 1..={MAX_ROUNDS}, got {v:?}") + }) }) .unwrap_or(3) } @@ -33,6 +40,13 @@ fn tenant(limit_mib: usize, max_ms: u64) -> Bash { .max_duration(Duration::from_millis(max_ms)) .max_recursion(200), ) + // The session exec() cap (1,000 by default) is not what these tests + // measure, and the soak multiplies their call counts straight through + // it: at BASHKIT_STRESS_ROUNDS=300 the budget-reuse test makes 3,000 + // calls and died on the cap at call 1,000 with "session exec() call + // limit exceeded", never reaching what it asserts. Sized off + // MAX_ROUNDS so the largest soak this file can ask for still fits. + .session_limits(SessionLimits::default().max_exec_calls(20 * MAX_ROUNDS as u64)) .env("BASHKIT_ALLOW_INPROCESS_PYTHON", "1") .build() } From 671d2d04e7da5e899e07093334ab81c27120f29e Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Sat, 7 Nov 2026 13:21:05 +0000 Subject: [PATCH 5/5] fix(ci): follow an env indirection when detecting a job's nightly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The nightly detector required a literal `nightly` token, so a job naming its nightly through a variable was read as not having one. Both Pyodide jobs do exactly that — `rustup toolchain install ${{ env.RUST_NIGHTLY }}` with `RUSTUP_TOOLCHAIN` set to the same expression — which is the opt-in route this same change introduced, so the "either spelling" claim was not true of the tree it runs against. Nothing is mis-exempted today (neither job builds a tool from source), but a source build added there would be told to pin a tool that is already on a nightly. `${{ env.NAME }}` is now resolved against step, job and workflow `env` before the nightly test. An unresolved reference is left as written so the variable's own name cannot stand in for its value: `RUST_NIGHTLY` is not evidence that what it holds is a nightly. The new test asserts it over the real workflows rather than a fixture: every job installing a toolchain through rustup must be discovered, and a step pinning `RUSTUP_TOOLCHAIN` to its job's nightly must count as running on it. Six jobs covered, including the two that were missed. Claude-Session: https://claude.ai/code/session_01Wy7MByvAMwapenBYpmq9HN --- scripts/tests/test_pinned_ci_tools.py | 96 +++++++++++++++++++++++---- 1 file changed, 82 insertions(+), 14 deletions(-) diff --git a/scripts/tests/test_pinned_ci_tools.py b/scripts/tests/test_pinned_ci_tools.py index 9ed266ee9..74c40a82e 100644 --- a/scripts/tests/test_pinned_ci_tools.py +++ b/scripts/tests/test_pinned_ci_tools.py @@ -15,7 +15,8 @@ selects it per command (`cargo +nightly-... fuzz build`). A `cargo install` in such a job gets the *stable* default unless it opts in, so merely containing a nightly install no longer exempts a step: it must name the nightly itself, via -`RUSTUP_TOOLCHAIN` on the step or `cargo +nightly-...` in its `run`. Exempting +`RUSTUP_TOOLCHAIN` on the step or `cargo +nightly-...` in its `run`, either +of which may name the nightly through `${{ env.X }}`. Exempting per job here would have silently reopened the geiger hole for `cargo-fuzz`. The first attempt at pinning geiger passed `version: 0.13.0`. That action has @@ -80,15 +81,44 @@ def nightly_toolchain_shas(): # `cargo +nightly-2026-10-30 install ...` — the per-command toolchain selector. CARGO_PLUS_NIGHTLY = re.compile(r'cargo\s+\+\S*nightly') +# `${{ env.RUST_NIGHTLY }}` — a job naming its nightly through a variable. +ENV_EXPR = re.compile(r'\$\{\{\s*env\.([A-Za-z_][A-Za-z0-9_]*)\s*\}\}') -def _is_nightly(name): - return 'nightly' in (name or '') +def env_scopes(spec, job, step=None): + """`env` mappings that apply to a step, innermost first.""" + return [ + (step or {}).get('env') or {}, + job.get('env') or {}, + spec.get('env') or {}, + ] -def job_installs_nightly_via_rustup(job): +def resolve_env(value, scopes): + """`value` with `${{ env.NAME }}` replaced from the first scope defining NAME. + + An unresolved reference is left as written, which keeps `_is_nightly` + false rather than matching the variable's own name: `RUST_NIGHTLY` is not + evidence that what it holds is a nightly. + """ + def sub(match): + name = match.group(1) + for scope in scopes: + if name in scope: + return str(scope[name]) + return match.group(0) + + return ENV_EXPR.sub(sub, value or '') + + +def _is_nightly(value, scopes=()): + return 'nightly' in resolve_env(value, scopes) + + +def job_installs_nightly_via_rustup(spec, job): for step in job.get('steps') or []: - if RUSTUP_NIGHTLY_INSTALL.search(step.get('run') or ''): + run = resolve_env(step.get('run') or '', env_scopes(spec, job, step)) + if RUSTUP_NIGHTLY_INSTALL.search(run): return True return False @@ -109,22 +139,25 @@ def job_default_is_nightly(job, nightly_shas): return False -def job_has_nightly(job, nightly_shas): +def job_has_nightly(spec, job, nightly_shas): """True when the job sets up a nightly at all, in either spelling.""" return job_default_is_nightly(job, nightly_shas) or ( - job_installs_nightly_via_rustup(job) + job_installs_nightly_via_rustup(spec, job) ) -def step_runs_on_nightly(job, step, nightly_shas): +def step_runs_on_nightly(spec, job, step, nightly_shas): """True when this step's `cargo` resolves to a nightly toolchain.""" if job_default_is_nightly(job, nightly_shas): return True - # Opt-in, in the two spellings that actually redirect cargo. + # Opt-in, in the two spellings that actually redirect cargo. Both may name + # the nightly through `${{ env.X }}`, which is how the Pyodide jobs do it. + scopes = env_scopes(spec, job, step) env = {**(job.get('env') or {}), **(step.get('env') or {})} - if _is_nightly(env.get('RUSTUP_TOOLCHAIN')): + if _is_nightly(env.get('RUSTUP_TOOLCHAIN'), scopes): return True - return bool(CARGO_PLUS_NIGHTLY.search(step.get('run') or '')) + run = resolve_env(step.get('run') or '', scopes) + return bool(CARGO_PLUS_NIGHTLY.search(run)) def nightly_job_ids(): @@ -134,7 +167,7 @@ def nightly_job_ids(): for path in sorted(WORKFLOWS.glob('*.yml')): spec = yaml.safe_load(path.read_text()) for job_name, job in (spec.get('jobs') or {}).items(): - if job_has_nightly(job, shas): + if job_has_nightly(spec, job, shas): ids.add(f'{path.name}:{job_name}') return ids @@ -151,7 +184,7 @@ def source_build_steps(): path.name, job_name, step, - step_runs_on_nightly(job, step, nightly_shas), + step_runs_on_nightly(spec, job, step, nightly_shas), ) @@ -182,7 +215,7 @@ def cargo_install_run_steps(): job_name, tool, pinned, - step_runs_on_nightly(job, step, nightly_shas), + step_runs_on_nightly(spec, job, step, nightly_shas), ) @@ -230,6 +263,41 @@ def test_cargo_install_on_the_pinned_toolchain_pins_a_version(self): 'not changed', ) + def test_the_detector_follows_an_env_indirection(self): + # A job can name its nightly through a variable: the Pyodide jobs run + # `rustup toolchain install ${{ env.RUST_NIGHTLY }}` and set + # `RUSTUP_TOOLCHAIN` to the same expression — the very route this + # file treats as an opt-in. Matching only a literal `nightly` token + # called those jobs non-nightly, so a source build added there would + # be asked to pin a tool that is already on a nightly. Every job that + # installs a toolchain through rustup must be discovered. + shas = nightly_toolchain_shas() + checked = 0 + for path in sorted(WORKFLOWS.glob('*.yml')): + spec = yaml.safe_load(path.read_text()) + for job_name, job in (spec.get('jobs') or {}).items(): + installs = [ + step for step in job.get('steps') or [] + if 'rustup toolchain install' in (step.get('run') or '') + ] + if not installs: + continue + checked += 1 + with self.subTest(workflow=path.name, job=job_name): + self.assertTrue( + job_has_nightly(spec, job, shas), + f'{path.name}:{job_name} installs a toolchain via rustup ' + 'but the detector does not see a nightly', + ) + for step in installs: + self.assertTrue( + step_runs_on_nightly(spec, job, step, shas) + or not (step.get('env') or {}).get('RUSTUP_TOOLCHAIN'), + 'a step pinning RUSTUP_TOOLCHAIN to this job\'s nightly ' + 'must count as running on it', + ) + self.assertGreaterEqual(checked, 4, 'rustup install jobs not found') + def test_tools_on_the_pinned_toolchain_pin_a_version(self): for workflow, job, step, on_nightly in source_build_steps(): if on_nightly: