[PR #3388] [MERGED] Native mods: horizon-mixins finds the launcher's cargo #4948

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

📋 Pull Request Information

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

Base: main ← Head: fix/native-mods-mixins-cargo


📝 Commits (1)

  • a9f8e64 Native mods: horizon-mixins finds the launcher's cargo

📊 Changes

1 file changed (+50 additions, -4 deletions)

View changed files

📝 launcher/src/native_mods.rs (+50 -4)

📄 Description

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

On a computer with no Rust of its own, every native-mod build failed at the mixins step:

Applying the mixins
error: horizon-mixins failed (exit status: 1) …
E_METADATA: failed to start `cargo metadata`: No such file or directory (os error 2)

horizon-mixins apply runs cargo metadata, but the launcher started it as a plain Command, so it looked for cargo on the player's PATH. It now starts through Toolchain::command, as the game's compile already does: the launcher's bin/ comes first on PATH, with its RUSTC and CARGO_HOME. A test pins it (horizon_mixins_finds_the_launchers_cargo).

Found by levzzz5154's ask to test the portable toolchain (rust_toolchain.rs) end to end. The test:

  • macOS on the Mac mini, Linux on playhorizon;
  • fresh mktemp -d launcher/game/XDG homes, and PATH reduced to /usr/bin:/bin:/usr/sbin:/sbin (no cargo, rustc or rustup);
  • rust install, then install latest (nightly-2026-10-28-9b772b2), then native-build of the official zoom mod.

Results before this fix:

  • rust install worked on both (Linux 11 s, macOS 2 min 30 s; "This computer can link the game").
  • Both then stopped at E_METADATA as above.

With this fix, end to end on both systems:

  • The launcher built native-1149c92-c10940026a0d with its own Rust: macOS in 546 s, Linux in 729 s with 3 jobs.
  • Zoom's offscreen proof then ran on that launcher-built binary, with fresh homes (Linux under xvfb). On both it passed:
    • Options > Mods lists "Zoom 2.0.0: ON", and its settings page opens.
    • C zooms: screenshot diff 51.1 on macOS and 21.9 on Linux, against 1.7 and 1.2 for an unbound key.
    • The wheel keeps the hotbar slot while zoomed, and the settings are stored.
  • The Linux launcher came from this branch's dry-run build (gh workflow run launcher, run 40767814775).
  • Windows is still to test, on Anthony's VM; #3377 brought its linker.

python3 tools/pr_ready.py:

pr_ready (tools/pr_ready.py on ludovics-mac-mini, against origin/main at 3782473f5, 17 min 21 s)

Check Result
Scope ✅ 1 files, +50 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 405 passed (2 min 43 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 ✅ (3 s)
launcher clippy ✅ (3 min 42 s)
launcher tests ✅ 228 passed (10 min 53 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/3388 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/native-mods-mixins-cargo` --- ### 📝 Commits (1) - [`a9f8e64`](https://github.com/horizon-rust/horizon/commit/a9f8e64331d3c70e9f064ce44538e10c4f7fa0e3) Native mods: horizon-mixins finds the launcher's cargo ### 📊 Changes **1 file changed** (+50 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `launcher/src/native_mods.rs` (+50 -4) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. On a computer with no Rust of its own, every native-mod build failed at the mixins step: ``` Applying the mixins error: horizon-mixins failed (exit status: 1) … E_METADATA: failed to start `cargo metadata`: No such file or directory (os error 2) ``` `horizon-mixins apply` runs `cargo metadata`, but the launcher started it as a plain `Command`, so it looked for cargo on the player's PATH. It now starts through `Toolchain::command`, as the game's compile already does: the launcher's `bin/` comes first on PATH, with its RUSTC and CARGO_HOME. A test pins it (`horizon_mixins_finds_the_launchers_cargo`). **Found by** levzzz5154's ask to test the portable toolchain (`rust_toolchain.rs`) end to end. The test: - macOS on the Mac mini, Linux on playhorizon; - fresh `mktemp -d` launcher/game/XDG homes, and PATH reduced to `/usr/bin:/bin:/usr/sbin:/sbin` (no cargo, rustc or rustup); - `rust install`, then `install latest` (nightly-2026-10-28-9b772b2), then `native-build` of the official zoom mod. Results before this fix: - `rust install` worked on both (Linux 11 s, macOS 2 min 30 s; "This computer can link the game"). - Both then stopped at E_METADATA as above. **With this fix, end to end on both systems:** - The launcher built `native-1149c92-c10940026a0d` with its own Rust: macOS in 546 s, Linux in 729 s with 3 jobs. - Zoom's offscreen proof then ran on that launcher-built binary, with fresh homes (Linux under xvfb). On both it passed: - Options > Mods lists "Zoom 2.0.0: ON", and its settings page opens. - C zooms: screenshot diff 51.1 on macOS and 21.9 on Linux, against 1.7 and 1.2 for an unbound key. - The wheel keeps the hotbar slot while zoomed, and the settings are stored. - The Linux launcher came from this branch's dry-run build (`gh workflow run launcher`, run 40767814775). - Windows is still to test, on Anthony's VM; #3377 brought its linker. `python3 tools/pr_ready.py`: **pr_ready** (`tools/pr_ready.py` on ludovics-mac-mini, against origin/main at 3782473f5, 17 min 21 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +50 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 405 passed (2 min 43 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 | ✅ (3 s) | | launcher clippy | ✅ (3 min 42 s) | | launcher tests | ✅ 228 passed (10 min 53 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:09:06 +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#4948
No description provided.