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
[Win32] long path name support [Bug #12551] #4505
Conversation
|
I tested this using the following steps:
|
|
This can alternatively be done by adding the manifest resource to https://github.com/ruby/ruby/blob/master/win32/resource.rb, so this will also work with MinGW builds. I'll test some more. |
Implement long path support on Windows by applying Microsoft's recommended application manifest. To make this work on both Visual C++ and MinGW, include the manifest as a resource when generating the resource files. This way it will be embedded into the executables/libraries generated by both compilers. It's important for the manifest resource to have ID 1, otherwise GCC will embed a default manifest. Resource type 24 corresponds to manifest resources.[1] Note that in addition to this, the user needs to have long paths enabled either by modifying the registry or by enabling a group policy.[2] [1] https://docs.microsoft.com/en-us/windows/win32/menurc/resource-types [2] https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later
b3559ac
to
7f8cdcd
Compare
|
This works for me with Visual Studio 2019 and GCC 10 (MinGW). I think AppVeyor compiles from a different directory so that's why it can't find the manifest, I'll try to see if I can get the basedir somehow. |
|
Works! Nice! There was a failing test when I first pushed the PR: https://github.com/ruby/ruby/runs/2591987561?check_suite_focus=true. It seems related but I think it confirms that long paths work: Should |
Even with long paths, filenames on Windows are limited to 255 characters. Anything up to 255 raises ENOENT, higher values raise EINVAL.
|
@nobu what versions of ruby will this land in? 👀 |
It was added in ruby/ruby#4505
It was added in ruby/ruby#4505
It was added in ruby/ruby#4505
It also needs to be enabled in the registry. See https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later and ruby/ruby#4505
|
@larskanis @nobu what ruby versions will include this path fixes? |
|
I added the patch to all ruby branches of RubyInstaller here. That means that all versions of the next release series from 2.5 to 3.0 will include it. And it's already present in RubyInstaller-head. |
|
I just got this Thank you so much! 👍❤ |
It was added in ruby/ruby#4505
Implement long path support on Windows by applying Microsoft's recommended application manifest.
To make this work on both Visual C++ and MinGW, include the manifest as a resource when generating the resource files. This way it will be embedded into the executables/libraries generated by both compilers.
It's important for the manifest resource to have ID 1, otherwise GCC will embed a default manifest. Resource type 24 corresponds to manifest resources.1
Note that in addition to this, the user needs to have long paths enabled either by modifying the registry or by enabling a group policy.2