Skip to content

Name the Rust toolchain in each verify-cargo.sh call - #650

Merged
yansfil merged 2 commits into
mainfrom
ci/print-rust-toolchain
Oct 6, 2026
Merged

yansfil merged 2 commits into
mainfrom
ci/print-rust-toolchain

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #646 (the pin whose use this makes visible)

Summary

#646's evidence that every CI job built with the pinned Rust was indirect: rust-cache prints the toolchains a runner has installed, and the pinned one appearing there next to the image's own does not say which one ran.
scripts/verify-cargo.sh, the only Rust entrypoint every workflow calls, now prints rustc --version and cargo --version once it has accepted its arguments and before it runs cargo, so each job's log names the toolchain that built.

  • On stderr: verify-cargo.sh metadata hands its stdout to scripts/ci-plan.py as JSON.
  • After argument validation: a refused call still never reaches cargo, as test_invalid_cargo_mode_or_artifact_redirection_never_calls_cargo requires.
  • docs/BUILD.md, "One toolchain version", says where to read it.

Review

  • 조심해서 볼 파일: scripts/verify-cargo.sh - every Rust job and the PRD harness's sealed test and lint commands go through it; the added calls write only to stderr and change no argument cargo receives.
  • 비용 검토: two short process starts per call (a Rust lane makes a few calls), and on a runner the first of them is where rustup installs the pinned toolchain, which the next cargo call did before.

Evidence

  • 확인한 것: new test_the_toolchain_is_named_on_stderr_before_cargo_runs (fake rustc and cargo): the calls are rustc --version, cargo --version, then cargo metadata, the two version lines open stderr, stdout has neither. Against main's script it fails with [['cargo', 'metadata', ...]] != [['rustc', '--version'], ...].
  • 확인한 것: policy suite locally, 166 tests pass; the existing entrypoint tests read the work calls only.
  • 확인한 것: a real verify-cargo.sh metadata --format-version 1 --no-deps in this checkout: stdout parses as JSON (11 packages), stderr opens with rustc 1.98.0 and cargo 1.98.0.
  • 확인한 것: verify run 37508081360, full plan: every verify-cargo.sh call in the nine jobs that build Rust printed rustc 1.98.0 and cargo 1.98.0 (windows check 14 calls, os contract 3 on each of Linux, Windows and macOS, rust workspace and remote mailbox 2, desktop e2e, build hided linux and windows e2e 1), and plan still read the crate graph from metadata.
  • 확인하지 못한 것: package.yml, release.yml and herdr-update.yml did not run here; they call the same script.

rust-cache lists the toolchains a runner has installed, which does not
say which one built. verify-cargo.sh now prints rustc --version and
cargo --version on stderr once it accepts its arguments, so a job's log
is the evidence that the pinned version ran; stdout stays the cargo
output metadata mode hands to ci-plan.py.
@yansfil
yansfil merged commit cfdb3d1 into main Oct 6, 2026
23 checks passed
@yansfil
yansfil deleted the ci/print-rust-toolchain branch October 6, 2026 18:59
yansfil added a commit that referenced this pull request Oct 6, 2026
Related: #646 (the pin this moves), #650 (prints the toolchain each job
runs)

## Summary

`rust-toolchain.toml` moves from 1.98.0 to 1.99.0, the stable the runner
images carry since 2026-10-06, with the changes 1.99 asks of the code.
These are the findings that failed `-D warnings` on every Rust pull
request before the toolchain was pinned ([run
37498297429](https://github.com/modakbul-gongbang/hide/actions/runs/37498297429)):

- `AtomicUsize::fetch_update` is deprecated in 1.99, renamed
`try_update` with the same arguments and result:
`herdr-core/src/remote.rs` (the forward-connection cap) and
`herdr-core/src/labels/tests.rs` (the fake provider's timeout budget).
- Clippy's `needless_borrows_for_generic_args`:
`herdr-core/src/changes.rs` passed `&relative` to `Option::and_then`;
the closure borrows only `request`, so it is `Copy`, and passing it by
value leaves the later call working.

No finding is silenced with `allow`.

## Review

- **조심해서 볼 파일**: `herdr-core/src/remote.rs` - the cap on concurrent
forwarded connections; `try_update` is the same compare-and-swap loop
under a new name.

## Evidence

- **확인한 것**: [verify run
37507575187](https://github.com/modakbul-gongbang/hide/actions/runs/37507575187),
full plan, 17 jobs pass, Clippy `-D warnings` over the whole workspace
included. Every job that built Rust (Linux, Windows MSVC, macOS) had
1.99.0 installed beside the image's 1.98.1; only this file installs
1.99.0, and rustup installs a toolchain only when a call resolves to it.
This run does not print the toolchain that ran; with #650 merged, a
rerun's log names it on every `verify-cargo.sh` call.
- **확인한 것**: `test_rust_toolchain_pin.py` writes its whole-token probe
inside its own temporary folder; 4 tests pass locally with this pin.
- **확인한 것**: rustfmt (1.98.0) accepts the three changed files.
- **확인하지 못한 것**: nothing was built, linted or tested locally on 1.99.0:
it is not installed on the workstation, and installing it would add a
second toolchain copy for every session there. Clippy and the tests on
1.99.0 in this pull request's CI are the proof.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant