Skip to content

build(package): exclude target-variant dirs from the crate — guard against >10MiB upload rejection - #851

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/package-target-guard
Oct 19, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/package-target-guard

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

owner 警觉引出的护栏:主检出曾存 target2-baseline/(1.7GB 旧构建基线树)——名字以 target2 开头,既不被 .gitignore 的 /target-*(要求字面 target- 前缀)匹配,也不被 Cargo.toml exclude 的 target/** 覆盖,未追踪未忽略 → 本地 cargo package 实测被打进 457MB(crates.io 上限 10MiB 压缩件)。

  • crates.io 在架基线:v1.4.0 = 2.27MiB(1.1.0→1.4.0 平稳 2.2-2.9MiB),CI 干净检出从未受影响——本 PR 是结构性护栏非救火。
  • 双保险:.gitignore 加 /target*/(目录级通配,防任何 target 变体树)、Cargo.toml exclude 加 "target*/**"。
  • 本地已删该 1.7GB 树(内容=debug/ 构建产物+PUA 垃圾名 scratch 文件,无未提交工作)。

验证:改动后 cargo package --list 不再含 target 变体条目;发布链(CI 干净检出)行为不变。

…rate — target2-baseline (1.7GB stale build tree, untracked & not ignored) inflated a local cargo package to 457MB; crates.io cap is 10MiB (published v1.4.0 = 2.27MiB, CI clean checkouts unaffected)
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