fix: await nested test cleanup and discard package artifacts - #386
Open
tisonkun wants to merge 2 commits into
Open
fix: await nested test cleanup and discard package artifacts#386tisonkun wants to merge 2 commits into
tisonkun wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running
cargo packagebefore saving the cache leaves unpacked sources undertarget/package/<crate>/tests. Cleanup currently treats these source directories as nested test build directories and attempts to open their nonexistenttargetandtrybuildchildren. The two cleanup calls are not awaited, so their rejections escape the surroundingtry/catchand produce unhandledENOENTannotations. Real nested test cleanup can also outlive its caller.Await both nested cleanup calls and discard
target/packageat each target-root entry point before recursively pruning build artifacts. Package archives and verification sources are excluded together, while directories namedpackagebelow target roots retain the normal pruning behavior. This applies to save cleanup and restore-time timestamp pruning.Validation:
npm run prepareon Node.js 24.20.0: succeeds and leaves the checked-indist/unchanged.cargo package --offline --allow-dirty --no-metadata, includingtests/fixtures, and successfully cleaned the resulting target directory.git diff --check: passes.The checked-in
dist/files are regenerated withnpm run prepare. The large cache-chunk diff consists of line-ending normalization and the generated cleanup import update; ignoring whitespace isolates the code changes.