-
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:
***@***.***>
|
I can confirm the above comment as well. Even though I configured Windows to allow long paths, Ninja is failing to build a React Native/Expo app with the New Architecture. |
Because Windows still sucks. |
True. But isn't it time to move on, and merge a solution? |
With #2321 and other PRs now merged, it seems to be fixed! We're just missing an official release, unfortunately.
externalNativeBuild {
cmake {
arguments "-DCMAKE_MAKE_PROGRAM=C:\\ninja\\ninja.exe", "-DCMAKE_OBJECT_PATH_MAX=1024"
}
} To explain why this is needed: Lastly, if you want to make this more "contributor-friendly", you can run something like edit 21/03/2024: replaced expired artifact link with a link to the latest workflow runs |
@Sculas I reinstalled Windows before trying this and assumed Windows 11 had long paths enabled by default. It doesn't, which is unfortunate. For anyone coming here due to this issue, make sure to do that first. |
Thanks !!!
Works great !! Thanks :-) |
So, what's the plan for migrating Windows API calls from ANSI to Unicode style? |
Why did latest release of ninja according to github was in 2022? |
@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. |
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: