-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[llvm] Build Windows release package with clang-cl if possible #135446
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
[llvm] Build Windows release package with clang-cl if possible #135446
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. +omjavaid who's been working on this script lately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
||
if "%force-msvc%" == "" ( | ||
where /q clang-cl | ||
if errorlevel 0 ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose I should have caught this in review, but I ran into it when building 20.1.0-rc1 instead :-)
Apparently if errorlevel 0
will succeed if the error level is >= 0
, i.e. in our case we will take the branch also when where /q clang-cl
is not successful. (E.g. https://devblogs.microsoft.com/oldnewthing/20080926-00/?p=20743)
I'll work around this by passing --force-msvc
, but it also needs to be fixed.
… in PATH (#149597) The checks for detecting if `clang-cl` and `lld-link` are in `%PATH` were wrong. This fixes the comment in #135446 (comment)
…clang-cl is in PATH (#149597) The checks for detecting if `clang-cl` and `lld-link` are in `%PATH` were wrong. This fixes the comment in llvm/llvm-project#135446 (comment)
… in PATH (llvm#149597) The checks for detecting if `clang-cl` and `lld-link` are in `%PATH` were wrong. This fixes the comment in llvm#135446 (comment) (cherry picked from commit 13391ce)
…clang-cl is in PATH (#149597) The checks for detecting if `clang-cl` and `lld-link` are in `%PATH` were wrong. This fixes the comment in llvm/llvm-project#135446 (comment) (cherry picked from commit 13391ce)
If
clang-cl.exe
andlld-link.exe
are installed in%PATH%
, the Windows release build script will now use these by default, in place of MSVC. The reason for doing this is that MSVC still has, for the past year(s), a O(N^2) behavior when building certain LLVM source files, which leads to long build times (minutes per file). A report was filled here: https://developercommunity.visualstudio.com/t/ON2-in-SparseBitVectorBase-when-com/10657991I also added a
--force-msvc
option to the script, to use MSVC even if clang-cl is installed.