[PR #4836] [MERGED] Launcher: say what a Linux native build lacks before it starts #5880

Closed
opened 2026-11-03 05:15:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4836
Author: @ludovic111
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @levzzz5154

Base: main ← Head: fix/native-mods-linux


📝 Commits (1)

  • adf54b0 Launcher: say what a Linux native build lacks before it starts

📊 Changes

3 files changed (+174 additions, -14 deletions)

View changed files

📝 docs/native-mods.md (+8 -1)
📝 launcher/src/native_mods.rs (+52 -6)
📝 launcher/src/rust_toolchain.rs (+114 -7)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Part of #4770 (native mods don't build on Linux; players saw only Mod Menu in game).

What players hit

A native build on Linux compiles C (ring, hidapi) and builds against the system's ALSA (alsa-sys) and libudev (libudev-sys, hidapi), found with pkg-config. The launcher only checked cc --version, so:

  • SteamOS (the #4770 screenshot): GCC 16 is there, but the C library's headers aren't. ring stops on stdint.h: No such file or directory after Rust, horizon-mixins and the source have been downloaded.
  • Mint, Ubuntu, Debian desktops don't install pkg-config, libasound2-dev or libudev-dev (often not build-essential either). The build stops on alsa-sys. I reproduced it on playhorizon (Ubuntu 26.04, Rust 1.99.1) with pkg-config's search path emptied: the error's last 12 lines no longer named the crate.

What changes

  • rust_toolchain::linker() on Linux (linux_needs) checks, before anything is downloaded:

    • cc;
    • the C library's headers (cc -fsyntax-only -x c -include stdint.h /dev/null);
    • pkg-config;
    • pkg-config --exists alsa and libudev.

    It names everything missing in one message, with the install command for the distribution in /etc/os-release: apt (Debian, Ubuntu, Mint…), dnf, pacman, zypper, else the apt line as an example. On SteamOS it says plainly that native builds don't work there yet (read-only system, no headers).

  • A failed build's error starts with cargo's first error lines (up to 4) when they aren't among the last lines. Example: error: failed to run custom build command for \alsa-sys v0.3.1``.

  • docs/native-mods.md: the Linux requirements.

Checked

  • Unit tests: a_linux_build_names_what_is_missing_and_the_distributions_command (Mint without dev files, SteamOS with GCC but no headers, Arch, Fedora, an unknown distribution, everything present) and a_failed_build_names_the_crate_its_output_pushed_out.
  • On playhorizon (Ubuntu 26.04), linux_needs compiled as-is with the real checks gives:
    • with the packages: Ok(());
    • pkg-config's search path empty: ALSA's and libudev's development files, plus the apt command;
    • a cc that has no C library headers (--sysroot=/nonexistent): "the C library's headers".
  • The same crates (alsa-sys, libudev-sys, hidapi with linux-static-hidraw, ring) build there once those are present.

Not covered here: the build plays in a separate "Native mods" instance when started from Horizon's own instance. That's levzzz5154's #3870, so it isn't changed here.

pr_ready (tools/pr_ready.py on ludovics-mac-mini, against origin/main at 3c1d4b39c, 51 s)

Check Result
Scope ✅ 3 files, +174 −14
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (47 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅
launcher clippy ✅ (1 s)
launcher tests ✅ 302 passed (3 s)
Parity ➖ 1 affected, to run in CI (no vanilla data here): lan_integration
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 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/4836 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/native-mods-linux` --- ### 📝 Commits (1) - [`adf54b0`](https://github.com/horizon-rust/horizon/commit/adf54b0c68dcc1a4c9db9ac00e914fddfdf4c776) Launcher: say what a Linux native build lacks before it starts ### 📊 Changes **3 files changed** (+174 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/native-mods.md` (+8 -1) 📝 `launcher/src/native_mods.rs` (+52 -6) 📝 `launcher/src/rust_toolchain.rs` (+114 -7) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part of #4770 (native mods don't build on Linux; players saw only Mod Menu in game). ## What players hit A native build on Linux compiles C (`ring`, `hidapi`) and builds against the system's ALSA (`alsa-sys`) and libudev (`libudev-sys`, `hidapi`), found with `pkg-config`. The launcher only checked `cc --version`, so: - **SteamOS** (the #4770 screenshot): GCC 16 is there, but the C library's headers aren't. `ring` stops on `stdint.h: No such file or directory` after Rust, horizon-mixins and the source have been downloaded. - **Mint, Ubuntu, Debian desktops** don't install `pkg-config`, `libasound2-dev` or `libudev-dev` (often not `build-essential` either). The build stops on `alsa-sys`. I reproduced it on playhorizon (Ubuntu 26.04, Rust 1.99.1) with pkg-config's search path emptied: the error's last 12 lines no longer named the crate. ## What changes - `rust_toolchain::linker()` on Linux (`linux_needs`) checks, before anything is downloaded: - `cc`; - the C library's headers (`cc -fsyntax-only -x c -include stdint.h /dev/null`); - `pkg-config`; - `pkg-config --exists alsa` and `libudev`. It names everything missing in one message, with the install command for the distribution in `/etc/os-release`: apt (Debian, Ubuntu, Mint…), dnf, pacman, zypper, else the apt line as an example. On SteamOS it says plainly that native builds don't work there yet (read-only system, no headers). - A failed build's error starts with cargo's first `error` lines (up to 4) when they aren't among the last lines. Example: `error: failed to run custom build command for \`alsa-sys v0.3.1\``. - docs/native-mods.md: the Linux requirements. ## Checked - Unit tests: `a_linux_build_names_what_is_missing_and_the_distributions_command` (Mint without dev files, SteamOS with GCC but no headers, Arch, Fedora, an unknown distribution, everything present) and `a_failed_build_names_the_crate_its_output_pushed_out`. - On playhorizon (Ubuntu 26.04), `linux_needs` compiled as-is with the real checks gives: - with the packages: `Ok(())`; - pkg-config's search path empty: ALSA's and libudev's development files, plus the apt command; - a `cc` that has no C library headers (`--sysroot=/nonexistent`): "the C library's headers". - The same crates (`alsa-sys`, `libudev-sys`, `hidapi` with `linux-static-hidraw`, `ring`) build there once those are present. Not covered here: the build plays in a separate "Native mods" instance when started from Horizon's own instance. That's levzzz5154's #3870, so it isn't changed here. **pr_ready** (`tools/pr_ready.py` on ludovics-mac-mini, against origin/main at 3c1d4b39c, 51 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +174 −14 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (47 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ | | launcher clippy | ✅ (1 s) | | launcher tests | ✅ 302 passed (3 s) | | Parity | ➖ 1 affected, to run in CI (no vanilla data here): lan_integration | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:15:39 +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#5880
No description provided.