From b05249770142bb2d297d94cb8e0856d2732be666 Mon Sep 17 00:00:00 2001 From: Simone Date: Sun, 17 May 2026 21:57:13 +0200 Subject: [PATCH] fix(build): pass -prerelease to vswhere (find VS2026) VS2026 ships on the prerelease channel; vswhere omits it unless -prerelease is given. Without it _find_msbuild_via_vswhere returned nothing, so the path fallback picked an incomplete (x86)\Microsoft Visual Studio\18\BuildTools install (MSBuild present but no VC v180 targets) -> MSB4019 on hosts that have VS2026 IDE but not BuildTools. -prerelease is harmless on the CI VM (BuildTools is found regardless). Co-Authored-By: Claude Opus 4.7 --- tools/legacy/build_plugin_2501_vs2022.py | 1 + tools/legacy/build_plugin_2501_vs2026.py | 1 + tools/legacy/build_plugin_2600_vs2026.py | 1 + tools/legacy/build_plugin_2601_vs2026.py | 1 + tools/legacy/build_plugin_vs2022.py | 1 + tools/legacy/build_plugin_vs2026.py | 1 + tools/legacy/build_plugin_zstd_vs2026.py | 1 + 7 files changed, 7 insertions(+) diff --git a/tools/legacy/build_plugin_2501_vs2022.py b/tools/legacy/build_plugin_2501_vs2022.py index 3216750..a60a0f3 100644 --- a/tools/legacy/build_plugin_2501_vs2022.py +++ b/tools/legacy/build_plugin_2501_vs2022.py @@ -141,6 +141,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str str(_VSWHERE_PATH), '-version', _VS_VERSION_RANGE[ver], '-latest', + '-prerelease', '-requires', 'Microsoft.Component.MSBuild', '-find', r'MSBuild\**\Bin\MSBuild.exe', ], diff --git a/tools/legacy/build_plugin_2501_vs2026.py b/tools/legacy/build_plugin_2501_vs2026.py index af4bf47..381c4b4 100644 --- a/tools/legacy/build_plugin_2501_vs2026.py +++ b/tools/legacy/build_plugin_2501_vs2026.py @@ -150,6 +150,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str '-products', '*', '-version', _VS_VERSION_RANGE[ver], '-latest', + '-prerelease', '-requires', 'Microsoft.Component.MSBuild', '-find', r'MSBuild\**\Bin\MSBuild.exe', ], diff --git a/tools/legacy/build_plugin_2600_vs2026.py b/tools/legacy/build_plugin_2600_vs2026.py index 9885b7e..6eea737 100644 --- a/tools/legacy/build_plugin_2600_vs2026.py +++ b/tools/legacy/build_plugin_2600_vs2026.py @@ -150,6 +150,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str '-products', '*', '-version', _VS_VERSION_RANGE[ver], '-latest', + '-prerelease', '-requires', 'Microsoft.Component.MSBuild', '-find', r'MSBuild\**\Bin\MSBuild.exe', ], diff --git a/tools/legacy/build_plugin_2601_vs2026.py b/tools/legacy/build_plugin_2601_vs2026.py index 1becb6d..8ba9ef5 100755 --- a/tools/legacy/build_plugin_2601_vs2026.py +++ b/tools/legacy/build_plugin_2601_vs2026.py @@ -150,6 +150,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str '-products', '*', '-version', _VS_VERSION_RANGE[ver], '-latest', + '-prerelease', '-requires', 'Microsoft.Component.MSBuild', '-find', r'MSBuild\**\Bin\MSBuild.exe', ], diff --git a/tools/legacy/build_plugin_vs2022.py b/tools/legacy/build_plugin_vs2022.py index 9732cea..ba709e8 100644 --- a/tools/legacy/build_plugin_vs2022.py +++ b/tools/legacy/build_plugin_vs2022.py @@ -146,6 +146,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str str(_VSWHERE_PATH), '-version', _VS_VERSION_RANGE[ver], '-latest', + '-prerelease', '-requires', 'Microsoft.Component.MSBuild', '-find', r'MSBuild\**\Bin\MSBuild.exe', ], diff --git a/tools/legacy/build_plugin_vs2026.py b/tools/legacy/build_plugin_vs2026.py index 15a0efe..553e326 100644 --- a/tools/legacy/build_plugin_vs2026.py +++ b/tools/legacy/build_plugin_vs2026.py @@ -150,6 +150,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str '-products', '*', '-version', _VS_VERSION_RANGE[ver], '-latest', + '-prerelease', '-requires', 'Microsoft.Component.MSBuild', '-find', r'MSBuild\**\Bin\MSBuild.exe', ], diff --git a/tools/legacy/build_plugin_zstd_vs2026.py b/tools/legacy/build_plugin_zstd_vs2026.py index 662cea5..9a905a1 100644 --- a/tools/legacy/build_plugin_zstd_vs2026.py +++ b/tools/legacy/build_plugin_zstd_vs2026.py @@ -150,6 +150,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str '-products', '*', '-version', _VS_VERSION_RANGE[ver], '-latest', + '-prerelease', '-requires', 'Microsoft.Component.MSBuild', '-find', r'MSBuild\**\Bin\MSBuild.exe', ],