default the test buckets dir to the canonicalized temp dir#14290
Merged
oconnor663 merged 1 commit intomainfrom Jun 26, 2025
Merged
default the test buckets dir to the canonicalized temp dir#14290oconnor663 merged 1 commit intomainfrom
oconnor663 merged 1 commit intomainfrom
Conversation
Member
|
Don't you need to unset |
Contributor
Author
|
https://github.com/astral-sh/uv/actions/runs/15908534044 is a CI run on a scratch branch that uses If you think this is a reasonable change, I could go ahead and remove |
Contributor
Author
|
Ah no, I'm probably breaking something on Windows. I got lazy and assumed that Windows failures were timeouts after the macOS runner passed. Incorrect! |
Contributor
Author
|
Ok, "canonicalize -> simple_canonicalize" fixed it. |
Previously we were using the XDG data dir to avoid symlinks, but there's no particular guarantee that that's not going to be a symlink too. Using the canonicalized temp dir by default is also slightly nicer for a couple reasons: It's sometimes faster (an in-memory tempfs on e.g. Arch), and it makes overriding `$TMPDIR` or `%TMP%` sufficient to control where tests put temp files, without needing to override `UV_INTERNAL__TEST_DIR` too.
6686bc1 to
33fa9d9
Compare
ntBre
added a commit
to astral-sh/ruff
that referenced
this pull request
Jul 17, 2025
## Summary This came up on [Discord](https://discord.com/channels/1039017663004942429/1343692072921731082/1395447082520678440) and also in #19387, but on macOS the tmp directory is a symlink to `/private/tmp`, which breaks this filter. I'm still not quite sure why only these tests are affected when we use the `tempdir_filter` elsewhere, but hopefully this fixes the immediate issue. Just `tempdir.path().canonicalize()` also worked, but I used `dunce` since that's what I saw in other tests (I guess it's not _just_ these tests). Some related links from uv: - https://github.com/astral-sh/uv/blob/1b2f212e8b2f91069b858cb7f5905589c9d15add/crates/uv/tests/it/common/mod.rs#L1161-L1178 - https://github.com/astral-sh/uv/blob/1b2f212e8b2f91069b858cb7f5905589c9d15add/crates/uv/tests/it/common/mod.rs#L424-L438 - astral-sh/uv#14290 Thanks to @zanieb for those! ## Test Plan I tested the `main` branch on my MacBook and reproduced the test failure, then confirmed that the tests pass after the change. Now to make sure it passes on Windows, which caused most of the trouble in the first PR!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously we were using the XDG data dir to avoid symlinks, but there's no particular guarantee that that's not going to be a symlink too. Using the (canonicalized) temp dir by default is also slightly nicer for a couple reasons: It's sometimes faster (an in-memory tempfs on e.g. Arch), and it makes overriding
$TMPDIRor%TMP%sufficient to control where tests put temp files, without needing to overrideUV_INTERNAL__TEST_DIRtoo.