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

ci: Make Windows tests ~27% faster by putting temp folder in dev drive #6680

Merged
merged 9 commits into from
Aug 27, 2024

Conversation

fasterthanlime
Copy link
Contributor

@fasterthanlime fasterthanlime commented Aug 27, 2024

Summary

This PR makes cargo test | windows faster in CI.

Before

Windows tests take 5m44s

After

Windows tests take 5m12s

Also

This PR disables the brotli feature of async-compression since it's not strictly needed, but this has little to do with the improvements (it's still less code to build).

This PR introduces additional code in uv tool uninstall to ignore errors (that only seem to happen on ReFS, ie. on Dev Drives) akin to "the thing we're trying to delete cannot be deleted because it's already being deleted".

If raw_os_error was stable we could do u32 matching instead of that .to_string().contains() abomination.

@fasterthanlime fasterthanlime changed the title WIP: ci tests (Disable brotli for now) ci: Make Windows tests ~27% faster Aug 27, 2024
@fasterthanlime fasterthanlime changed the title ci: Make Windows tests ~27% faster ci: Make Windows tests ~27% faster by putting temp folder in dev drive Aug 27, 2024
@zanieb zanieb added the internal A refactor or improvement that is not user-facing label Aug 27, 2024
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

Awesome! This looks great.

@zanieb zanieb merged commit 2c5cc62 into astral-sh:main Aug 27, 2024
57 checks passed
@samypr100
Copy link
Contributor

samypr100 commented Aug 27, 2024

@fasterthanlime Curious, it seems tempfile::tempdir seems to ultimately leverage GetTempPath2 which has the following rules:

For non-system processes, the GetTempPath2 function checks for the existence of environment variables in the following order and uses the first path found:
The path specified by the TMP environment variable.
The path specified by the TEMP environment variable.
The path specified by the USERPROFILE environment variable.
The Windows directory.

Would this have work if TEMP env var was set instead to a directory inside the dev drive location? I wonder if that approach may simplify this by quite a bit.

fasterthanlime added a commit to bearcove/uv that referenced this pull request Aug 30, 2024
fasterthanlime added a commit to bearcove/uv that referenced this pull request Aug 30, 2024
charliermarsh pushed a commit that referenced this pull request Aug 30, 2024
…6858)

As suggested by @samypr100 on #6680:
#6680 (comment)

## Summary

Instead of using `UV_INTERNAL__TEST_DIR`, it simply exports `TEMP` when
running Windows jobs.

## Test Plan

I'm going to run this manually under ProcMon on my Windows machine and
see where uv writes temp files, hopefully to the dev drive and not
`%(LOCAL)APPDATA%` or something.

I'm going to commit a dummy code change and look at build time changes
in CI.
@zanieb
Copy link
Member

zanieb commented Sep 5, 2024

Part of #5713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal A refactor or improvement that is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants