Repository navigation
gh-126929: Retry extension loading with long Windows paths - #156759
Open
Solaris-star wants to merge 1 commit into
Open
Solaris-star wants to merge 1 commit into
Solaris-star wants to merge 1 commit into
Conversation
Signed-off-by: Solaris-star <820622658@qq.com>
Solaris-star
requested review from
FFY00 and
ericsnowcurrently
as code owners
September 1, 2026 10:11
mkanat
reviewed
Oct 23, 2026
mkanat
left a comment
There was a problem hiding this comment.
Thanks for this! I hit this bug through a bazel build of a Python project on Windows. A change very similar to this one fixes it for me. A few things I noticed:
is_uncis also true for paths that already start with\\?\or\\.\, which become\\?\UNC\?\.... So when an extension at such a path fails to load for an ordinary reason, such as the wrong architecture, the error becomes "The network path was not found" instead of the real one. For example, you can see bazel-contrib/rules_python#4071 already passes\\?\paths, so its users would see this.- Minor: Retrying only on
ERROR_FILENAME_EXCED_RANGE(206) would leave any other error as it is today. - Minor: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation says
\\?\paths are "passed to the system with minimal modification, which means that you cannot use forward slashes to represent path separators, or a period to represent the current directory, or double dots to represent the parent directory."GetFullPathNameWbefore adding the prefix would probably be safer.
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.
Fixes #126929.
On Windows, retry extension-module loading with a long-path-compatible DLL path when the initial load fails because the path exceeds legacy limits.
The change also adds the required Windows NEWS entry.
Validation performed:
git diff --checkWindows-specific runtime validation was not available locally.