ci(windows): locate MSVC via vswhere, not a hardcoded VS2022 path#3589
Merged
Conversation
The Windows release build for v26.6.3 failed in 'Setup FFTW3 float' — setup-fftw.ps1 hardcoded three VS2022 install paths and errored with 'Visual Studio 2022 not found' once GitHub moved windows-latest to the windows-2025-vs2026 image (VS 2026, no VS2022 directory). Detect the toolchain robustly instead: - Prefer lib.exe already on PATH (CI configures it via msvc-dev-cmd). - Otherwise locate vcvars64.bat via vswhere (version/edition-agnostic: VS 2022, 2026, and newer), keeping the hardcoded VS2022 paths only as a last-resort fallback for local dev. The compile steps already worked on VS2026 (they use msvc-dev-cmd); only this script's own VS lookup was brittle. Principle XI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Windows Installer build for the v26.6.3 release tag failed in Setup FFTW3 float (NR4 dependency) with:
GitHub moved
windows-latestto the windows-2025-vs2026 image (VS 2026,VCToolsVersion 14.51).scripts/setup/setup-fftw.ps1hard-coded three VS2022 install paths to findlib.exefor generating the FFTW import libs; none exist on the new image, so it errored out. The actual compile steps were unaffected — they configure MSVC viailammy/msvc-dev-cmd(auto-detect); only this script's own VS lookup was brittle.Fix
Detect the toolchain robustly:
lib.exealready on PATH — on CImsvc-dev-cmdhas already configured the environment, so no VS lookup is needed at all.vcvars64.batvia vswhere (stable path, version/edition-agnostic — VS 2022, 2026, and newer).Verification
Validated end-to-end on the VS2026 runner via
workflow_dispatchon this branch — run 27506472270: Setup FFTW3 float → success, Configure → success, full build proceeding. (Branch dispatch intentionally skips the release-attach step.)Principle XI (Fixes Are Demonstrated).
🤖 Generated with Claude Code