WIP: RFC: Hotplug implementation (combined improvements for testing) #836

Draft
Youw wants to merge 117 commits from connection-callback-2 into master
Youw commented 2026-09-09 05:33:59 -05:00 (Migrated from github.com)

This is a combined branch for testing all the hotplug improvements made recently by various AI agents together. It collects the current improvements to connection-callback on connection-callback-2, with master as the comparison target, alongside the original draft PR #674. The existing PRs remain open for individual review.

The combined branch includes the current tips of all seven open PRs targeting connection-callback:

  • #822: Linux/hidraw asynchronous enumeration, callback delivery, error handling, and lifecycle fixes.
  • #823: Windows asynchronous enumeration, callback delivery, error handling, and teardown fixes.
  • #824: macOS asynchronous enumeration, callback delivery, and thread lifecycle fixes.
  • #825: libusb asynchronous enumeration, event ordering, error handling, and teardown fixes.
  • #826: Hotplug API tests and virtual-device hotplug scenarios.
  • #830: The existing CI aggregate, including its additional virtual-device provider and CI refinements.
  • #835: Header contract and NetBSD stub consistency fixes.

connection-callback-2 includes the complete integration history from 9fdce4186c17c6d81b20a6595029ca38409844ac, the updated libusb PR #825, and the latest master at 852cc68b8e0e4c7eba0815ef992951cd8b75c55b. Codex verified that every current PR tip listed above and master are ancestors of the combined branch.

The libusb/hidapi_libusb.h conflict was resolved in #825 by merging master and preserving both the hotplug error-serialization documentation and the timeout declarations from #832. The updated libusb branch was then merged into this combined branch; no conflict remains with master.

Validation of the updated combined tree (932e5ac):

  • Linux/WSL GCC and Windows/MSVC CMake builds passed with AddressSanitizer enabled.
  • Linux: HotplugAPI_hidraw and HotplugAPI_libusb passed; four device-backed tests self-skipped because the required virtual devices are unavailable locally.
  • Windows: 26 tests passed, including HotplugAPI_winapi; two device-backed tests self-skipped because the virtual HID driver is not installed locally.
  • A focused independent review confirmed that the manual header resolution and automatic libusb/build-file merges preserve both parents' changes.

The updated PR commits trigger fresh CI. The test setup and platform requirements are documented in src/tests/README.md.

Related to #674 and #238 (hotplug support), #785 (Windows error handling), #791 and #792 (callback device-list contract), #793 (enumeration callback return values), and #794 (macOS self-join deadlock).

Builds on the existing work from #708 (libusb error reporting), #790 (hotplug contract), and #815 (virtual-device test harness). Related follow-ups remain #828 (Linux monitor recovery) and #829 (custom libusb thread-model compatibility).

Also includes the latest merged master work from #831 (pkg-config generation), #832 (libusb timeouts), and #834 (API usage contract).

Generated by Codex (GPT-6 Astra).

Assisted-by: codex:gpt-6-astra

This is a combined branch for testing all the hotplug improvements made recently by various AI agents together. It collects the current improvements to `connection-callback` on `connection-callback-2`, with `master` as the comparison target, alongside the original draft PR #674. The existing PRs remain open for individual review. The combined branch includes the current tips of all seven open PRs targeting `connection-callback`: - #822: Linux/hidraw asynchronous enumeration, callback delivery, error handling, and lifecycle fixes. - #823: Windows asynchronous enumeration, callback delivery, error handling, and teardown fixes. - #824: macOS asynchronous enumeration, callback delivery, and thread lifecycle fixes. - #825: libusb asynchronous enumeration, event ordering, error handling, and teardown fixes. - #826: Hotplug API tests and virtual-device hotplug scenarios. - #830: The existing CI aggregate, including its additional virtual-device provider and CI refinements. - #835: Header contract and NetBSD stub consistency fixes. `connection-callback-2` includes the complete integration history from `9fdce4186c17c6d81b20a6595029ca38409844ac`, the updated libusb PR #825, and the latest `master` at `852cc68b8e0e4c7eba0815ef992951cd8b75c55b`. Codex verified that every current PR tip listed above and `master` are ancestors of the combined branch. The `libusb/hidapi_libusb.h` conflict was resolved in #825 by merging `master` and preserving both the hotplug error-serialization documentation and the timeout declarations from #832. The updated libusb branch was then merged into this combined branch; no conflict remains with `master`. Validation of the updated combined tree (`932e5ac`): - Linux/WSL GCC and Windows/MSVC CMake builds passed with AddressSanitizer enabled. - Linux: `HotplugAPI_hidraw` and `HotplugAPI_libusb` passed; four device-backed tests self-skipped because the required virtual devices are unavailable locally. - Windows: 26 tests passed, including `HotplugAPI_winapi`; two device-backed tests self-skipped because the virtual HID driver is not installed locally. - A focused independent review confirmed that the manual header resolution and automatic libusb/build-file merges preserve both parents' changes. The updated PR commits trigger fresh CI. The test setup and platform requirements are documented in `src/tests/README.md`. Related to #674 and #238 (hotplug support), #785 (Windows error handling), #791 and #792 (callback device-list contract), #793 (enumeration callback return values), and #794 (macOS self-join deadlock). Builds on the existing work from #708 (libusb error reporting), #790 (hotplug contract), and #815 (virtual-device test harness). Related follow-ups remain #828 (Linux monitor recovery) and #829 (custom libusb thread-model compatibility). Also includes the latest merged `master` work from #831 (pkg-config generation), #832 (libusb timeouts), and #834 (API usage contract). Generated by Codex (GPT-6 Astra). Assisted-by: codex:gpt-6-astra
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'connection-callback-2:connection-callback-2'
git switch 'connection-callback-2'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'master'
git merge --no-ff 'connection-callback-2'
git switch 'connection-callback-2'
git rebase 'master'
git switch 'master'
git merge --ff-only 'connection-callback-2'
git switch 'connection-callback-2'
git rebase 'master'
git switch 'master'
git merge --no-ff 'connection-callback-2'
git switch 'master'
git merge --squash 'connection-callback-2'
git switch 'master'
git merge --ff-only 'connection-callback-2'
git switch 'master'
git merge 'connection-callback-2'
git push origin 'master'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi!836
No description provided.