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 self update on Windows #7690

Open
m-aherron opened this issue Sep 25, 2024 · 7 comments
Open

uv self update on Windows #7690

m-aherron opened this issue Sep 25, 2024 · 7 comments
Labels
releases Related to building and distributing release artifacts of uv windows Specific to the Windows platform

Comments

@m-aherron
Copy link

Windows 10 - Powershell 7.4.5
Going from uv 0.4.15 to uv 0.4.16 using
uv self update

This upgrade has the following environment variables defined:

UV_INSTALL_DIR            C:\Python\uv
UV_PYTHON_INSTALL_DIR     C:\Python\uv\python
UV_CACHE_DIR              C:\Python\uv\cache
UV_TOOL_DIR               C:\Python\uv\tools
UV_TOOL_BIN_DIR           C:\Python\uv\tools\bin

The initial install created C:\Python\uv\bin and put uv and uvx there.

I don't have the details about the exact sequence of events (I may have had install directory defined with the \bin)
but the uv code detected a superfluous \bin subdirectory and deleted it.

This upgrade deleted uv.exe and created a C:\Python\uv\bin\bin and C:\Python\uv\bin\tmpname directory.
The new executables were installed in those subdirectories but were not moved to C:\Python\uv\bin.
uv, of course, was subsequently not findable by the OS.

Manually moving the executables to the parent directory and deleting the two created
directories had everything working correctly with the new versions.

@zanieb zanieb added the releases Related to building and distributing release artifacts of uv label Sep 25, 2024
@zanieb
Copy link
Member

zanieb commented Sep 25, 2024

Thanks for the report! We'll investigate.

@zanieb
Copy link
Member

zanieb commented Sep 25, 2024

Do you think you could provide an exact reproduction? i.e. in a Docker container?

@m-aherron
Copy link
Author

It is Windows so Docker is an issue.
I'll try to reproduce the issue.
When I execute the

uv self update

I'll document the before and after of the directories.
What flags, switches, logs would be of help?

@zanieb
Copy link
Member

zanieb commented Sep 25, 2024

Oh sorry 😮‍💨 haha

Just to cover all our bases, maybe set INSTALLER_PRINT_VERBOSE=1 RUST_LOG=trace and pass the --verbose flag?

@zanieb zanieb added the windows Specific to the Windows platform label Sep 25, 2024
@m-aherron
Copy link
Author

This test resulted in successful upgrade of uv and uvx. But it did not clean up properly. Details in the attached files.
Information on the 4.15 install and all that I could provide about the upgrade to 4.16.
uv_self_update_416.txt
uv415_install.txt

My hunch is that once the install creates the temp directory adjacent to the final directory and has the new files there it fails some time while renaming the directories and erasing the old files and the renamed original directory. Depending on when it bails you may or may not have a working system.

Thanks.

@mistydemeo
Copy link

The temporary directory adjacent to the install directory is a separate bug that we've just fixed in the development branch of the updater library. (axodotdev/cargo-dist#1374) It'll be fixed in the next release. The temp dir actually contains the previous version rather than the newly-installed one.

I'm looking into the issue with the bin directory. I haven't been able to reproduce the original issue yet. When I set the environment variables you mention in the original issue, I get an install in C:\Python\uv\bin, and the update goes into the same place. I'll try a few variations to see if I can come up with an installation that reproduces your case exactly.

@m-aherron
Copy link
Author

0.4.17 - Minor annoyance at this point:
UV_INSTALL_DIR was "C:\Python\uv"
Upgrade worked fine from 4.15 to 4.17
but it left a copy of uv (version 4.15) in C:\Python\uv.tmpmIGKAu
debug log info attached

upgrade.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
releases Related to building and distributing release artifacts of uv windows Specific to the Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants