-
Notifications
You must be signed in to change notification settings - Fork 76
Use tar for extracting the uv zip file on Windows too #660
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
Conversation
Use extractTar() instead of extractZip() which is very slow for some reason (0.3s vs 10s) Fixes astral-sh#659
|
This depends on tar being bsdtar (which supports zip, unlike gnu tar), so C:/Windows/System32/tar.exe for example. I'm not sure if that causes issues somewhere (workflows that add their own tar to PATH) It would likely be less error prone to use the right tar directly, like https://github.com/actions/toolkit/blob/ab82301c62dcd155e54b48c02a49cfaa2b7d1bc3/packages/cache/src/internal/constants.ts#L34C14-L34C37 but then we have to stop using the tool-cache functions. Or we try extractTar(), and if that fails, fall back to extractZip() ? |
|
I just tried this patch and it brings setup-uv's total runtime down to 6-14 seconds. This also brings I had one random 30s run, but it was caused by slow venv creation (25s creating a venv !!), which is a separate issue: https://github.com/Avasam/pywin32/actions/runs/18759065019/job/53518535754?pr=16#step:3:45 |
I added that now. |
|
Looks good thank you! Can you please run the formatter again? We are then good to go. |
extractTar() supporst both bsdtar and gnu tar, but only bsdtar supports zip files. While on GH hosted runners bsdtar is used by default that might not be true for other setups, so in case extractTar() fails we fall back to extractZip() and print a message.
eifinger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the awesome analysis and the fix! 🚀
Use extractTar() instead of extractZip() which is very slow for some reason (0.3s vs 10s)
Fixes #659