Skip to content

clang-win: toolset fails to initialize when only Visual Studio Build Tools is installed #620

Open

Description

@alandefreitas

clang-win.init locates Visual Studio with vswhere but does not pass -products *. On a machine with only Visual Studio Build Tools it gets an empty path and crashes in path.make. It neither configures the toolset nor reports a useful error.

Use case

boostorg/url runs its CI matrix through cpp-actions. For the clang-cl entry, the CMake build passes, and then the b2 step runs:

b2.exe -j 8 --toolset=clang-win address-model=64 cxxstd=20,23,latest variant=release warnings-as-errors=on embed-manifest-via=linker --abbreviate-paths libs/url/test

That step fails immediately in clang-win.init. Full log here (step "B2 Workflow", group "Build and Test"):

https://github.com/boostorg/url/actions/runs/38317560556/job/115038635318

This is from boostorg/url#1007. The runner is a C++ Alliance self-hosted windows-2025 machine with Visual Studio 2022 Build Tools only. The same log shows that. Every MSVC path is under C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\. The environment comes from BuildTools\Common7\Tools\VsDevCmd.bat ("Visual Studio 2022 Developer Command Prompt v17.14.39").

The identical step gets past clang-win.init on GitHub's hosted windows-2025 image, which has Visual Studio Enterprise installed (it later fails on an unrelated warning in our own code):

https://github.com/alandefreitas/url/actions/runs/38305599956/job/114999283406

The only difference between the two machines that matters here is which Visual Studio product they have.

Environment

  • Boost.Build from the Boost superproject develop (2026-10-12)
  • Windows Server 2025, Visual Studio 2022 Build Tools 17.14 only (no Community/Professional/Enterprise)
  • LLVM 22 at C:\Program Files\LLVM\bin (clang-cl 22)
  • Seen on the C++ Alliance self-hosted GitHub Actions runners (windows-2025-aws) in boostorg/url PR 1007, job "Clang-CL 22: C++20-23"

Steps to reproduce

On a machine with only Build Tools and LLVM installed:

b2 --toolset=clang-win address-model=64 cxxstd=20 variant=release libs/url/test

Actual result

tools/build/src/tools/clang-win.jam:148: in clang-win.init
error: rule path.make ( native )
error: called with: ( )
error: missing argument native

Expected result

The toolset initializes using the Build Tools install, as the msvc toolset already does with the same install. Failing that, it stops with a clear message such as "Cannot configure toolset clang-win: no Visual Studio installation with the VC tools found".

Cause

In src/tools/clang-win.jam, init runs:

vswhere -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath

Per the vswhere documentation, -products defaults to Community, Professional and Enterprise. vswhere lists Build Tools only when given -products *. On a Build Tools-only machine the result is empty, and the next line passes that empty value to path.make:

vspath = $(vspath[1]) ;
local msvcpath = [ path.glob [ path.make "$(vspath)\\VC\\Tools\\MSVC" ] : * ] ;

Suggested fix

  1. Add -products * to the vswhere invocation.
  2. Check vspath before calling path.make and raise errors.error with a readable message when it is empty.

Workaround

We're currently skipping the clang-win toolset on such machines. boostorg/url currently does this in its CI (if: matrix.compiler != 'clang-cl' on the b2 step) and relies on the CMake build for clang-cl coverage.

Activity

  1. grafikrobot commented on Oct 18, 2026

    @grafikrobot
    Member

    Like fixed by acafa72 ? @alandefreitas can you check if it's now working for you?

  2. added
    bugSomething isn't working
    needinfoNeeds additional information from reporter
    on Oct 18, 2026
  3. self-assigned this
    on Oct 18, 2026
  4. moved this to 👀 In review in BFG Taskson Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneedinfoNeeds additional information from reporter

Type

No type

Projects

  • Status
    👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions