ninja: Sporadic failure on Windows with `FindFirstFileExA`
ninja: error: FindFirstFileExA(note: including file: d:/a/swift-build/swift-build/sourcecache/swift-corelibs-foundation/corefoundation): The filename, directory name, or volume label syntax is incorrect.
I’ve been unable to isolate the exact scenario that this happens on, but I’ve seen this happen periodically on GitHub Actions builders recently. It has also happened a couple of times on Azure DevOps builders. The build rules don’t seem to have changed, so I suspect that this might be related to a Windows update (the builders do update periodically).
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 5
- Comments: 23 (1 by maintainers)
Commits related to this issue
- build: add a workaround for CMake 3.26.0 MSVC distributes CMake 3.26.0, which does not properly handle `clang-cl`'s output for `/showIncludes`. Add a workaround until MSVC updates the CMake distribu... — committed to compnerd/swift-build by compnerd a year ago
- build: add a workaround for CMake 3.26.0 (#580) MSVC distributes CMake 3.26.0, which does not properly handle `clang-cl`'s output for `/showIncludes`. Add a workaround until MSVC updates the CMake... — committed to compnerd/swift-build by compnerd a year ago
- build: add a workaround for CMake 3.26.0 See: ninja-build/ninja#2280 — committed to Chilledheart/yass by Chilledheart 8 months ago
I still got this error with cmake 3.28.3
I believe this was fixed in https://github.com/microsoft/CMake/commit/843fc607de7 which first appeared in cmake v3.26.3-msvc1. But MS is currently distributing cmake v3.26.0-msvc3.
Thus, this is not an ninja issue, but an issue with cmake. Furthermore it has been fixed, but MS hasn’t distributed the fixed executable yet.
A workaround is to define a cmake variable in the CMake command arguments box: -DCMAKE_CL_SHOWINCLUDES_PREFIX=“Note: including file:”
The build system generation will create a ninja.rules with the “” -> “Note: including file:”
If i edit CMakeFiles/rules.ninja after “Delete Cache and Reconfigure”, but before “Build All” then I can clean and rebuild repeatedly.
Happens to me whenever I tell cmake to use clang-cl instead of msvc on Windows. The problem is that the file name it wants to find is called
"note: inluding file: c:/...."and obviously, that is not a proper filename. I replaced all "note: " strings in my repository but still get this error. So I don’t know where it comes from.And btw, if I change the generator to “MinGW Makefiles”, it works. So this must be a ninja problem.