Repository navigation
Pin the Rust toolchain in rust-toolchain.toml - #646
Merged
Merged
Conversation
CI built with whatever stable the runner image carried, so a new image failed code already on main in every pull request at once. The version is now written only in rust-toolchain.toml, which rustup reads on every runner and workstation. A test fails when anything restates it or a script reaches a toolchain around rustup; check-typed-live-remote.sh did, and no longer does.
This was referenced Oct 6, 2026
yansfil
added a commit
that referenced
this pull request
Oct 6, 2026
Related: #646 (the pin this keeps moving) ## Summary Since #646 the Rust version is whatever `rust-toolchain.toml` names, so a new release reaches this repository only when someone moves the file. `.github/dependabot.yml` gains a `rust-toolchain` entry: every Monday Dependabot checks for a newer stable release and opens a pull request that changes `channel` ([Dependabot changelog](https://github.blog/changelog/2025-08-19-dependabot-now-supports-rust-toolchain-updates/)). That pull request's CI lists what the new compiler and Clippy ask of the code, and the fixes are pushed to it; `docs/BUILD.md`, "One toolchain version", says so. ## Review - **판단해 주세요**: no cooldown. Cargo and Actions wait seven days; Dependabot's [options reference](https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-options-reference) lists no cooldown for `rust-toolchain`, so a release is proposed the Monday after it ships and a point release that follows is proposed again. The alternative is no automation and a person watching releases. ## Evidence - **확인한 것**: the file parses as YAML with three update entries (cargo, github-actions, rust-toolchain); the policy suite passes locally, 165 tests. - **확인하지 못한 것**: that Dependabot accepts the entry; GitHub validates `dependabot.yml` only after it reaches the default branch, where a rejected entry shows in the repository's Dependabot settings.
yansfil
added a commit
that referenced
this pull request
Oct 6, 2026
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](https://github.com/modakbul-gongbang/hide/actions/runs/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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #624 (where the failure was first seen)
Summary
The repository named no Rust version, so CI built with whatever stable the runner image carried.
Since 2026-10-06 16:47 UTC the ubuntu image carries 1.99, and code already on
mainfails-D warningsthere:AtomicUsize::fetch_updateis deprecated (renamedtry_update) atherdr-core/src/remote.rs:3454andherdr-core/src/labels/tests.rs:95, and Clippy'sneedless_borrows_for_generic_argsfires atherdr-core/src/changes.rs:258(run 37498297429,rust workspace).Every pull request that touches Rust, and
mainitself, fails the same way.rust-toolchain.tomlnow pins 1.98.0 with rustfmt and Clippy (minimal profile); rustup reads it on the firstrustcorcargocall on every runner and workstation, so no workflow step changes.Moving to 1.99 with those three fixes is the next pull request.
scripts/tests/test_rust_toolchain_pin.py(policy lane) fails when a workflow, script, document or crate manifest restates it, or when a script reaches a toolchain around rustup.scripts/check-typed-live-remote.shput~/.rustup/toolchains/stable-*/binfirst onPATH, which bypasses the pin; that line is gone (toolchain-env.sh, which it already sourced, does the resolution).docs/BUILD.mdgains "One toolchain version"; thepr.ymlrust-lane comment and thenightly.ymlheader no longer describe the image's toolchain as the one used.Review
mainrun (37482154440) used the image's 1.98.1; 1.98.0 is already installed with rustfmt and Clippy on the workstation that runs most local verification, so no session downloads a second toolchain. This pull request's full CI run is what proves 1.98.0 onmain's code.rust-toolchainentry independabot.yml(Dependabot updateschannel = "1.xx.yy"in this file, changelog), weekly with the 7-day cooldown cargo uses; its pull request's CI lists what the new compiler and Clippy ask, and the fixes land on that pull request.rust-toolchain.toml- every Rust job on Linux, macOS and Windows now installs this version through rustup on its first call, including theplanjob'scargo metadata; no job has an install step to fail visibly instead.rust-cachedoes not keep~/.rustup): about 8 s, theplanstep's 10 s here against 2 s on Count an agent as installed only when its program is found #624; the cache steps took no longer than onmain.Evidence
-D warningsover the whole workspace included. In each of the nine jobs that built Rust (Linux, Windows MSVC, macOS),rust-cachelists 1.98.0 installed beside the image's own 1.98.1 or 1.99.0; nothing but this file installs 1.98.0, and rustup installs a toolchain only when a call resolves to it. That list names what is installed, not what ran; no job prints its active toolchain.main's line 4 ofcheck-typed-live-remote.sh; a line "Built with Rust 1.98.0 on CI." indocs/BUILD.md) and passes once they are removed.toolchain-env.shsourced,rustup show active-toolchainanswers 1.98.0 overridden by this file,cargo --versionanswers 1.98.0, and the HOME stays 0 bytes: nothing was downloaded.package.yml,release.ymlandherdr-update.ymldid not run on this pull request; they build in the repository root on macOS likedesktop e2e, so they read the same file.