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
平均合并
17 小时 46 分钟
30 天内合并 PR
73

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cameri/nostream 的其他 Issue

查看 cameri/nostream 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。