Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

rust.sh shares one CARGO_TARGET_DIR across worktrees, so a scratch-copy build poisons the next run

未關閉 適合新手
#906 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
68/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
docker, rust, shell

研究方向

從 scripts/rust.sh 開始,檢查它如何設定 CARGO_TARGET_DIR 並掛載原始碼。依照描述先使用暫存副本進行建置,再於 worktree 中執行,重現這個流程,接著評估兩種提議的修正方案中哪一種適合這個指令碼。完成標準是下次在 worktree 中執行時不再使用過時的建置產物,或是指令碼清楚說明所需的原始碼變更;重新執行受影響的測試套件以確認。

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

描述

scripts/rust.sh runs every build in one container with CARGO_TARGET_DIR=/target and the source mounted at /work/nostream. A build of a scratch copy of the tree — the shape a reviewer uses to prove a fix by reverting it — writes into that same target directory, and the next worktree run then reads artifacts keyed to the scratch path.

Measured during the 4.0 rewrite (006-nostream-core, round 3): a revert build followed by the worktree suite gave 51 passed / 2 failed; touch-ing the affected sources and re-running gave 53 passed / 0 failed, with no source change. The failures were stale artifacts, not defects.

Two candidate fixes:

  1. Isolate the target for a scratch run: pass CARGO_TARGET_DIR=/target-$(basename "$PWD") (or a caller-supplied CARGO_TARGET_DIR) instead of a single shared /target.
  2. Keep the shared target and document the requirement in the script header: after building anything outside the job worktree, touch the sources before the next worktree run.

(2) is a one-line comment; (1) costs a cold build per distinct path but removes the trap. The reviewer that hit it lost one round-trip and nearly reported a regression that did not exist.

主要語言
TypeScript
星號
829
分支
234
平均合併
18 小時 18 分鐘
30 天內合併 PR
69

環境準備

從這裡開始

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

cameri/nostream 的其他 Issue

查看 cameri/nostream 的全部 Issue

相似的 Issue

更多 TypeScript Issue

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

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