ci: fix MSVC build on windows-latest (VS 2019 path no longer exists) - #2
Merged
Conversation
windows-latest no longer ships VS 2019 Enterprise, so the hardcoded vcvars64.bat path silently failed to execute and cl.exe was missing from PATH, breaking CMake's compiler detection. Use ilammy/msvc-dev-cmd@v1, which finds whichever Visual Studio is installed on the runner and exports the env vars via GITHUB_ENV so they persist across steps. Co-Authored-By: Claude Opus 4.7 (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.
Summary
windows-latestno longer ships VS 2019 Enterprise, so the hardcodedC:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.batsilently fails —cl.exeends up off PATH and CMake errors withCould not find compiler set in environment variable CC: cl.environment_scriptplumbing withilammy/msvc-dev-cmd@v1, which locates whichever Visual Studio is installed on the runner and exports the env vars viaGITHUB_ENVso they persist across subsequent steps.environment_script_output.txtre-parsing in Configure/Build — no longer needed now that env vars persist.Fixes the failing Windows MSVC job in run 24650040774.
Test plan
🤖 Generated with Claude Code