Improve clang-cl discovery for Windows ARM64 builds#1060
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1060 +/- ##
==========================================
- Coverage 95.80% 92.65% -3.15%
==========================================
Files 61 71 +10
Lines 8143 10149 +2006
Branches 0 10149 +10149
==========================================
+ Hits 7801 9404 +1603
- Misses 342 452 +110
- Partials 0 293 +293 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7dd8643 to
d7aa1fe
Compare
e689cb0 to
d211d9b
Compare
d211d9b to
72cb4d8
Compare
72cb4d8 to
670f444
Compare
geedo0
approved these changes
Apr 14, 2026
WillChilds-Klein
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues:
Addresses #1056
Description of changes:
On
aarch64-pc-windows-msvc, the cc_builder requiresclang-clinstead of MSVC'scl.exe—cl.execan't handle.SARM assembly files or several clang-style C flags we rely on. Previously, the build script only looked forclang-clonPATH. If it wasn't there (e.g., building from a regular shell rather than a VS Developer Shell), the build would silently fall through tocl.exeand fail with a wall of inscrutable warnings and a linker error about missing.ofiles.This change has the build script discover
clang-clinside the Visual Studio installations by leveraging thecccrate's existing VS toolchain discovery. Ifclang-clisn't onPATH, we locatecl.exethroughcc::windows_registry, walk up to the VS root, and probe forVC\Tools\Llvm\{ARM64,x64}\bin\clang-cl.exe. The result is cached viaOnceLockto avoid redundant work acrosscheck_dependenciesandbuildcalls.When
clang-clcan't be found at all, the cc_builder now emits an actionable warning telling the user to install the "C++ Clang Compiler for Windows" VS component before the build fails.Call-outs:
cmake_builderalready handles this differently — it usesgenerator_toolset("ClangCL")which tells CMake's VS generator where to find clang-cl. Thecmake_builderchange here just moves theclang-cldependency check out of the nasm-specific block so it applies independently.check_dependencieswhen clang-cl is missing. Doing so would causeget_builderto fall through toCmakeBuilder, which would produce a misleading "Missing dependency: cmake" error for users who don't have CMake installed.Testing:
CI job (
build-clang-cl-discovery-test) onwindows-11-armthat removes clang-cl from PATH and verifies the build still succeeds via the fallback discovery path.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.