Fix Windows OpenSSL build: locate VS via vswhere instead of hardcoded VS2022 path#772
Merged
Conversation
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>
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 scheduled
Windows OpenSSLbuild started failing (run 27798510868). GitHub flipped thewindows-latestrunner image fromwindows-2025(Visual Studio 2022) towindows-2025-vs2026(Visual Studio 2026).windows/openssl/build_openssl.bathardcoded the VS 2022 install path:On the new image that path doesn't exist, so the job log shows
The system cannot find the path specified—vcvarsall.batnever ran, the MSVC toolchain wasn't on PATH, and the win32/win64 builds failed with exit code 2. (The arm64 job runs onwindows-11-arm, a separate image still on VS2022, so it kept passing.)Fix
Discover the VS install path with
vswhereinstead of hardcoding a version/edition.vswhereis 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:
vswhereships on both thewindows-2025-vs2026andwindows-11-arm64images and resolves to the correct VS install path on each.Recommend kicking off a
workflow_dispatchrun to confirm all three arches (win32/win64/arm64) build cleanly before relying on the next scheduled Friday build.🤖 Generated with Claude Code