Closed maluke closed 10 months ago
See #1161.
Maybe we could fallback to a "slow" version of CanonicalizePath when the maximum is reached (i.e. one with a heap allocated array).
Also having what appears to be the same/similar issue in a Visual Studio 2019 CMake project once I link against Qt5
(target_link_libraries(CMakeProjectHelloWorld Qt5::Widgets)
):
ninja: fatal: path has too many components : E:\vcpkg\installed\x64-windows-static\debug\lib\Qt5Cored.lib "E:\Windows Kits\10\lib\10.0.18362.0\um\x64\mpr.lib" "E:\Windows Kits\10\lib\10.0.18362.0\um\x64\netapi32.lib" "E:\Windows Kits\10\lib\10.0.18362.0\um\x64\userenv.lib" "E:\Windows Kits\10\lib\10.0.18362.0\um\x64\version.lib" "E:\Windows Kits\10\lib\10.0.18362.0\um\x64\ws2_32.lib" "E:\Windows Kits\10\lib\10.0.18362.0\um\x64\kernel32.lib" "E:\Windows Kits\10\lib\10.0.18362.0\um\x64\user32.lib" "E:\Windows Kits\10\lib\10.0.18362.0\user32.lib" "E:\\Windows Kits\\10\\lib\\10.0.18362.0\\um\\x64\\shell32.lib" "E:\\Windows Kits\\10\\lib\\10.0.18362.0\\um\\x64\\uuid.lib" "E:\\Windows Kits\\10\\lib\\10.0.18362.0\\um\\x64\\ole32.lib" "E:\\Windows Kits\\10\\lib\\10.0.18362.0\\um\\x64\\advapi32.lib" "E:\\Windows Kits\\10\\lib\\10.0.18362.0\\um\\x64\\winmm.lib"
The ninja.exe
bundled with Visual Studio at E:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe
was 1.8.2
but even if I replaced this with 1.10.0
I am encountering the same issue.
I have just hit this limit. On Linux.
I did a script counting the slashes, and the issue is not reaching the path separator limit (as in #1161 or #1181). My maximum is 17 slashes.
However the "path" is more then 10MB long and has 133782 paths (semicolons). Strange this is that this happens on a build server in a build container on one server, but not on others.
edit: I found the issue in my CMake, the dependency list of a target was very long (wrong glob). But nevertheless the error is very hard to fix.
I just ran into this limit on Windows using CMake 3.14.5 and ninja. Number of files in path: 33 Length of path in bytes: 1049089
ninja version 1.9.0 on win (msys2, mingw64)
The directories are 5 levels deep, but a lot of files are listed for implied dependencies on a rule.
Is ninja limiting the number of dependencies intentionally? Is something about my usage makes it thinks that's one big path? Is it just a bug?
build.ninja
: