Skip to content

ci(windows): unbreak hidapi source build under CMake 4 runners#3525

Closed
M7HNF-Ian wants to merge 1 commit into
aethersdr:mainfrom
M7HNF-Ian:fix/setup-hidapi-cmake4
Closed

ci(windows): unbreak hidapi source build under CMake 4 runners#3525
M7HNF-Ian wants to merge 1 commit into
aethersdr:mainfrom
M7HNF-Ian:fix/setup-hidapi-cmake4

Conversation

@M7HNF-Ian

Copy link
Copy Markdown
Contributor

Problem

GitHub is mid-rollout of a windows-latest runner 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 scripts/setup/setup-hidapi.ps1 on every PR (ci.yml has 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.5 to 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 → unaffected
  • setup-onnxruntime.ps1 — prebuilt binaries, no source configure → unaffected
  • windows-installer.yml caches hidapi keyed on this script's hash → cache invalidates and rebuilds with the flag automatically

Testing

Can't execute PowerShell locally (macOS box) — but this PR's own check-windows run 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.

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.
@M7HNF-Ian

Copy link
Copy Markdown
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.

@M7HNF-Ian M7HNF-Ian closed this Jun 12, 2026
@M7HNF-Ian M7HNF-Ian deleted the fix/setup-hidapi-cmake4 branch June 12, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant