-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Long paths on Windows: Cannot even use 260 chars #2143
Comments
So any path-shortening via relative paths starting with dub/source/dub/generators/build.d Line 223 in 4c1ce74
|
See dlang/dub#2143. It's the only change from previous v1.26.0.
See dlang/dub#2143. It's the only change from previous v1.26.0.
True, UNC paths would be the proper fix, although we'd have to try with all involved linkers and compilers whether they are able to handle those. It would also be nice though if Phobos would automatically perform that conversion, if needed. |
As stated above, Microsoft's linker doesn't support long paths as of VS 2019. From the dub side, there are things that can be done, like using the wide I/O functions consistently. This issue was about dub further shrinking the max path length from 260 to ~220 though, depending on where your src repos are cloned to. |
@kinke you said Microsoft's linker doesn't support long paths anymore - do you mean it doesn't support UNC paths? |
It has never supported them - IIRC, the |
WTF - just tested it again to be sure, and it (the MS linker) does seem to work now with an absolute path > 300 chars, not even requiring any prefix. This is on my native Win10 (21H1) box, the tests ~2 weeks ago were in a Win10 VM (20H2 or 20H1); I'm not sure whether the VS 2019 installation in the VM is totally up-to-date - here on my native box, it's v16.10.1. |
Seems independent from Windows, as it's not working with VS 2017 v15.9.25. VS 2019 v16.10 was a pretty recent upgrade IIRC, so I think it may have made the difference. |
Just FYI, there's an option on the Windows side to enable support for larger paths. I'm pretty sure that not much software is taking it into an account (especially if they assumed that MAX_PATH can't change at runtime), but perhaps this new VS update is forward compatible with it? |
I've checked the VS 2019 link.exe manifest, and it still doesn't specify I've also quickly looked into the dub file-exists check, which boils down to |
I'm seeing issues with long paths on a recent Windows 10, with LDC and Visual Studio 2019 in this case.
Errors with the MS linker
E.g.:
Interesting because the relative path length is only 223, and the absolute one (
C:\Users\packer\AppData\…
) is 227 chars, nowhere near the 260 limit. Edit: Ah,C:\Users\packer\dev\SIL\lang\test_plugin1\..\..\..\..\AppData\…
exceeds 260.One workaround is using
-link-internally
with LDC, which makes it use the LLD linker integrated in LDC.Another workaround is converting the relative path toEdit: Nope,\\?\C:\Users\packer\AppData\…
(in the LDC cmdline issued by dub; these are simply forwarded to the linker). This could be done by LDC as well, but see below.link.exe
doesn't support the\\?\
prefix for absolute paths > 260.Superfluous rebuilds
I was about to tackle this in LDC, but then came across another very annoying bit: such dependencies are rebuilt again and again, even if nothing has changed. Running dub with
-v
shows:(The file obviously exists.) So handling this in the compiler alone isn't sufficient.
The text was updated successfully, but these errors were encountered: