mach (Windows): make vswhere.exe work properly (#38028)

Previously, the args passed to `vswhere.exe` was wrong. There is no
generic component ID called
`Microsoft.VisualStudio.Component.Windows10SDK`, but always something
like `Microsoft.VisualStudio.Component.Windows10SDK.19041` /
`Microsoft.VisualStudio.Component.Windows11SDK.22621`.
That's why users always had to manually setup environment variable
`VSINSTALLDIR`, `VisualStudioVersion`.

This QoL PR also makes `mach` compatible with Windows 11 SDK, and update
README.md to be consistent with https://github.com/servo/book/pull/92.

Testing: Tested locally and working fine after removing environment
variables.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
Euclid Ye 2025-07-13 20:23:55 +08:00 committed by GitHub
parent cd91517a27
commit 35a145613e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -51,7 +51,6 @@ def find_compatible_msvc_with_vswhere() -> Generator[VisualStudioInstallation, N
vswhere = find_vswhere()
if not vswhere:
return
output = subprocess.check_output(
[
vswhere,
@ -62,7 +61,7 @@ def find_compatible_msvc_with_vswhere() -> Generator[VisualStudioInstallation, N
"-requires",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"-requires",
"Microsoft.VisualStudio.Component.Windows10SDK",
"Microsoft.VisualStudio.Component.Windows*SDK.*",
"-utf8",
]
).decode(errors="ignore")