Fix search for clang-win assembler - #615
Open
sdarwin wants to merge 1 commit into
Open
Conversation
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.
Fix clang-win init failure when vswhere does not find Visual Studio (e.g. Build Tools-only installs)
Problem
Since B2 5.5.0, initializing the clang-win toolset hard-fails on any machine
where
vswheredoes not report a Visual Studio installation:This is what has been failing the boostorg/beast develop-branch CI since late
June 2026 (last green run June 25, first failing run July 6, with no change to
the runners themselves):
The only failing jobs are the two that use toolset=clang-win:
The timing is explained by the boost superproject's tools/build submodule
update on June 28 / July 1, 2026, which pulled in the 5.5.0 release and with
it commit 5865604 ("Fix search for clang-win assembler.", March 11, 2026).
That commit added a vswhere-based search for the MSVC assembler to
clang-win.init.
Root cause
Two issues in the vswhere block added by 5865604:
The vswhere invocation omits
-products *. By default vswhere onlyreports Community/Professional/Enterprise products, so on machines that
only have Visual Studio Build Tools installed (very common for CI
runners, including the ones used by boostorg CI) it returns nothing.
Note that B2's own msvc.jam and vswhere_usability_wrapper.cmd both
already pass
-products *for exactly this reason - which is also whythe msvc toolset jobs on the same runners kept working.
The result is used unguarded. When vswhere prints nothing,
vspathisan empty list, so the interpolated string
expands to an empty list (standard Jam expansion semantics) and
path.make is invoked with zero arguments, producing the
"missing argument native" error above. This makes an optional
convenience (locating the MSVC assembler) into a fatal error, even
though the code already has fallbacks (assembler from the linker
directory or PATH) for when the search finds nothing.
The mechanism is easy to reproduce on any platform:
Fix
In clang-win.jam:
-products *to vswhere (quoted the same way msvc.jam does, forCygwin builds), so Build Tools installations are found.
installation path. If nothing is found, msvcpath/vsasmpath stay empty
and the existing fallback logic (assembler next to the linker, then
PATH) takes over, as it did before 5.5.0.
Also adds a history.adoc entry.
Testing
interpolated path.make argument) and that the guarded version survives
both the empty and non-empty cases.
runs through toolset.using (up to the expected clang-cl detection).
-products *behavior matches the existing usage inmsvc.jam and vswhere_usability_wrapper.cmd, which correctly find Build
Tools-only installations on the affected runners today (visible in the
boostorg CI logs as "Found with vswhere C:\Program Files (x86)
Microsoft Visual Studio\2022\BuildTools").
With this fix, clang-win init succeeds on:
error; now falls back to assembler from linker dir / PATH).