ci: use setup-msvc-dev action instead of a hard-coded vcvars path#817
Merged
Conversation
282f756 to
4865fec
Compare
Member
Author
|
Heads-up: #813 also fixes this same Windows CI break in So the two overlap on (Note: #813 also touches Drafted with Claude Code. |
The windows-cmake job set up the MSVC environment by calling a hard-coded "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" in its NMake, clang-cl and Meson steps. The hosted windows-latest image no longer has Visual Studio under that "Enterprise" path, so those steps started failing with "The system cannot find the path specified." Set up the developer environment once per job with the TheMrMilchmann/setup-msvc-dev action -- it locates the installed toolchain (no hard-coded path or edition) -- and drop all the hard-coded vcvars64.bat calls. That environment is job-wide, so the MinGW build (which must use gcc, not cl) is split out into its own windows-mingw job that runs without the MSVC environment. The MSVC, NMake, clang-cl and Meson builds stay in windows-cmake with the action. Assisted-by: claude-code:claude-opus-4-8
4865fec to
8d8b73a
Compare
Youw
commented
Jun 14, 2026
Youw
commented
Jun 14, 2026
Co-authored-by: Ihor Dutchak <ihor.youw@gmail.com>
Youw
added a commit
to JHartzer/hidapi
that referenced
this pull request
Jun 14, 2026
Resolve the builds.yml conflict in favour of master: the hard-coded vcvars path is now fixed on master by the setup-msvc-dev action plus a dedicated windows-mingw job (libusb#817), so this branch's vswhere-based CI change is dropped as redundant. The static-analysis code changes (the linux/hid.c memory-leak fix and the IWYU header cleanups) are unaffected. Assisted-by: claude-code:claude-opus-4-8
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
The
windows-cmakejob set up the MSVC environment bycall-ing a hard-coded path:in its NMake MSVC, NMake clang-cl and Meson steps. The hosted
windows-latestimage no longer has Visual Studio under that Enterprise path, so as of recently every one of those steps fails at the firstcall:(
windows-msbuildis unaffected — it doesn't callvcvars.)This sets up the MSVC developer environment once per job with the setup-msvc-dev action — it locates the installed toolchain via
vswhere(no hard-coded path or VS edition) — and removes all sevenvcvars64.batcalls.Since that environment is job-wide, the MinGW build (which must use
gcc, notcl) is split out into its ownwindows-mingwjob that runs without the MSVC environment. The MSVC, NMake, clang-cl and Meson builds stay inwindows-cmakewith the action.Assisted-by: claude-code:claude-opus-4-8