chore(ci): pin the Rust toolchain, so a clippy or rustfmt release cannot turn lint red with no code change

未關閉
#92 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
55/100
Issue 類型
重構
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
github-actions, rust, wasm

研究方向

Start with .github/actions/setup-rust/action.yml, scripts/rs, .github/scripts/classify-changes.sh, and docs/src/architecture/cicd.md to trace how CI, local commands, and documentation select Rust. Check how the Worker wasm32 build uses worker-build and wrangler, then verify the acceptance criteria, including the throwaway pin-change control. Done means one exact version drives repository commands and CI, jobs report the compiler version, and docs/ explains the bump process.

由索引模型根據 Issue 內容生成。

描述

area:process prio:p1

Context

CI installs the Rust toolchain as stable (.github/actions/setup-rust/action.yml:34, through dtolnay/rust-toolchain). There is no rust-toolchain or rust-toolchain.toml file, and no rust-version in any manifest. scripts/rs also hard-codes stable (scripts/rs:20, rustup which --toolchain stable rustc). Locally, Homebrew's cargo 1.98.1 comes first on PATH while rustup's stable is 1.99.0 (its header records this, measured 2026-10-18), so a bare cargo and scripts/rs cargo are different compilers.

The lint job added by #87 runs cargo clippy ... -- -D warnings. Clippy adds lints in most releases, so on a floating toolchain a new stable release will eventually turn lint red with no change to the code. No such release has happened yet: the 47 warnings that #87 had to fix first were there because clippy had never run in CI, not because a release moved. That is why this is a risk to remove now, not an incident to fix.

Problem

  • A rustc, clippy or rustfmt release breaks lint (and can change fmt --check) on whichever pull request lands next, and on main.
  • CI and a developer's machine can disagree about which lints exist.
  • There is no single place that says which compiler this repository is built and tested with.

Proposal

  • A rust-toolchain.toml naming an exact version, with the components (clippy, rustfmt) and the wasm32-unknown-unknown target. Decide how CI installs it (read the version from the file, or let rustup honour the file) so the version lives in one place.
  • Make scripts/rs follow the pin instead of stable.
  • Write down how the pin is bumped. Dependabot does not bump rustc, so this is a deliberate, small pull request (or a scheduled one): bump, run cargo clippy --fix for new lints, and land them together, instead of finding them on an unrelated pull request.
  • Check it against the other pins that move with the compiler: worker-build 0.8.7 and wrangler 4.151.2 (both in the setup-rust action) and the Worker's wasm32 build.
  • Keep it separate from an MSRV (rust-version), which is a different question and not set today.

classify-changes.sh already treats a path starting rust-toolchain as Rust, so a change to the pin runs the Rust jobs.

Acceptance criteria

  • One file defines the version, and CI, scripts/rs and a plain cargo in the repository all use it. Each CI job prints the rustc --version it used.
  • The control: change the pin to a different version on a throwaway branch, and the jobs report that version (and nothing else moves).
  • The bump procedure is written down in docs/.
  • docs/src/architecture/cicd.md ("the Rust toolchain is stable, not pinned, so a new clippy or rustfmt release can fail lint") is updated to say what is pinned and how to bump it.

References

#40, #87; .github/actions/setup-rust/action.yml; scripts/rs; .github/scripts/classify-changes.sh; docs/src/architecture/cicd.md, "Permissions and supply chain".

主要語言
Rust
星號
0
分支
0
平均合併
1 小時 35 分鐘
30 天內合併 PR
67

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

aRustyDev/thrust 的其他 Issue

查看 aRustyDev/thrust 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。