Repository navigation
Preserve macOS cache cleanup without directory search permission - #21363
Merged
charliermarsh merged 4 commits intoAug 29, 2026
Merged
charliermarsh merged 4 commits into
charliermarsh merged 4 commits into
Conversation
Bulk link-count requests need directory search permission even when a shard is empty. The ordinary walk can enumerate and remove an empty `0600` shard, so propagating `EACCES` makes `uv cache clean` fail where it previously succeeded. Fall back to the ordinary walk on `EACCES`; it still reports permission errors for entries it cannot access. Add a macOS integration regression for removing an empty shard without search permission.
Include the error directly in the `debug!` message, following nearby filesystem diagnostics and keeping the fallback reason in the message.
The nested directory forces the shard containing a symlink onto the recursive fallback. Add a separate flat shard with an orphan, an externally retained hardlink, and a directory symlink so cleanup also exercises their interaction through the macOS bulk path. Keep the nested fixture to cover recursive fallback, and assert that only the orphan is removed from the flat shard.
Pruning visits directories before their contents so `skip_current_dir` can bypass a shard after a bulk scan. Document why directory removal is deferred and reversed to preserve child-before-parent removal for nested directories and the ordinary traversal.
charliermarsh
marked this pull request as ready for review
August 29, 2026 23:48
charliermarsh
merged commit Aug 29, 2026
409aa66
into
charlie/bulk-file-cache-pruning
60 checks passed
charliermarsh
pushed a commit
that referenced
this pull request
Aug 31, 2026
) Stacked on #21344. `uv cache clean <package>` fails on macOS when an empty file-cache shard is readable but lacks search permission: `getattrlistbulk` requires that permission even though the ordinary directory walk can enumerate and remove the shard. Fall back on `EACCES` to preserve existing cleanup behavior while retaining errors from the ordinary walk. Also align the fallback log with nearby diagnostics and explain why directory removal is deferred.
This branch was previously deployed
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.
Stacked on #21344.
uv cache clean <package>fails on macOS when an empty file-cache shard is readable but lacks search permission:getattrlistbulkrequires that permission even though the ordinary directory walk can enumerate and remove the shard. Fall back onEACCESto preserve existing cleanup behavior while retaining errors from the ordinary walk.Also align the fallback log with nearby diagnostics and explain why directory removal is deferred.