Skip to content

Conversation

@lazka
Copy link
Contributor

@lazka lazka commented Oct 23, 2025

Use extractTar() instead of extractZip() which is very slow for some reason (0.3s vs 10s)

Fixes #659

Use extractTar() instead of extractZip() which is very slow for some
reason (0.3s vs 10s)

Fixes astral-sh#659
@lazka lazka requested a review from eifinger as a code owner October 23, 2025 18:05
@lazka
Copy link
Contributor Author

lazka commented Oct 23, 2025

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() ?

@Avasam
Copy link

Avasam commented Oct 23, 2025

I just tried this patch and it brings setup-uv's total runtime down to 6-14 seconds. This also brings astral-sh/setup-uv in line with actions/setup-python in terms of speed if you don't have any dependency to install.

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

@lazka
Copy link
Contributor Author

lazka commented Oct 24, 2025

Or we try extractTar(), and if that fails, fall back to extractZip() ?

I added that now.

@eifinger
Copy link
Collaborator

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.
Copy link
Collaborator

@eifinger eifinger left a 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! 🚀

@eifinger eifinger merged commit 29cd235 into astral-sh:main Oct 24, 2025
88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installation is ~10x slower on Windows GitHub runners than Linux

3 participants