Skip to content

Fix Windows OpenSSL build: locate VS via vswhere instead of hardcoded VS2022 path#772

Merged
alex merged 1 commit into
mainfrom
fix-windows-openssl-vs2026
Jun 19, 2026
Merged

Fix Windows OpenSSL build: locate VS via vswhere instead of hardcoded VS2022 path#772
alex merged 1 commit into
mainfrom
fix-windows-openssl-vs2026

Conversation

@reaperhulk

Copy link
Copy Markdown
Member

Problem

The scheduled Windows OpenSSL build started failing (run 27798510868). GitHub flipped the windows-latest runner image from windows-2025 (Visual Studio 2022) to windows-2025-vs2026 (Visual Studio 2026).

windows/openssl/build_openssl.bat hardcoded the VS 2022 install path:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\...

On the new image that path doesn't exist, so the job log shows The system cannot find the path specifiedvcvarsall.bat never ran, the MSVC toolchain wasn't on PATH, and the win32/win64 builds failed with exit code 2. (The arm64 job runs on windows-11-arm, a separate image still on VS2022, so it kept passing.)

Fix

Discover the VS install path with vswhere instead of hardcoding a version/edition. vswhere is on PATH on the GitHub runner images (a comment records the fixed VS Installer fallback path in case that ever changes), and it returns whatever VS is installed — so this works on VS2026 now and future-proofs the arm64 job for when that image eventually moves to VS2026 too.

Also drops the now-inaccurate "MSVC 2022" from the job name.

Testing

Verified against the actual runner images:

  • vswhere ships on both the windows-2025-vs2026 and windows-11-arm64 images and resolves to the correct VS install path on each.

Recommend kicking off a workflow_dispatch run to confirm all three arches (win32/win64/arm64) build cleanly before relying on the next scheduled Friday build.

🤖 Generated with Claude Code

The windows-latest runner image moved from windows-2025 (VS2022) to
windows-2025-vs2026 (VS2026), so the hardcoded
C:\Program Files\Microsoft Visual Studio\2022\Enterprise paths in
build_openssl.bat no longer exist. vcvarsall.bat never ran, the MSVC
toolchain wasn't on PATH, and the win32/win64 builds failed with exit
code 2.

Use vswhere to discover the install path so the build works regardless
of the VS version/edition the runner image ships. This also future-proofs
the arm64 job (windows-11-arm) for when that image eventually moves to
VS2026. Drop the now-inaccurate "MSVC 2022" from the job name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@alex alex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i'll take your word for it

@alex alex merged commit 72cba49 into main Jun 19, 2026
3 checks passed
@alex alex deleted the fix-windows-openssl-vs2026 branch June 19, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants