ci(windows): unbreak hidapi source build under CMake 4 runners#3525
Closed
M7HNF-Ian wants to merge 1 commit into
Closed
ci(windows): unbreak hidapi source build under CMake 4 runners#3525M7HNF-Ian wants to merge 1 commit into
M7HNF-Ian wants to merge 1 commit into
Conversation
GitHub is rolling out a windows-latest image with CMake 4.x, which turns
hidapi 0.14.0's pre-3.5 cmake_minimum_required from a deprecation warning
into a hard configure error:
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
check-windows runs setup-hidapi.ps1 on every PR (no cache in ci.yml), so
whether a job passes currently depends on which runner image it lands on —
PR aethersdr#3407 drew a CMake 4 runner and failed through no fault of its own.
Once the rollout completes every Windows job will fail.
Pass -DCMAKE_POLICY_VERSION_MINIMUM=3.5 (CMake's documented escape hatch,
ignored as unused on 3.x runners) so the configure succeeds on both image
generations. opus (3.16) and the prebuilt onnxruntime are unaffected.
The windows-installer.yml hidapi cache keys on this script's hash, so the
cache invalidates and rebuilds with the flag automatically.
This was referenced Jun 12, 2026
Contributor
Author
|
Closing — Jeremy landed the identical fix in #3509 (753eb68) a few hours before I opened this; my branch was cut from a stale local main so I missed it. His version is also strictly better: the flag needs quoting or PowerShell splits the value at the dot. The conflict here was GitHub refusing to build a merge commit against the already-fixed script, which is why no checks ran. All good — #3407 just needs a rebase onto main to pick it up. |
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
GitHub is mid-rollout of a
windows-latestrunner image with CMake 4.x, which turns hidapi 0.14.0's pre-3.5cmake_minimum_requiredfrom a deprecation warning into a hard configure error:check-windowsrunsscripts/setup/setup-hidapi.ps1on every PR (ci.ymlhas no hidapi cache), so right now whether a Windows job passes depends on which runner image it lands on:Once the image rollout completes, every Windows CI job will fail.
Fix
Pass
-DCMAKE_POLICY_VERSION_MINIMUM=3.5to the hidapi configure — CMake's documented escape hatch for exactly this situation. On CMake 3.x runners the variable is simply unused, so the script behaves identically on both image generations.Scope check on the other setup scripts
setup-opus.ps1— opus 1.5.2 requires CMake 3.16 → unaffectedsetup-onnxruntime.ps1— prebuilt binaries, no source configure → unaffectedwindows-installer.ymlcaches hidapi keyed on this script's hash → cache invalidates and rebuilds with the flag automaticallyTesting
Can't execute PowerShell locally (macOS box) — but this PR's own
check-windowsrun exercises the modified script directly, on whichever runner image it draws. A green check here on a CMake 4 runner is the end-to-end proof; on a 3.x runner it proves no regression.Unblocks #3407's red
check-windows.