Skip to content

[v3] fix(windows): static builds vswhere.exe -product * - #1149

Merged
crazywhalecc merged 2 commits into
crazywhalecc:v3from
luthermonson:fix/vswhere-products
May 22, 2026
Merged

crazywhalecc merged 2 commits into
crazywhalecc:v3from
luthermonson:fix/vswhere-products

Conversation

@luthermonson

Copy link
Copy Markdown
Contributor

visual studio has headless buildtools which is typically used in build pipelines, for some reason vswhere.exe only knows to look for Enterprise/Professional/Community unless you specify with the parameter -product *. This allows it to use any VS product to which there is only one other one... buildtools. this is kind of a dumb problem but here we are. this was tested and for sure works, I was building with buildtools in v2 with no issues so in v3 switching to vswhere.exe is where this bug snuck in.

vswhere.exe defaults to searching Community, Professional, and
Enterprise editions only. CI environments typically install the
lightweight Build Tools product which is a separate product type
(Microsoft.VisualStudio.Product.BuildTools). Without -products *
the tool returns no results and the build fails with "Visual Studio
with C++ tools not found".

See: https://github.com/microsoft/vswhere/wiki/Find-MSBuild
@luthermonson luthermonson changed the title fix(windows): vwhere.exe -product * [v3] fix(windows): vwhere.exe -product * May 21, 2026
@luthermonson luthermonson changed the title [v3] fix(windows): vwhere.exe -product * [v3] fix(windows): static builds vwhere.exe -product * May 21, 2026
@luthermonson luthermonson changed the title [v3] fix(windows): static builds vwhere.exe -product * [v3] fix(windows): static builds vswhere.exe -product * May 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Windows Visual Studio detection for static builds when only “Build Tools” (headless Visual Studio) is installed by making vswhere.exe search across all product SKUs via -products *.

Changes:

  • Update the vswhere.exe invocation to include -products * so Build Tools installations are discoverable.
  • Keep existing constraints (-latest, required VC tools component, JSON output) intact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@crazywhalecc
crazywhalecc merged commit b8ce9f7 into crazywhalecc:v3 May 22, 2026
7 checks passed
@luthermonson
luthermonson deleted the fix/vswhere-products branch May 22, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants