Add a script that prunes stale build targets #24
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/paveledits--ScarlettMac!24
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-24"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@jgrizon on GitHub · 2026-11-29 23:21 UTC · original
clean-build-targets→main· +125 −0 · 3 files · 1 commits · closed without mergingSummary
Why
One day of parallel experiments left 148 Rust build roots under
.build: 377 GB, the same dependency tree compiled once per worktree. Nothing in the repo could reclaim it, so it grew by roughly 200 GB per day of experiments.Selection uses cargo's own
CACHEDIR.TAGmarker rather than the directory name, because several roots carry custom names (aero-flatmem-target,wt-mesh/target-arm,bench/p64-target). The name pass stays as a fallback for roots created before the marker. The script refuses to run whilecargoorrustcis running, and it removes build output only. Branches, worktrees and tracked files stay.Rejected: a
git clean-style helper that also removes worktrees, because unmerged experiment branches would be at risk.Evidence
.buildat 468 GB..buildat 52 GB. All 117 worktrees and branches intact.zsh -n scripts/clean.sh-> syntax ok../scripts/clean.sh --hours 24 --dry-run-> selected a stale fixture root and skipped a fresh one.--all-> removed nested fixtures once, by their outer root../scripts/clean.shafter a real sweep ->Nothing to clean.python3 -m unittest discover -s tests-> 6 tests OK.Not tested: a run against a 20 GB root; the fixtures covered selection, nesting and deletion.
Risk
Can we undo it? Yes. Only build output is deleted; the next build recreates it.
What could break: A root that looks idle but is in active use gets rebuilt. The 48-hour window and the
cargo/rustcrunning check bound that.How to undo: revert the commit.
Panel
Not run.
@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-29 23:21 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
49dac739bctoe92de073c6Pull request closed