Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cache clearing robust to directories without read permissions #3524

Merged
merged 1 commit into from May 11, 2024

Conversation

charliermarsh
Copy link
Member

Summary

If you run the script included in the linked issue, then uv cache clean, we hit permissions errors on certain directories created by setuptools. The permissions on those directories look like:

❯ sudo ls -l /Users/crmarsh/Library/Caches/uv/built-wheels-v3/pypi/opentracing/2.4.0/M-fYsaHAaQQvedmPMUl9D/opentracing-2.4.0.tar.gz/build/bdist.macosx-14.2-arm64/wheel/opentracing
Password:
total 0
drwxr-xr-x  3 crmarsh  staff  96 May 11 12:51 harness

This PR adds logic to make those directories readable by the current user.

Closes #3515.

@charliermarsh charliermarsh added the bug Something isn't working label May 11, 2024
if set_readable(dir).unwrap_or(false) {
// Retry the operation; if we _just_ `self.rm_rf(dir)` and continue,
// `walkdir` may give us duplicate entries for the directory.
return self.rm_rf(path);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting. As in like, the error will be reported again in the iterator?

@charliermarsh charliermarsh enabled auto-merge (squash) May 11, 2024 16:59
@charliermarsh charliermarsh merged commit 3b728c1 into main May 11, 2024
43 checks passed
@charliermarsh charliermarsh deleted the charlie/dir branch May 11, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv cache clean fails after build failures
2 participants