Skip to content

fix(ci): tolerate a missing target/debug/deps in the cargo-test prune step - #8629

Closed
jdalton wants to merge 1 commit into
PerryTS:mainfrom
jdalton:fix/prune-find-tolerates-missing-debug-deps
Closed

fix(ci): tolerate a missing target/debug/deps in the cargo-test prune step#8629
jdalton wants to merge 1 commit into
PerryTS:mainfrom
jdalton:fix/prune-find-tolerates-missing-debug-deps

Conversation

@jdalton

@jdalton jdalton commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a CI script bug that has been failing main's scheduled and push runs repeatedly, unrelated to any specific PR's code changes.

What broke and why

The full cargo-test job (nightly cron, release tags, workflow_dispatch) prunes linked test binaries between packages to avoid exhausting runner disk, using a bare find target/debug/deps -maxdepth 1 -type f -perm -111 ! -name '*.so' -delete.

That directory only exists once something has actually built into it. When the job's scope builds straight to --release (the perry/perry-stdlib branch just above the first prune call) and no cargo test -p <package> has run yet, target/debug/deps is absent, find exits 1, and the whole job fails, even when every test in it passed. I confirmed this against a real run: cargo test reported 2595 passed; 0 failed, and the job still failed on this exact line right after.

Changes

Both prune calls in .github/workflows/test.yml (find target/debug/deps ...) now redirect stderr and fall back to true, so a missing directory is treated as a no-op instead of a job failure. The behavior when the directory does exist is unchanged.

Related issue

n/a

Test plan

I confirmed the failure mode against a real CI run at https://github.com/PerryTS/perry/actions/runs/32553699612, where the cargo-test job passed every test and then failed on this exact line with find: 'target/debug/deps': No such file or directory. I ran actionlint against the edited workflow file and it reported no new findings, only two pre-existing unrelated shellcheck notes elsewhere in the file that this change does not touch. cargo build --release and the workspace test suite are not applicable here, since no Rust source changed.

Checklist

I have not bumped the workspace version or edited CLAUDE.md or CHANGELOG.md. My commit follows the fix: prefix convention used in the log. I have read CONTRIBUTING.md and agree to the Code of Conduct.

… step

The full cargo-test job pruned linked test binaries between packages with a bare 'find target/debug/deps ... -delete', but that directory only exists once something has built into it. When the scope's first package builds straight to --release (the perry/perry-stdlib branch above it), or before any cargo test -p <package> has run in the per-package loop, the directory is absent and find exits 1, failing the whole job even though every test passed. This has been failing main's scheduled and push CI runs repeatedly and is unrelated to any specific PR's changes.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ce4901b8-53b1-4d24-96ac-ba0fc695fa8a

📥 Commits

Reviewing files that changed from the base of the PR and between 9963215 and 6ca23fb.

📒 Files selected for processing (1)
  • .github/workflows/test.yml

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The full cargo-test workflow now suppresses executable cleanup errors and continues when deletion fails in both cleanup locations.

Changes

Test workflow cleanup

Layer / File(s) Summary
Error-tolerant cleanup commands
.github/workflows/test.yml
Both executable cleanup commands suppress stderr and continue successfully when deletion fails.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 6ca23

This localized CI change makes pruning a missing directory a no-op, preventing otherwise successful test jobs from failing; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: proggeramlug, thehypnoo

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the bug and test results, but it omits the required Changes, Related issue, and Checklist sections. Add the missing template sections, use "n/a" for Related issue if applicable, and complete the required checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the CI fix and the missing target/debug/deps directory that caused the prune step to fail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

proggeramlug added a commit that referenced this pull request Aug 22, 2026
…deps) (#8631)

* fix(ci): tolerate a missing target/debug/deps in the cargo-test prune step

The full cargo-test job pruned linked test binaries between packages with a bare 'find target/debug/deps ... -delete', but that directory only exists once something has built into it. When the scope's first package builds straight to --release (the perry/perry-stdlib branch above it), or before any cargo test -p <package> has run in the per-package loop, the directory is absent and find exits 1, failing the whole job even though every test passed. This has been failing main's scheduled and push CI runs repeatedly and is unrelated to any specific PR's changes.

* chore: add the changelog fragment for #8629

---------

Co-authored-by: John-David Dalton <jdalton@socket.dev>
Co-authored-by: Ralph Küpper <ralph@skelpo.com>
@proggeramlug

Copy link
Copy Markdown
Contributor

Landed on main in 38dac3b via #8631, together with the changelog fragment this PR was missing.

Verified your actionlint claim rather than taking it on trust: findings are identical on origin/main and on the merged branch (same 3, at lines 1011 and 3489 — this PR touches 1078/1088). Also confirmed the mechanism locally: find on a missing directory is rc 1, rc 0 with the guard.

One thing noted in the changelog fragment, not a blocker: 2>/dev/null || true suppresses genuine find errors too, so if the prune ever silently stops working the symptom becomes a later disk exhaustion rather than a pointed error. Right tradeoff for a disk-hygiene step; just worth having written down.

Thanks — this was failing main repeatedly.

@jdalton

jdalton commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Appreciate the independent verification, and good catch on the tradeoff.

On the failure-mode tradeoff

Agreed the failure mode changes shape rather than disappearing: a genuinely broken prune now surfaces as disk exhaustion later instead of a pointed find error at the point of failure. For a best-effort disk-hygiene step, that's the right side to fail on - a red job now would cost every consumer of main a false failure on their own unrelated change. Thanks for landing it in 38dac3b4c.

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.

2 participants