Require Visual Studio 2026 (v145) for native C++ projects - #2096
Draft
tyrielv wants to merge 4 commits into
Draft
Conversation
The native VFS projects pinned PlatformToolset v143, which ships only with Visual Studio 2022. Build agents and developer machines that carry Visual Studio 2026 do not have the v143 toolset, so a clean native build fails with "the build tools for v143 cannot be found". Retarget the native projects to the v145 toolset that ships with Visual Studio 2026 (product line 18.x) and update the build provisioning to match: - Set PlatformToolset to v145 in the five native .vcxproj files. - Update .vsconfig to request the v145 build tools component. - Update install-vs-cpp-workload.ps1 to require VS 2026 (18.0+) and to download the VS 2026 Build Tools bootstrapper. - Update the Readme and a stale Build.bat comment. Assisted-by: Claude Opus 4.8 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
The default windows-11-arm runner image still ships Visual Studio 2022, which lacks the v145 toolset the native projects now target. Use the preview windows-11-vs2026-arm image so the arm64 build has VS 2026. Revert to windows-11-arm once its default image migrates to VS 2026. Assisted-by: Claude Opus 4.8 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Build agents (and the windows-11-vs2026-arm runner) carry both VS 2022 and VS 2026. Build.bat located MSBuild with a bare 'where msbuild.exe', which returned the VS 2022 MSBuild; the native projects target the v145 toolset, so that MSBuild failed with MSB8020 (v145 build tools not found). Prefer 'vswhere -latest' (newest install, 18.x before 17.x) for both MSBuild and vcvarsall, and fall back to PATH only when vswhere is unavailable. Pin the setup-msbuild CI step to VS 2026 (18.0+) as well. Use the canonical VC.Tools.x86.x64 component in .vsconfig so the latest (v145) toolset installs. Assisted-by: Claude Opus 4.8 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
The VS 2026 native arm64 compiler fails to build GVFS.NativeTests with C3859 (failed to create virtual memory for PCH) and C1076 (internal heap limit reached) -- a known limitation where ARM64 native compiler support lags x64. Initialize the VC++ environment with amd64_arm64 (x64-hosted arm64 cross toolset, which Visual Studio uses by default for arm64) instead of the native arm64 toolset. The cross compiler has the address space to build the PCH and produces equivalent arm64 binaries. x64 builds are unchanged. Assisted-by: Claude Opus 4.8 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
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.
What
Retarget the native C++ projects from the v143 toolset (Visual Studio 2022)
to the v145 toolset that ships with Visual Studio 2026.
Why
The five native
.vcxprojprojects pinnedPlatformToolsettov143. Thattoolset ships only with Visual Studio 2022. On a machine or build agent that
carries Visual Studio 2026 but not 2022, a clean native build fails because
the v143 toolset is not present. The GitHub-hosted
windows-2025runner nowships Visual Studio 2026 (v145), so the pinned v143 is also a CI risk.
Changes
PlatformToolsettov145in the five native.vcxprojfiles..vsconfigto request theVC.v145.x86.x64component..azure-pipelines/scripts/install-vs-cpp-workload.ps1to requireVS 2026 (18.0+) and download the VS 2026 Build Tools bootstrapper.
Build.batcomment.Validation
Build.bat(Debug, x64) succeeds end to end: native C++ hookscompile and link with v145, managed NativeAOT publish, payload assembly,
and the Inno Setup installer all produce output.
windows-2025(x64) andwindows-11-arm(arm64) runners, both of which ship VS 2026 with v145.Notes
Targets
vnext. This raises the build-tools floor to VS 2026, a behaviorchange for the developer toolchain rather than a 2.0 regression fix, so it
soaks on
vnextbefore promotion.