Auto-select the nusb backend on Linux#134
Merged
Merged
Conversation
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.
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.
What
Linux builds now use hidra's nusb backend automatically — no
--features nusbneeded. A target-specific dependency enableshidra/nusbundercfg(target_os = "linux"), so a plaincargo buildon Linux pulls it in.macOS/Windows keep hidra's native per-OS backend; wasm keeps WebHID. The
nusbfeature 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/LABELplumbing (env vars, cache-key suffix,--featuresinjection, artifact-name label) is removed. The Linux artifact is nowsinowisp-x86_64-unknown-linux-gnu-<tag>.tar.gz, matching macOS/Windows.