-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Should support filename longer than 260 characters #1900
Comments
Duplicate of #1514. |
#1514 was removed by GitHub because the user who created it was banned or something. No idea why they won't simply remove his posts only ... Anyway, I will reopen this one then. #1514 can still be accessed via the GitHub API: https://api.github.com/repos/ninja-build/ninja/issues/1514/comments |
Hi @jhasse, From the page you linked, the user needs to edit the registry to enable long path support, and also the application needs to declare it in its own manifest (pasted from that page):
Presumably adding this to ninja.manifest should work? Or how would this impact compatibility with old Windows? Thanks. |
Oh #1939 already does that actually. |
So, what are the next steps for this issue? |
|
I made a PR: #2289 |
Hi @parbo FYI: It seems that the Windows Universal C CRT only calls CreateFileW. It performs internally a codepage\utf-8 conversion to a wchar_t before calling CreateFileW: |
Hmm, why didn't it work with fopen then? Maybe the longPathsAware manifest
doesn't extend through to linked libraries/dll:s?
…On Fri, Apr 21, 2023, 10:26 Victor Derks ***@***.***> wrote:
Hi @parbo <https://github.com/parbo>
FYI: It seems that the Windows Universal C CRT only calls CreateFileW. It
performs internally a codepage\utf-8 conversion to a wchar_t before calling
CreateFileW:
C:\Program Files (x86)\Windows
Kits\10\Source\10.0.22621.0\ucrt\lowio\open.cpp (method _sopen_nolock at
line 833 for example)
—
Reply to this email directly, view it on GitHub
<#1900 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA52CQ7SL6436E4ZQDQI67LXCJACXANCNFSM4VDY46VA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@parbo. I am assuming that the longPathsAware manifest option applies to the .exe and is enabled process wide at startup or not. I didn't do a debug session in Ninja, just a debug-trace of a local app that uses fopen on Windows 11. |
Maybe only some of the `*A` functions needed replacing, and not the `fopen`
et al.
…On Fri, Apr 21, 2023, 16:16 Victor Derks ***@***.***> wrote:
@parbo <https://github.com/parbo>. I am assuming that the longPathsAware
manifest option applies to the .exe and is enabled process wide at startup
or not. I didn't do a debug session in Ninja, just a debug-trace of a local
app that uses fopen on Windows 11.
—
Reply to this email directly, view it on GitHub
<#1900 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA52CQ36XK7XM3Q4M5GONNDXCKJE7ANCNFSM4VDY46VA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@XantreGodlike Because the last release of ninja was in 2022. |
Do new releases be planned? |
I tried with extra cmake flags but the problem still persist for me on latest master. The registry flag is enabled for long path , I tried to add some debugging prints to see what's happening and found the flag is not getting set, the |
You're using MinGW, @Sculas was referring to the artifact from GitHub Actions which builds with MSVC. Can you try that instead? Maybe it makes a difference because of the UCRT. |
The above built artifact link has expired. But I tried the latest built from the master (ninja-build-artifact), I no longer see the ninja error due long path however my build still fails, Now this could be the MinGW that might be causing it to fail now. |
The artifact link doesn't link to anywhere to download anything, so I assume you mean the latest version 1.11.1? I have an RN project and a library (react-native-vision-camera) is giving me this error. I enabled long paths and tried your method by adding the code to my build.gradle and also to the camera's build.gradle, none worked. So maybe it's the ninja.exe that I was using? The only thing that worked was rename my project path from |
There seem to be some issues left (only MinGW build? Without setting the registry value it should still not work?), but some are fixed. I will close this PR, please create new issues with specific failures that you see with 1.12.0 and in which circumstances they occur.
No, it was a master build with some changes not in 1.11.1. Please try with 1.12.0 again. |
ninjia 1.12.1 still has not been solved "Filename longer than 260 characters Error" on windows( even Enablelongpath). So a temporary way is to shorten the file name(directory name). For python -m pip install, Temporarily "uuid.uuid4().hex[:8]" at "pip/_internal/req/req_install.py", and after install package, recovery to default. |
ninjia 1.10.2 still has not been solved "Filename longer than 260 characters Error" on windows( even Enablelongpath). |
Can you provide exact reproduction steps so we can verify that ourselves (and verify the Ninja version being used too)? |
|
You're running Ninja 1.10.2, correct? This issue has been fixed in v1.12.0 (get the latest version here). @SidneyLann Next time though, please read the issue comments before you post your own comment saying a version from 4 years ago doesn't work. Numerous fixes have been posted here already, and it was even closed with a "fixed in 1.12.0" comment. Lastly, it seems your reproducer project is missing the React Native workaround specified here: #1900 (comment) |
The provided workaround (#1900 (comment)) doesn't work for me. I get the error even with the Windows fix, the new
The new Moving my project closer to the root of my drive solves the issue. EDIT: I ran "npx expo prebuild --clean" and "gradlew clean" but it didn't solve the issue. EDIT2: replacing the old |
Well, I can see that it is a limitation from Microsoft Windows.
But MSDN suggests that this limitation may be removed.
Enable Long Paths in Windows 10, Version 1607, and Later
And there are cases we have to use long paths (when handling some really complicated 3rd-party projects).
Maybe ninja could only raise a warning, but do not stop the build, like cmake does?
The text was updated successfully, but these errors were encountered: