Skip to content

Fix cargo dist for musl and Windows platforms#48

Open
junzis wants to merge 1 commit intoxoolive:masterfrom
junzis:fix/cargo-dist-platforms
Open

Fix cargo dist for musl and Windows platforms#48
junzis wants to merge 1 commit intoxoolive:masterfrom
junzis:fix/cargo-dist-platforms

Conversation

@junzis
Copy link
Copy Markdown
Contributor

@junzis junzis commented Apr 1, 2026

Summary

Addresses #9 and supersedes #8.

  • Make rtl-sdr-rs optional in rs162 — it was a non-optional dependency pulling in libusb1-sys but never directly imported (only desperado/rtlsdr uses the hardware). This was the root cause of the musl build failure.
  • Add musl and Windows targets: x86_64-unknown-linux-musl, x86_64-pc-windows-msvc
  • Drop rtlsdr and mqtt from dist features — they require system C libraries (libusb, paho-mqtt) unavailable on musl/Windows. Users with SDR hardware build from source.
  • Keep ssh feature in dist (works everywhere via openssl)
  • Add build.rs with MSVC 8MB stack size (from jet1090)
  • Add system deps for openssl (apt, homebrew, chocolatey)

Changes

File Change
crates/rs162/Cargo.toml rtl-sdr-rs → optional, gated behind rtlsdr feature
dist-workspace.toml Add musl + Windows targets, update features and deps
crates/ship162/build.rs MSVC stack size (from jet1090)

Test plan

  • cargo check --features ssh — builds without libusb
  • cargo check --features ssh,rtlsdr — rtlsdr still works when enabled
  • cargo clippy --features ssh — zero warnings
  • Verified libusb1-sys is completely absent from dep tree without rtlsdr feature
  • CI will test musl and Windows builds on this PR (pr-run-mode = "upload")

- Make rtl-sdr-rs optional in rs162 (behind rtlsdr feature). It was a
  non-optional dependency that pulled in libusb1-sys but was never
  directly imported — only desperado/rtlsdr uses the hardware.
- Add x86_64-unknown-linux-musl and x86_64-pc-windows-msvc targets
- Drop rtlsdr and mqtt from dist features since they require system
  libraries (libusb, paho-mqtt C lib) unavailable on musl/Windows.
  Users with SDR hardware can build from source.
- Keep ssh feature in dist (works on all platforms via openssl)
- Add build.rs with MSVC stack size (8 MB) from jet1090
- Add openssl as apt/homebrew/chocolatey dependency for SSH support

Closes xoolive#9
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