[PR #898] [MERGED] horizon-server on Linux: say which libraries the game needs, and follow updates #2895

Closed
opened 2026-11-02 15:59:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/server-linux-libraries


📝 Commits (2)

  • 44fba3b horizon-server: find game files prepared without sounds
  • 4ea2243 horizon-server on Linux: say which libraries the game needs, and follow updates

📊 Changes

6 files changed (+173 additions, -4 deletions)

View changed files

📝 crates/horizon-server/src/engine.rs (+110 -2)
📝 crates/horizon-server/src/init.rs (+3 -0)
📝 crates/horizon-server/src/service.rs (+41 -2)
📝 crates/horizon-server/src/supervisor.rs (+2 -0)
📝 docs/server.md (+5 -0)
📝 packaging/server/install.sh (+12 -0)

📄 Description

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

Stacked on #893 (both add tests at the end of engine.rs's test module): merge #893 first. Until then this diff also shows #893's commit.

What

Missing libraries. On Linux the game (the server's engine) links libasound.so.2 and libudev.so.1, even as a server, until the headless engine exists (docs/server.md §1). Most minimal server images have no ALSA. There the game exits at once with the loader's error while loading shared libraries: libasound.so.2. The supervisor took that for a crash: it restarted the game 5 times over about 2.5 minutes, then gave up with "See logs/latest.log and crash-reports/", and neither holds anything about it. Now:

  • run starts the game once with --help (which loads no game files) before anything else. If the system can't load it, run stops at once with the loader's line and the packages to install (Debian/Ubuntu, Fedora/RHEL, Arch, NixOS);
  • init prints the same as a warning after Game:;
  • install.sh lists the libraries ldd can't find, with the same advice;
  • docs/server.md §3 says so.

Service and updates. Without the installer's bin on the PATH, service install fell back to the running program's path. Linux reports that path with links resolved, so the unit ran <dir>/releases/<tag>/horizon-server and an update never reached it. The fallback now goes through <dir>/current while that points at the same release. With bin on the PATH (what install.sh asks for), nothing changes: the unit runs the launcher.

How it was found

The end-to-end install check on the ThinkPad (NixOS, no nix-ld libraries) with v2026.10.18.15: install.sh → copy the prepared files (docs' "prepared elsewhere") → init → start. The game couldn't load libasound.so.2, and start reported "the game stopped unexpectedly 5 times in 10 minutes".

Verified (ThinkPad, this branch's binary in the v2026.10.18.15 install)

install.sh   The game needs libraries this system doesn't have: libudev.so.1 libasound.so.2
             Install them before starting a server: (the four distributions)
init         Warning: the game (.../horizon-client) can't start (exit status 127): ... libasound.so.2: cannot open shared object file ...
run          the same, exit after 0.011 s (no restarts)
service print (bin not on PATH)
             ExecStart="/tmp/sh8/h2/current/horizon-server" --dir "/tmp/sh8/srv2" run      (was .../releases/v2026.10.18.15/horizon-server)

With the libraries on LD_LIBRARY_PATH, the same install served a Horizon client (Linux and macOS), a vanilla protocol client and a refused login, and did a backup, a restore and the panel (card#29).

Self-check

cargo fmt --all -- --check                                      ok
cargo clippy -p horizon-server --all-targets -- -D warnings     ok (no crate depends on horizon-server)
cargo test -p horizon-server                                    28 passed (new: a_missing_library_says_what_to_install,
                                                                the_check_runs_the_program, an_installed_release_runs_through_current)

The engine is unchanged; no harness covers the supervisor.

Needs Ludovic

Nothing to merge this. The real fix is a game build without ALSA and udev for servers: horizon-engine, which the supervisor already looks for first. It is listed under "Out (next)" in docs/server.md §10, and it means a second engine build per Linux release.

🤖 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/898 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-linux-libraries` --- ### 📝 Commits (2) - [`44fba3b`](https://github.com/horizon-rust/horizon/commit/44fba3bf9d8b2b96c6c21855fc7970107a8d8b8b) horizon-server: find game files prepared without sounds - [`4ea2243`](https://github.com/horizon-rust/horizon/commit/4ea2243e4d1a44f910857bd759845db70e3690a8) horizon-server on Linux: say which libraries the game needs, and follow updates ### 📊 Changes **6 files changed** (+173 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-server/src/engine.rs` (+110 -2) 📝 `crates/horizon-server/src/init.rs` (+3 -0) 📝 `crates/horizon-server/src/service.rs` (+41 -2) 📝 `crates/horizon-server/src/supervisor.rs` (+2 -0) 📝 `docs/server.md` (+5 -0) 📝 `packaging/server/install.sh` (+12 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Stacked on #893** (both add tests at the end of `engine.rs`'s test module): merge #893 first. Until then this diff also shows #893's commit. ## What **Missing libraries.** On Linux the game (the server's engine) links `libasound.so.2` and `libudev.so.1`, even as a server, until the headless engine exists (docs/server.md §1). Most minimal server images have no ALSA. There the game exits at once with the loader's `error while loading shared libraries: libasound.so.2`. The supervisor took that for a crash: it restarted the game 5 times over about 2.5 minutes, then gave up with "See logs/latest.log and crash-reports/", and neither holds anything about it. Now: - `run` starts the game once with `--help` (which loads no game files) before anything else. If the system can't load it, `run` stops at once with the loader's line and the packages to install (Debian/Ubuntu, Fedora/RHEL, Arch, NixOS); - `init` prints the same as a warning after `Game:`; - `install.sh` lists the libraries `ldd` can't find, with the same advice; - docs/server.md §3 says so. **Service and updates.** Without the installer's `bin` on the PATH, `service install` fell back to the running program's path. Linux reports that path with links resolved, so the unit ran `<dir>/releases/<tag>/horizon-server` and an update never reached it. The fallback now goes through `<dir>/current` while that points at the same release. With `bin` on the PATH (what install.sh asks for), nothing changes: the unit runs the launcher. ## How it was found The end-to-end install check on the ThinkPad (NixOS, no nix-ld libraries) with v2026.10.18.15: `install.sh` → copy the prepared files (docs' "prepared elsewhere") → `init` → `start`. The game couldn't load `libasound.so.2`, and `start` reported "the game stopped unexpectedly 5 times in 10 minutes". ## Verified (ThinkPad, this branch's binary in the v2026.10.18.15 install) ``` install.sh The game needs libraries this system doesn't have: libudev.so.1 libasound.so.2 Install them before starting a server: (the four distributions) init Warning: the game (.../horizon-client) can't start (exit status 127): ... libasound.so.2: cannot open shared object file ... run the same, exit after 0.011 s (no restarts) service print (bin not on PATH) ExecStart="/tmp/sh8/h2/current/horizon-server" --dir "/tmp/sh8/srv2" run (was .../releases/v2026.10.18.15/horizon-server) ``` With the libraries on `LD_LIBRARY_PATH`, the same install served a Horizon client (Linux and macOS), a vanilla protocol client and a refused login, and did a backup, a restore and the panel (card#29). ## Self-check ``` cargo fmt --all -- --check ok cargo clippy -p horizon-server --all-targets -- -D warnings ok (no crate depends on horizon-server) cargo test -p horizon-server 28 passed (new: a_missing_library_says_what_to_install, the_check_runs_the_program, an_installed_release_runs_through_current) ``` The engine is unchanged; no harness covers the supervisor. ## Needs Ludovic Nothing to merge this. The real fix is a game build without ALSA and udev for servers: `horizon-engine`, which the supervisor already looks for first. It is listed under "Out (next)" in docs/server.md §10, and it means a second engine build per Linux release. 🤖 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-02 15:59:54 +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#2895
No description provided.