Skip to content

Conversation

aganea
Copy link
Member

@aganea aganea commented Apr 11, 2025

If clang-cl.exe and lld-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/10657991

I also added a --force-msvc option to the script, to use MSVC even if clang-cl is installed.

@aganea aganea requested review from tru, mstorsjo, tstellar and zmodem April 11, 2025 22:14
@zmodem zmodem requested a review from omjavaid April 14, 2025 09:04
Copy link
Collaborator

@zmodem zmodem left a 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.

Copy link
Collaborator

@tru tru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@aganea aganea merged commit 7cb7b2d into llvm:main Apr 15, 2025
11 checks passed
@aganea aganea deleted the feat/build_windows_package_with_clang-cl branch April 15, 2025 21:37

if "%force-msvc%" == "" (
where /q clang-cl
if errorlevel 0 (
Copy link
Collaborator

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.

aganea added a commit that referenced this pull request Aug 19, 2025
… 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)
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Aug 19, 2025
…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)
tru pushed a commit to llvmbot/llvm-project that referenced this pull request Aug 21, 2025
… 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)
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Aug 21, 2025
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants