-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
os: investigate dropping support for pre-long-path Windows #69853
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
Comments
seankhliao
added
OS-Windows
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Oct 11, 2024
Perhaps related to #66560. |
Yep, this proposal is the opposite of #66560. A summary of what I said in there:
In a nutshell, I'm opposed to this proposal, it goes in the opposite direction of what I think we should be doing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
On Windows, the os package includes some trickery to enable support for long paths on older versions of Windows. The fixLongPath function rewrites longer paths to contain a
\\?\
prefix, which "tells the Windows APIs to disable all string parsing and to send the string that follows it straight to the file system." (https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#win32-file-namespaces)The
\\?\
prefix can have effects other than just making a longer path work. For example,Mkdir(`\\?\c:\foo `)
will create a directory"foo "
with a trailing space, whileMkdir(`c:\foo `)
will strip the space and create"foo"
.Newer versions of Windows optionally support long paths directly. On Windows 10.0 with a build ID of 15063 and higher, we skip the
\\?\
workaround: https://go.googlesource.com/go/+/refs/tags/go1.23.0/src/runtime/os_windows.go#450Interestingly, the Windows documentation indicates that long paths should be supported on 10.0.1607 and higher
(https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later), and 1607 is build id 14393 (https://learn.microsoft.com/en-us/windows/release-health/release-information).
I don't know why we're checking for a build ID of 15063 instead of 14393.
https://go.dev/wiki/MinimumRequirements#windowswindows says that the supported Windows versions are Windows 10 and higher or Windows Server 2016 and higher.
I don't know what versions of Windows Server 2016 support long paths.
Do we still support any versions of Windows that don't have long path support? Can we just drop the
\\?\
workaround entirely?/cc @qmuntal
The text was updated successfully, but these errors were encountered: