-
Notifications
You must be signed in to change notification settings - Fork 78
Description
When trying to install packages using meson-python (e.g., contourpy) on Windows with Visual Studio Build Tools 2022 version 17.14.x, Meson fails with the following error:
..\meson.build:1:0: ERROR: Could not parse vswhere.exe output
This happens during meson setup when Meson invokes vswhere.exe. However, vswhere.exe itself works correctly and returns valid JSON output.
✅ Environment:
OS: Windows 10/11 64-bit
Python: 3.13.0
pip: 25.1.1
meson: 1.8.2
meson-python: 0.18.0
Visual Studio Build Tools: 2022, version 17.14.7 (BuildTools)
vswhere.exe: Bundled with Visual Studio Installer.
✅ Steps to Reproduce:
Install Visual Studio Build Tools 2022 version 17.14.x (latest stable).
Install Meson and meson-python:
pip install --upgrade meson meson-python
Try installing a package requiring build with Meson (e.g., contourpy):
pip install contourpy
Build fails with:
ERROR: Could not parse vswhere.exe output
✅ Additional Details:
The output of vswhere.exe is valid JSON and contains required fields like installationPath, isComplete: true, productId, etc.
Here’s the actual output of:
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -products * -latest -format json
vswhere output (click to expand)
[ { "instanceId": "a4ca0acc", "installDate": "2025-07-03T07:06:21Z", "installationName": "VisualStudio/17.14.7+36221.1", "installationPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools", "installationVersion": "17.14.36221.1", "productId": "Microsoft.VisualStudio.Product.BuildTools", "isComplete": true, "isLaunchable": true, "displayName": "Visual Studio Build Tools 2022", "channelId": "VisualStudio.17.Release" } ]This issue did not occur in older Visual Studio versions, suggesting a regression or incomplete support for newer Visual Studio Build Tools (17.14.x).
✅ Expected Behavior:
Meson should correctly detect Visual Studio Build Tools and proceed with the build process if a valid environment is available.
✅ Temporary Workarounds:
Install the full Visual Studio IDE (Community Edition) instead of just Build Tools.
Force binary-only installation using:
pip install <package> --only-binary=:all:
✅ Suggested Actions:
Review the parsing logic of vswhere.exe output in Meson (possibly in mesonbuild\environment.py).
Add compatibility for Visual Studio Build Tools ≥17.14.x.
Possibly improve error reporting to indicate where parsing failed.
✅ Additional Notes:
This issue affects many Python packages using meson-python as their build backend, especially on Windows systems with only Build Tools installed (common for headless build servers).