Skip to content

Fix atomic copies to long Windows paths - #1455

Closed
zaniebot wants to merge 1 commit into
zb/regression-windows-long-paths-21611from
zb/fix-windows-long-paths-21611
Closed

zaniebot wants to merge 1 commit into
zb/regression-windows-long-paths-21611from
zb/fix-windows-long-paths-21611

Conversation

@zaniebot

@zaniebot zaniebot commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

On Windows images with LongPathsEnabled=0, uv pip install jupyterlab-widgets==3.0.16 can fail when the package's nested frontend assets exceed MAX_PATH under the virtual environment. In 0.12.11, astral-sh#21468 moved merged copies to NamedTempFile::persist, which passes paths directly to Win32 rather than applying Rust's long-path conversion. Convert the copy destination to a verbatim path before creating its temporary file, so both paths passed to persist support long paths without changing the atomic replacement or retry behavior.

Fixes astral-sh#21611.

@astral-automations-bot astral-automations-bot Bot added area:windows Specific to the Windows platform bug Something isn't working labels Sep 11, 2026
@codspeed

codspeed Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 25 untouched benchmarks


Comparing zb/fix-windows-long-paths-21611 (db18855) with zb/regression-windows-long-paths-21611 (940d324)

Open in CodSpeed

@zaniebot
zaniebot changed the base branch from main to zb/regression-windows-long-paths-21611 September 11, 2026 19:13
@zanieb
zanieb added this pull request to stack #1457 September 11, 2026 19:16
@zaniebot
zaniebot force-pushed the zb/fix-windows-long-paths-21611 branch from 8180464 to b4a19d1 Compare September 11, 2026 19:17
Comment on lines -4149 to 4153
// A valid wheel fails when either its destination or temporary-file path exceeds
// MAX_PATH. This should succeed even without the opt-in; see astral-sh/uv#21611.
// Both the destination and the temporary-file path can exceed MAX_PATH. Neither
// should require the long-path opt-in; see astral-sh/uv#21611.
uv_snapshot!(context.filters(), context.pip_install()
.arg("--no-index")
.arg("--link-mode")
.arg("copy")
.arg(&filename), @"
exit_code: 2 (failure)
exit_code: 0 (success)
----- stderr -----
Resolved 1 package in [TIME]
Prepared 1 package in [TIME]
error: Failed to install: long_paths-1.0.0-py3-none-any.whl (long-paths==1.0.0 (from file://[TEMP_DIR]/long_paths-1.0.0-py3-none-any.whl))
Caused by: Failed to copy to `[LONG_PATH]`
Caused by: Failed to persist temporary file to [LONG_PATH]: failed to persist temporary file: The system cannot find the path specified. (os error 3)
Installed 1 package in [TIME]
+ long-paths==1.0.0 (from file://[TEMP_DIR]/long_paths-1.0.0-py3-none-any.whl)
");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huh, so at some point we regressed this snapshot without noticing?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The test is introduced in the stack parent

@zaniebot zaniebot added risk:3 Credible risk of meaningful incorrect behavior or regression; bounded or recoverable. priority:2 Important: bounded correctness, release reliability, committed work, or proven performance gains. size:2 Moderate: one subsystem with meaningful invariants, edge cases, or operational evidence to inspect. labels Sep 11, 2026
@zaniebot
zaniebot force-pushed the zb/fix-windows-long-paths-21611 branch from b4a19d1 to db18855 Compare September 11, 2026 23:46
@charliermarsh
charliermarsh marked this pull request as ready for review September 11, 2026 23:51
@astral-automations-bot

Copy link
Copy Markdown

Waiting for promotion of parent #1456

@astral-automations-bot

Copy link
Copy Markdown

Promoted to #21625.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:windows Specific to the Windows platform bug Something isn't working priority:2 Important: bounded correctness, release reliability, committed work, or proven performance gains. risk:3 Credible risk of meaningful incorrect behavior or regression; bounded or recoverable. size:2 Moderate: one subsystem with meaningful invariants, edge cases, or operational evidence to inspect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in uv 0.12.11 with long temp paths on Windows

3 participants