CI: find vcvarsall.bat with vswhere - #407
Merged
Merged
Conversation
The windows jobs named the Visual Studio 2022 Enterprise install path directly. The windows-2025 runner image now carries Visual Studio 2026, so that path is not there and all four MSVC jobs fail at the first step with "The system cannot find the path specified". vswhere reports the installation that has the C++ tools, whatever version of Visual Studio the image was built with.
davidchisnall
approved these changes
Aug 7, 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.
The windows jobs have failed since the runner image moved to Visual
Studio 2026. The matrix names C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build,
and the first step's dir on that path reports "The system cannot find the path
specified", so the job stops before checkout. The same jobs fail the same way
on master.
The install on windows-2025 is now under C:\Program Files\Microsoft Visual
Studio\18\Enterprise. Rather than name that path, the first step asks vswhere
for the latest installation carrying the C++ tools and writes its vcvarsall.bat
to the environment; Configure CMake and Build call it from there. vswhere sits
at a fixed location under Program Files (x86) on every Windows runner image.
The step stops with a message if there is no such installation, or if
vcvarsall.bat is not where it says.
Verified on a run of this branch: every windows job found the install under
C:\Program Files\Microsoft Visual Studio\18\Enterprise, configured, built,
and passed 106 of 106 tests.