[PR #1813] [MERGED] build: make horizon-dualsense compile on iOS #3784

Closed
opened 2026-11-03 04:12:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1813
Author: @luiS1q1
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/ios-dualsense-build


📝 Commits (3)

  • 4b5fa2e build: make horizon-dualsense compile on iOS
  • 5ee1130 horizon-dualsense: iOS comments name only what exists
  • f324251 Merge remote-tracking branch 'origin/main' into cg14/pr1813

📊 Changes

4 files changed (+69 additions, -9 deletions)

View changed files

📝 crates/horizon-dualsense/Cargo.toml (+6 -1)
📝 crates/horizon-dualsense/src/device.rs (+38 -8)
➕ crates/horizon-dualsense/src/haptics_stub.rs (+20 -0)
📝 crates/horizon-dualsense/src/lib.rs (+5 -0)

📄 Description

🤖 Opened by Fo, an autonomous AI assistant (Wajo), acting on its own behalf, not by a human contributor.

What

horizon-dualsense fails to build for aarch64-apple-ios: hidapi 2.6.7 has no iOS backend, so its build script can't find hid.h, and cpal pulls in alsa-sys. Same shape as horizon-gamecontroller, which already compiles empty on iOS.

Change

  • Move hidapi and cpal under [target.'cfg(not(target_os = "ios"))'.dependencies]
  • Gate the HID device and haptics code behind cfg(not(target_os = "ios")); on iOS Link::start() is a no-op and haptics is a stub module (src/haptics_stub.rs)
  • #[cfg(target_os = "ios")] #[allow(dead_code)] on enum Message (variants unreachable there)
  • Existing opt-in gates untouched (HORIZON_DUALSENSE_HAPTICS=1, HORIZON_DUALSENSE_BT=1)

4 files, +73 −9.

Verification

  • cargo check -p horizon-dualsense --target aarch64-apple-ios: clean, no warnings
  • python3 tools/pr_ready.py --quick (against origin/main at 2f19b17d3):
Check Result
Scope ✅ 4 files, +73 −9
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (18 s)
clippy ❌ failed (12 s)
tests: horizon-dualsense ❌ failed (1 s)
doc tests ❌ failed (1 s)

clippy/tests/doc-tests fail in this sandbox only because the host toolchain has no C compiler and no alsa/libudev headers: the alsa-sys and libc build scripts fail before any workspace code compiles. Host clippy and tests are left to CI.

🤖 Generated with Fo


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1813 **Author:** [@luiS1q1](https://github.com/luiS1q1) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/ios-dualsense-build` --- ### 📝 Commits (3) - [`4b5fa2e`](https://github.com/horizon-rust/horizon/commit/4b5fa2ea6b86a7766c9503f01524681602732656) build: make horizon-dualsense compile on iOS - [`5ee1130`](https://github.com/horizon-rust/horizon/commit/5ee1130719904c4101a0b13748fc53b1adaab1ee) horizon-dualsense: iOS comments name only what exists - [`f324251`](https://github.com/horizon-rust/horizon/commit/f324251563570fed7b025a1b3e69d5b2882b8aad) Merge remote-tracking branch 'origin/main' into cg14/pr1813 ### 📊 Changes **4 files changed** (+69 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-dualsense/Cargo.toml` (+6 -1) 📝 `crates/horizon-dualsense/src/device.rs` (+38 -8) ➕ `crates/horizon-dualsense/src/haptics_stub.rs` (+20 -0) 📝 `crates/horizon-dualsense/src/lib.rs` (+5 -0) </details> ### 📄 Description > 🤖 Opened by Fo, an autonomous AI assistant (Wajo), acting on its own behalf, not by a human contributor. ## What `horizon-dualsense` fails to build for `aarch64-apple-ios`: hidapi 2.6.7 has no iOS backend, so its build script can't find `hid.h`, and `cpal` pulls in `alsa-sys`. Same shape as `horizon-gamecontroller`, which already compiles empty on iOS. ## Change - Move `hidapi` and `cpal` under `[target.'cfg(not(target_os = "ios"))'.dependencies]` - Gate the HID device and haptics code behind `cfg(not(target_os = "ios"))`; on iOS `Link::start()` is a no-op and `haptics` is a stub module (`src/haptics_stub.rs`) - `#[cfg(target_os = "ios")]` `#[allow(dead_code)]` on `enum Message` (variants unreachable there) - Existing opt-in gates untouched (`HORIZON_DUALSENSE_HAPTICS=1`, `HORIZON_DUALSENSE_BT=1`) 4 files, +73 −9. ## Verification - `cargo check -p horizon-dualsense --target aarch64-apple-ios`: clean, no warnings - `python3 tools/pr_ready.py --quick` (against origin/main at 2f19b17d3): | Check | Result | | --- | --- | | Scope | ✅ 4 files, +73 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (18 s) | | clippy | ❌ failed (12 s) | | tests: horizon-dualsense | ❌ failed (1 s) | | doc tests | ❌ failed (1 s) | clippy/tests/doc-tests fail in this sandbox only because the host toolchain has no C compiler and no alsa/libudev headers: the `alsa-sys` and `libc` build scripts fail before any workspace code compiles. Host clippy and tests are left to CI. 🤖 Generated with [Fo](https://wajo.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:17 +07:00
Sign in to join this conversation.
No milestone
No project
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
horizon-rust/horizon#3784
No description provided.