Closed dimitry-unified-streaming closed 3 months ago
Note that I found out that this was due to some left-over cruft in the MSVC installation directory, which was apparently not removed during an upgrade.
E.g. the detection phase runs vswhere.exe
and finds the VS2022 installation base directory to be C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools
, and then uses the wildcard ../../VC/Tools/MSVC/*/bin/Host*/*
to retrieve the directories underneath.
However, my MSVC directory looked like:
Directory of C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\*
2024-02-14 12:58 <DIR> 14.38.33130
2024-02-14 12:59 <DIR> 14.39.33519
The 14.38.33130
was the left-over directory because there was still old cruft in there, but 14.39.33519
is the actual installation directory. It apparently picked the first one to use to find cl.exe
, but that executable was no longer in there.
Deleting the 14.38.33130
directory, and making sure there is only one directory under C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC
appears to have solved this particular problem.
Note that now with Visual Studio 2022 v17.10, b2's detection is broken again, but I will submit another issue for that.
Note: it seems somebody else already reported the VS2022 v17.10 issue in #391, although they ran into this with the preview edition.
Make sure you completed the following tasks
Environment and version details
b2 --debug-configuration
in your project.Brief problem description
After updating Microsoft Visual Studio 2022 from v17.8.5 to v17.9.0,
b2
cannot detect toolsetmsvc-14.3
anymore, stating "Did not find command for MSVC toolset". This used to work just fine, having used this many times in the past.Steps to reproduce the issue
cmd.exe
with its default environment (e.g.vcvars64.bat
ordevenv.bat
have not been run)Add files:
b2 toolset=msvc-14.3
cl.exe
Actual behavior summary
As above.
b2
's msvc.jam seems to runvswhere.exe
as before, and as far as I can see,vswhere.exe
gives the same information as always, but something seems to have changed causingb2
to say it cannot find the MSVC toolset fortoolset=msvc-14.3
.This can be worked around by running
vcvars64.bat
manually in the cmd.exe prompt, but this was never necessary before Visual Studio 2022 v17.9.0.Expected behavior summary
In the past,
b2 toolset=msvc-14.3
would automatically find Visual Studio 2022 binaries viavswhere.exe
, and would write outbin\standalone\msvc\msvc-14.3\address-model-64\msvc-setup.bat
containing the necessary environment variables. This no longer works.Note that
b2 toolset=msvc-14.2
still works fine: