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

uv cache prune causes self update to fail #6417

Closed
weihenglim opened this issue Aug 22, 2024 · 7 comments · Fixed by #6482
Closed

uv cache prune causes self update to fail #6417

weihenglim opened this issue Aug 22, 2024 · 7 comments · Fixed by #6482
Assignees
Labels
bug Something isn't working windows Specific to the Windows platform

Comments

@weihenglim
Copy link

weihenglim commented Aug 22, 2024

On Windows, running uv cache prune removes uv-receipt.json from the cache, which leads to uv being unable to self update:

>uv cache prune -v
DEBUG uv 0.3.0
Pruning cache at: C:\Users\User\AppData\Local\uv
DEBUG Removing dangling cache entry: C:\Users\User\AppData\Local\uv\uv-receipt.json
Removed 1 file (253B)

>uv self update -v
DEBUG uv 0.3.0
DEBUG no receipt found; assuming uv was installed via a package manager
warning: Self-update is only available for uv binaries installed via the standalone installation scripts.
@konstin konstin added bug Something isn't working windows Specific to the Windows platform labels Aug 22, 2024
@charliermarsh
Copy link
Member

Ohh, thanks. That's interesting.

@charliermarsh charliermarsh self-assigned this Aug 22, 2024
@charliermarsh
Copy link
Member

Did you move the cache at all? I think the cache by default is at C:\Users\User\AppData\Local\uv\cache.

@weihenglim
Copy link
Author

No, nothing was configured. Just tested a fresh install on another Windows 11 machine and the cache directory defaults to AppData\Local\uv as well.

>powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
Downloading uv 0.3.1 (x86_64-pc-windows-msvc)
Installing to C:\Users\Admin\.cargo\bin
  uv.exe
  uvx.exe
everything's installed!

>uv cache dir -v
DEBUG uv 0.3.1
C:\Users\Admin\AppData\Local\uv

@charliermarsh
Copy link
Member

Ahh sorry, I think the cache directory changed slightly in v0.3.0.

@charliermarsh
Copy link
Member

(But in a backwards-compatible way, so my machine was still using the previous location.)

@weihenglim
Copy link
Author

As a temporary workaround, manually moving all the files (except uv-receipt.json) to AppData\Local\uv\cache seems to fix the issue (and uv cache dir properly detects the new cache location)

@charliermarsh
Copy link
Member

Yeah, that makes sense. Will fix though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows Specific to the Windows platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants