-E create_symlink is available on windows since CMake 3.13 (LLVM now uses 3.13.4)
It may needs administrator privileges or enabled developer mode (Windows 10)
See https://cmake.org/cmake/help/latest/release/3.13.html
Details
Diff Detail
Event Timeline
I don't have a Windows machine to test this out but the change looks reasonable to me and the "fallback to COPY" should probably be enough in this case.
Sorry, I don't have commit access. Thanks in advance if someone can commit the change. @kbobrovs
Note, there's a bug caused by these changes: LLVM bug 51692
TLDR: in Github Action (Windows) environment compiler builds "successfully", but links are broken and no copy is done.
The bug reporter tried to use 7zip to distribute llvm on Windows, but the 7zip on Windows cannot handle symbolic links properly in 7z format. Using 7zip to create tarball or wim can avoid this issue.
Oh, I see, thanks a lot for the context! I've looked into the bug and was
under the same impression but I was curious why this happened after the
commit I approved since the process looked similar. But also the pipeline
seemed to be working for the next revisions in the reporter's CI :thinking:
I confirm that it is a problem with 7zip, which is not preserving symlinks by default. Thanks for pointing to it.
The reason why this commit "broke" it for us, is because it introduced symlinks on Windows.
I'm still not sure that using symlinks on Windows is a good idea, given how poorly they are supported by the ecosystem.
For those who have similar issue - we end up using tar format produced by "7z a -ttar -snl" (-snl is essential) and then wrapped it by regular 7z.
Note, stock "tar" on Windows doesn't handle symlinks out of the box.
Qt Creator hit the same issue as others have had, 0 bytes clang-cl.exe due to packaging with 7zip.
I had to do a quick revert of this commit, since there is no option to disable this new functionality. There should be a LLVM_WINDOWS_DISABLE_SYMLINK or similar.
https://github.com/msys2/MINGW-packages/tree/34191f03a6da67f58b33ee2c756a142691746118/mingw-w64-clang maintains a list of revert patches, this is one of them.