Skip to content

ci(windows): locate MSVC via vswhere, not a hardcoded VS2022 path#3589

Merged
ten9876 merged 1 commit into
mainfrom
ci/fftw-vswhere-msvc-detection
Jun 14, 2026
Merged

ci(windows): locate MSVC via vswhere, not a hardcoded VS2022 path#3589
ten9876 merged 1 commit into
mainfrom
ci/fftw-vswhere-msvc-detection

Conversation

@ten9876

@ten9876 ten9876 commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Windows Installer build for the v26.6.3 release tag failed in Setup FFTW3 float (NR4 dependency) with:

Visual Studio 2022 not found at: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\...

GitHub moved windows-latest to the windows-2025-vs2026 image (VS 2026, VCToolsVersion 14.51). scripts/setup/setup-fftw.ps1 hard-coded three VS2022 install paths to find lib.exe for generating the FFTW import libs; none exist on the new image, so it errored out. The actual compile steps were unaffected — they configure MSVC via ilammy/msvc-dev-cmd (auto-detect); only this script's own VS lookup was brittle.

Fix

Detect the toolchain robustly:

  • Prefer lib.exe already on PATH — on CI msvc-dev-cmd has already configured the environment, so no VS lookup is needed at all.
  • Otherwise locate vcvars64.bat via vswhere (stable path, version/edition-agnostic — VS 2022, 2026, and newer).
  • Keep the hardcoded VS2022 paths only as a last-resort local-dev fallback.

Verification

Validated end-to-end on the VS2026 runner via workflow_dispatch on 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

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.
@ten9876 ten9876 requested a review from a team as a code owner June 14, 2026 17:28
@ten9876 ten9876 merged commit e93e59f into main Jun 14, 2026
6 checks passed
@ten9876 ten9876 deleted the ci/fftw-vswhere-msvc-detection branch June 14, 2026 17:28
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.

1 participant