From 2154f3b738306d2c45fb5243bb5c0eb9f3d1044e Mon Sep 17 00:00:00 2001 From: sdarwin Date: Tue, 1 Sep 2026 09:19:24 -0600 Subject: [PATCH] Fix search for clang-win assembler --- doc/src/history.adoc | 5 +++++ src/tools/clang-win.jam | 29 ++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/doc/src/history.adoc b/doc/src/history.adoc index 4c091c8dad..f726c8b5de 100644 --- a/doc/src/history.adoc +++ b/doc/src/history.adoc @@ -6,6 +6,11 @@ * *New*: Add minimal https://ecostd.github.io/[EcoStd] support. Minimal being self introspection information output. -- _René Ferdinand Rivera Morell_ +* Fix `clang-win` toolset initialization error, `missing argument native` from + `path.make`, on machines where `vswhere` does not find a Visual Studio + installation. The VS detection now includes Build Tools installs + (`vswhere -products *`), and a missing VS install is no longer a hard error. + -- _Sam Darwin_ == Version 5.5.3 diff --git a/src/tools/clang-win.jam b/src/tools/clang-win.jam index 86df5aee94..28eff36b87 100644 --- a/src/tools/clang-win.jam +++ b/src/tools/clang-win.jam @@ -140,15 +140,26 @@ rule init ( version ? : command * : options * ) local vswhere = [ os.environ "ProgramFiles(x86)" ] ; vswhere ?= [ os.environ "ProgramFiles" ] ; vswhere = "$(vswhere)/Microsoft Visual Studio/Installer/vswhere.exe" ; - local vspath = [ SPLIT_BY_CHARACTERS [ SHELL - "\"$(vswhere)\" -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath" - ] : "\r\n" ] ; - vspath = $(vspath[1]) ; - .notice "$(arch)-$(addr):" "using VS tools in '$(vspath)'" ; - local msvcpath = [ path.glob [ path.make "$(vspath)\\VC\\Tools\\MSVC" ] : * ] ; - msvcpath = [ path.glob "$(msvcpath[-1])/bin" : Host* ] ; - msvcpath = [ path.glob "$(msvcpath)" : * ] ; - .notice "$(arch)-$(addr):" "using msvc tools in" "'$(msvcpath)'" ; + local vspath ; + if [ path.exists $(vswhere) ] + { + # The "-products *" also finds Build Tools installs, which + # vswhere skips by default. Quoting the "*" is for when we are + # a Cygwin build, to bypass /bin/sh. + vspath = [ SPLIT_BY_CHARACTERS [ SHELL + "\"$(vswhere)\" -latest -products \"*\" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath" + ] : "\r\n" ] ; + vspath = $(vspath[1]) ; + } + .notice "$(arch)-$(addr):" "using VS tools in '$(vspath:E=)'" ; + local msvcpath ; + if $(vspath) + { + msvcpath = [ path.glob [ path.make "$(vspath)\\VC\\Tools\\MSVC" ] : * ] ; + msvcpath = [ path.glob "$(msvcpath[-1])/bin" : Host* ] ; + msvcpath = [ path.glob "$(msvcpath)" : * ] ; + } + .notice "$(arch)-$(addr):" "using msvc tools in" "'$(msvcpath:E=)'" ; local vsasmpath = [ path.glob "$(msvcpath)" : "$(target-assembler).*" ] ; if $(vsasmpath) {