[PR #965] [MERGED] horizon-server: give the game its folders whole when --dir is relative #2946

Closed
opened 2026-11-02 16:00:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/server-relative-dir


📝 Commits (1)

  • a8682eb horizon-server: give the game its folders whole when --dir is relative

📊 Changes

1 file changed (+38 additions, -2 deletions)

View changed files

📝 crates/horizon-server/src/engine.rs (+38 -2)

📄 Description

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

What

horizon-server init tells owners to start with horizon-server run --dir srv. With a relative --dir like that, the supervisor started the game in srv/ but passed it --control-socket srv/.horizon/engine.json. The game resolved that path from inside srv/, so it looked for srv/srv/.horizon and crashed at every start, five times, and then the supervisor gave up:

Horizon: control socket srv/.horizon/engine.json: No such file or directory (os error 2)
[Supervisor/WARN]: The game stopped unexpectedly (exit status: 1); restarting in 40 s
horizon-server: the game stopped unexpectedly 5 times in 10 minutes: not restarting it.

engine::spawn now makes the folder and the resources path absolute before it starts the game. --dir . (the default) and absolute folders already worked; the benchmark and the service units use those, which is why nobody hit this.

Found while testing horizon-server update (server-host-10).

How tested

  • New test engine::tests::a_relative_folder_reaches_the_game_whole: a stand-in game checks, from its own folder, that the resources and control-socket folders it was given exist. It fails without the fix (exit status 1) and passes with it.
  • cargo fmt -p horizon-server -- --check, cargo clippy -p horizon-server --all-targets -- -D warnings: clean. cargo test -p horizon-server: 29 passed.
  • tools/parity.py --changed maps this crate to all 323 harnesses. No harness runs horizon-server, and the game itself is unchanged, so CI's run covers them.

Needs nothing from Ludovic.

🤖 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/965 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-relative-dir` --- ### 📝 Commits (1) - [`a8682eb`](https://github.com/horizon-rust/horizon/commit/a8682eb4c55c5b9032902ec5ff71ee2a0b52b380) horizon-server: give the game its folders whole when --dir is relative ### 📊 Changes **1 file changed** (+38 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-server/src/engine.rs` (+38 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What `horizon-server init` tells owners to start with `horizon-server run --dir srv`. With a relative `--dir` like that, the supervisor started the game in `srv/` but passed it `--control-socket srv/.horizon/engine.json`. The game resolved that path from inside `srv/`, so it looked for `srv/srv/.horizon` and crashed at every start, five times, and then the supervisor gave up: ``` Horizon: control socket srv/.horizon/engine.json: No such file or directory (os error 2) [Supervisor/WARN]: The game stopped unexpectedly (exit status: 1); restarting in 40 s horizon-server: the game stopped unexpectedly 5 times in 10 minutes: not restarting it. ``` `engine::spawn` now makes the folder and the resources path absolute before it starts the game. `--dir .` (the default) and absolute folders already worked; the benchmark and the service units use those, which is why nobody hit this. Found while testing `horizon-server update` (server-host-10). ## How tested - New test `engine::tests::a_relative_folder_reaches_the_game_whole`: a stand-in game checks, from its own folder, that the resources and control-socket folders it was given exist. It **fails without the fix** (exit status 1) and passes with it. - `cargo fmt -p horizon-server -- --check`, `cargo clippy -p horizon-server --all-targets -- -D warnings`: clean. `cargo test -p horizon-server`: 29 passed. - `tools/parity.py --changed` maps this crate to all 323 harnesses. No harness runs `horizon-server`, and the game itself is unchanged, so CI's run covers them. Needs nothing from Ludovic. 🤖 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 16:00:19 +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#2946
No description provided.