[PR #3323] [MERGED] Native mods on the hook points build on any Horizon that has them #4900

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

📋 Pull Request Information

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

Base: main ← Head: feat/native-hooks-api-build


📝 Commits (1)

  • 4e804cd Native mods on the hook points build on any Horizon that has them

📊 Changes

3 files changed (+225 additions, -13 deletions)

View changed files

📝 crates/horizon-mods/src/index/native.rs (+26 -0)
📝 docs/native-mods.md (+13 -0)
📝 launcher/src/native_mods.rs (+186 -13)

📄 Description

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

The official mods are moving to native mods that use only the game's stable hook points (game/native_hooks.rs, a separate PR). If each of them pinned its own Horizon commit, they could not be built together, and they would not build on the version the player plays. This PR lets a native mod name the hook-points version it needs instead.

  • Registry manifest (index/native.rs): horizon-native.json may carry "hooks": N. It is optional, and 0 is refused. horizon stays as the commit the mod was tested on.
  • Launcher builder (native_mods.rs):
    • Mods without hooks (Veinminer…) pin the revision as before. With none of those, the build uses the installed version's revision, i.e. the game the player plays.
    • It reads that revision's NATIVE_HOOKS_API (one raw file from GitHub). Every hooks mod must have at least the version it names. Hook points are only ever added, so a mod built on v1 builds on any later Horizon.
    • When the API is missing and no mod pins a revision, the build falls back to the hooks mods' tested revision. Otherwise it stops with an error naming the mods.
    • In its own copy of each hooks bundle, it rewrites horizon_revision to the build's revision, so horizon-mixins' revision check passes.
    • It passes --features horizon-client/mods only when that revision's Cargo.toml has the feature.
  • docs/native-mods.md: a "Mods on the hook points" section.

Launcher 0.2.21 reads horizon-native.json strictly, so it refuses a bundle with hooks. Native mods are experimental and off by default there, and the launcher updates itself.

Tests: mods_on_the_hook_points_follow_the_game_or_the_pins, a_hooks_bundle_is_read_and_repinned_to_the_build, hooks_is_optional_and_kept.

Proved with the four mods native/{zoom,fps-overlay,keystrokes,minimap} in horizon-rust/horizon-mods: each repo's CI applies its mod with horizon-mixins on its tested Horizon and builds the game; all four applied together build in one game and play (Options > Mods lists the four, all draw, zoom works).

pr_ready (tools/pr_ready.py on ludovics-mac-mini, against origin/main at d0b6e4892, 11 min 57 s)

Check Result
Scope ⚠️ 3 files, +221 −13; mixes game, launcher
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 401 passed (58 s)
rustfmt ✅ after the fix in 4e804cd (cargo fmt --all --check clean; the test rerun passes)
clippy ✅ (5 min 12 s)
tests: horizon-mods ✅ 76 passed (2 min 32 s)
doc tests ✅ 0 passed (4 s)
content root tests ✅ 5 passed (2 min 31 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (6 s)
launcher tests ✅ 222 passed (4 s)
Parity ➖ 35 affected, to run in CI (no vanilla data here): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, ghost_recipe, hardcore_respawn, hud and 23 more
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/3323 **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:** `feat/native-hooks-api-build` --- ### 📝 Commits (1) - [`4e804cd`](https://github.com/horizon-rust/horizon/commit/4e804cd81329cbf98e2c7aedf4ef0127bbfae0f4) Native mods on the hook points build on any Horizon that has them ### 📊 Changes **3 files changed** (+225 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-mods/src/index/native.rs` (+26 -0) 📝 `docs/native-mods.md` (+13 -0) 📝 `launcher/src/native_mods.rs` (+186 -13) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. The official mods are moving to native mods that use only the game's stable hook points (`game/native_hooks.rs`, a separate PR). If each of them pinned its own Horizon commit, they could not be built together, and they would not build on the version the player plays. This PR lets a native mod name the **hook-points version** it needs instead. - **Registry manifest** (`index/native.rs`): `horizon-native.json` may carry `"hooks": N`. It is optional, and `0` is refused. `horizon` stays as the commit the mod was tested on. - **Launcher builder** (`native_mods.rs`): - Mods without `hooks` (Veinminer…) pin the revision as before. With none of those, the build uses the installed version's revision, i.e. the game the player plays. - It reads that revision's `NATIVE_HOOKS_API` (one raw file from GitHub). Every `hooks` mod must have at least the version it names. Hook points are only ever added, so a mod built on v1 builds on any later Horizon. - When the API is missing and no mod pins a revision, the build falls back to the `hooks` mods' tested revision. Otherwise it stops with an error naming the mods. - In its own copy of each `hooks` bundle, it rewrites `horizon_revision` to the build's revision, so horizon-mixins' revision check passes. - It passes `--features horizon-client/mods` only when that revision's `Cargo.toml` has the feature. - `docs/native-mods.md`: a "Mods on the hook points" section. Launcher 0.2.21 reads `horizon-native.json` strictly, so it refuses a bundle with `hooks`. Native mods are experimental and off by default there, and the launcher updates itself. Tests: `mods_on_the_hook_points_follow_the_game_or_the_pins`, `a_hooks_bundle_is_read_and_repinned_to_the_build`, `hooks_is_optional_and_kept`. Proved with the four mods `native/{zoom,fps-overlay,keystrokes,minimap}` in horizon-rust/horizon-mods: each repo's CI applies its mod with horizon-mixins on its tested Horizon and builds the game; all four applied together build in one game and play (Options > Mods lists the four, all draw, zoom works). **pr_ready** (`tools/pr_ready.py` on ludovics-mac-mini, against origin/main at d0b6e4892, 11 min 57 s) | Check | Result | | --- | --- | | Scope | ⚠️ 3 files, +221 −13; mixes game, launcher | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 401 passed (58 s) | | rustfmt | ✅ after the fix in 4e804cd (`cargo fmt --all --check` clean; the test rerun passes) | | clippy | ✅ (5 min 12 s) | | tests: horizon-mods | ✅ 76 passed (2 min 32 s) | | doc tests | ✅ 0 passed (4 s) | | content root tests | ✅ 5 passed (2 min 31 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (6 s) | | launcher tests | ✅ 222 passed (4 s) | | Parity | ➖ 35 affected, to run in CI (no vanilla data here): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, ghost_recipe, hardcore_respawn, hud and 23 more | | 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:08:46 +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#4900
No description provided.