-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
curl_multibyte: support Windows paths longer than MAX_PATH #13522
Conversation
Merge conflicts. Any plans to move forward on this? |
It is still necessary for our use case. @jay can you take a look at the conflicts? |
I fixed the conflicts. Also I reversed and took @nmoinvaz's suggestion to use 'goto cleanup' instead of 'goto error' to eliminate any confusion in the logic. Though I don't foresee this PR causing any problems I'm going to wait until the next feature window to land it. |
2250ebf
to
66d5128
Compare
@bagder is it possible for this to be merged for the next release? Thanks. |
Ok I wasn't sure. I just wanted to make sure it wasn't abandoned because you told us on another PR that you closed it because we didn't push hard enough for it. Thanks! |
This is held up by a CI failure in a Windows UWP job that I haven't had time to reproduce, apparently there is a missing GetFullPathNameW but according to the doc it exists in UWP apps
The earliest this will be in a release is 2 months from now because it's not going in the patch release coming this Wednesday |
|
66d5128
to
98f9ca4
Compare
setup-win32.h is used everywhere and we purposely use WIN32_LEAN_AND_MEAN so that all the extra stuff is not included in every unit. fileapi.h should be included because the file api is included by winbase which is included by windows.h regardless of lean and mean. not all sdks have the file api in fileapi.h. possibly this is a unity build issue? |
@vszakats do you have any idea about what is causing this UWP CI job failure, before I set up a Windows environment that can build uwp and find out why the ci job is failing, or is there a better way to go into the ci or something without doing all that? AFAICT I'd have to add these packages: curl/.github/workflows/windows.yml Lines 84 to 95 in 7eb8c04
so
and then build with the flags from the uwp 'test' configuration curl/.github/workflows/windows.yml Lines 181 to 204 in 7eb8c04
|
@jay To sort out if it's unity-related, perhaps the easiest is to duplicate the job and disable unity in one of them with I've only tested UWP builds in CI. With MinGW, it can often help to peek into the headers. They are available here: https://downloads.sourceforge.net/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v12.0.0.tar.bz2 The header only defines it for non-UWP. The MS SDK defines it for UWP, suggesting a Since this function requires Win10, some sort of mechanism seems to be necessary anyway |
38861a8
to
f4eb1c5
Compare
Thanks. It looks like mingw does not declare GetFullPathNameW for UWP targeting old versions of Windows even though it's in those versions. I added a custom declaration for UWP mingw < win 10 and that seems to have worked. |
- Add a helper function for the Windows file wrapper functions that will normalize a long path (or a filename in a long path) and add the prefix `\\?\` so that Windows will access the file. Prior to this change if a filename (when normalized internally by Windows to its full path) or a path was longer than MAX_PATH (260) then Windows would not open the path, unless it was already normalized by the user and had the `\\?\` prefix prepended. The `\\?\` prefix could not be passed to file:// so for example something like file://c:/foo/bar/filename255chars could not be opened prior to this change. There's some code in tool_doswin that will need to be modified as well to further remove MAX_PATH (aka PATH_MAX) limitation. Ref: curl#8361 Ref: curl#13512 Ref: https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats Ref: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation Closes curl#13522
f4eb1c5
to
18650ea
Compare
\\?\
so that Windows will access the file.Prior to this change if a filename (when normalized internally by Windows to its full path) or a path was longer than MAX_PATH (260) then Windows would not open the path, unless it was already normalized by the user and had the
\\?\
prefix prepended.The
\\?\
prefix could not be passed to file:// so for example something like file://c:/foo/bar/filename255chars could not be opened prior to this change.There's some code in tool_doswin that will need to be modified as well to further remove MAX_PATH (aka PATH_MAX) limitation.
Ref: #8361
Ref: #13512
Ref: https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats
Ref: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
Closes #xxxx