Skip to content

Auto-select the nusb backend on Linux#134

Merged
carlossless merged 3 commits into
masterfrom
auto-select-nusb-on-linux
Jul 10, 2026
Merged

Auto-select the nusb backend on Linux#134
carlossless merged 3 commits into
masterfrom
auto-select-nusb-on-linux

Conversation

@carlossless

Copy link
Copy Markdown
Owner

What

Linux builds now use hidra's nusb backend automatically — no --features nusb needed. A target-specific dependency enables hidra/nusb under cfg(target_os = "linux"), so a plain cargo build on Linux pulls it in.

[target.'cfg(target_os = "linux")'.dependencies]
hidra = { version = "0.0.1", features = ["nusb"] }

macOS/Windows keep hidra's native per-OS backend; wasm keeps WebHID. The nusb feature is retained for opting into nusb on macOS/Windows.

Trade-off

Cargo features are additive, so this makes nusb the sole Linux backend — the hidraw variant is no longer buildable on Linux. That's intentional.

CI

With the Linux backend split gone, the build/test matrix collapses to a single Linux variant and the now-unused FEATURES/LABEL plumbing (env vars, cache-key suffix, --features injection, artifact-name label) is removed. The Linux artifact is now sinowisp-x86_64-unknown-linux-gnu-<tag>.tar.gz, matching macOS/Windows.

Linux builds now always use hidra's nusb backend instead of requiring
the opt-in `nusb` feature. A target-specific dependency enables
`hidra/nusb` under `cfg(target_os = "linux")`, so a plain `cargo build`
picks it up with no flag. macOS/Windows keep hidra's native per-OS
backend and wasm keeps WebHID; the `nusb` feature remains for opting
into nusb on those platforms.

Because Cargo features are additive, this makes nusb the sole Linux
backend (the hidraw variant is no longer buildable there). CI is
simplified to match: the Linux build/test matrix collapses to a single
variant and the now-unused FEATURES/LABEL plumbing is removed.
Point hidra at git master to pick up the macOS backend fix (false
`HidError::Disconnected` on ISP re-enumeration, which caused ~50% of
reads/writes to fail on macOS). Done via `[patch.crates-io]` so the
existing `hidra = "0.0.1"` requirements resolve to master (still 0.0.1).

Revert to the published crate once a fixed hidra is released.
Switch off the temporary git-master patch now that the macOS run-loop
fix is released as hidra 0.0.2 on crates.io.
@carlossless
carlossless merged commit d85563a into master Jul 10, 2026
9 checks passed
@carlossless
carlossless deleted the auto-select-nusb-on-linux branch July 10, 2026 15:38
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