fix(build): require VC C++ tools in vswhere query
Two 18.x installs coexisted: VS2026 Community (full IDE, has VC v180) and a BuildTools at (x86)\Microsoft Visual Studio\18\BuildTools that has MSBuild but NO VC v180 targets. The vswhere query only required Microsoft.Component.MSBuild, so -latest could (and did) return the C++-less BuildTools -> MSB4019. Also require Microsoft.VisualStudio.Component.VC.Tools.x86.x64 so only installs with the C++ toolset match; the broken BuildTools is excluded and 2026\Community is selected. CI VM BuildTools has the C++ workload so it still matches. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -143,6 +143,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-latest',
|
'-latest',
|
||||||
'-prerelease',
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-latest',
|
'-latest',
|
||||||
'-prerelease',
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-latest',
|
'-latest',
|
||||||
'-prerelease',
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-latest',
|
'-latest',
|
||||||
'-prerelease',
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-latest',
|
'-latest',
|
||||||
'-prerelease',
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-latest',
|
'-latest',
|
||||||
'-prerelease',
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-latest',
|
'-latest',
|
||||||
'-prerelease',
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
|
|||||||
Reference in New Issue
Block a user