Skip to content

Commit 8846017

Browse files
authored
ci(vs-build): adapt to Visual Studio 2026 default on windows-latest (#6275)
The `windows-latest` runner image migration that began on June 8, 2026 and completes by June 15, 2026 swaps Visual Studio 2022 for Visual Studio 2026 by default (see [actions/runner-images#14017](actions/runner-images#14017)). That, in turn, leaves the `vs-build` job broken because of two independent things baked into the workflow. First, CMake 4.x now picks up the `Visual Studio 18 2026` generator on this image, and that generator writes a `.slnx` (XML solution) file rather than the classic `.sln`. The behavior is explicit in [`cmGlobalVisualStudioGenerator::GetSLNFile`](https://github.com/Kitware/CMake/blob/v4.3.2/Source/cmGlobalVisualStudioGenerator.cxx#L1147-L1159), which appends `"x"` to the filename whenever the generator version is `VS18` or newer. The MSBuild step then trips over the missing `git.sln`: ``` MSBUILD : error MSB1009: Project file does not exist. Switch: git.sln ``` A representative failure is [actions run 27264770241](https://github.com/git-for-windows/git/actions/runs/27264770241/job/80556419519). Second, the step has been pinning `-property:PlatformToolset=v142` since [889cacb](889cacb6) (2020), when the job was first wired up for Visual Studio 2019. The new VS 2026 image only ships the v144 toolset plus a v143 compatibility component (`Microsoft.VisualStudio.Component.VC.14.44.17.14.x86.x64`); v142 is simply not installed any more, so even after the `.slnx` rename the pin would fail in its own right. This PR therefore changes the MSBuild invocation to reference `git.slnx` and drops the v142 toolset pin, letting MSBuild use whatever toolset CMake chose during configuration (v144 on the current image). MSBuild 18, which the new image ships, understands `.slnx` natively, so no further plumbing is needed.
2 parents 33d828c + 556da21 commit 8846017

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ jobs:
199199
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
200200
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows -DHOST_CPU=${{ matrix.arch }}
201201
- name: MSBuild
202-
run: msbuild git.sln -property:Configuration=Release -property:Platform=${{ matrix.arch }} -maxCpuCount:4 -property:PlatformToolset=v142
202+
run: |
203+
$sln = if (Test-Path git.slnx) { 'git.slnx' } else { 'git.sln' }
204+
msbuild $sln -property:Configuration=Release -property:Platform=${{ matrix.arch }} -maxCpuCount:4
203205
- name: bundle artifact tar
204206
shell: bash
205207
env:

0 commit comments

Comments
 (0)