[PR #3194] [MERGED] Launcher: native mods from the registry install and build like the others #4841

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

📋 Pull Request Information

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

Base: main ← Head: feat/launcher-native-mods-page


📝 Commits (4)

  • 0ee2425 Merge levzzz5154's #3140 (native-mod registry kind, .hnmod validator)
  • cd1f58e Launcher: native mods from the registry install and build like the others
  • 07ab7cc Merge the native build's measured numbers
  • 1f6511d Merge main into feat/launcher-native-mods-page (#3140 and #3189 merged)

📊 Changes

5 files changed (+202 additions, -26 deletions)

View changed files

📝 docs/launcher-commands.md (+3 -2)
📝 launcher/src/browser/horizon.rs (+59 -10)
📝 launcher/src/browser/horizon/tests.rs (+28 -3)
📝 launcher/src/cli.rs (+20 -3)
📝 launcher/src/native_mods.rs (+92 -8)

📄 Description

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

Stacked on #3189 (native build) and includes levzzz5154's #3140 (native-mod kind, .hnmod validator; merged in unchanged, queued separately). This PR's own change is commit cd1f58ef7.

It covers the rest of levzzz's request: registry native mods are listed and installable, and the launcher builds and loads them.

What changes

  • Registry → Mods page. native-mod entries are listed as mods (WASM mods are on their way out, so native mods are simply "the mods"). Installing one downloads the .hnmod, checks size and SHA-256 against the index, then runs index::native::Bundle::read on it, which accepts only Rust and TOML under mixins/<id>/ and the id the index names. The file goes to <instance>/horizon-native-mods/<id>.hnmod and is turned on in horizon-mods.txt. mod_id and take-downs (turn_off_revoked) know that folder.
  • Build what's installed. native-build with no folder builds the native mods turned on in the instance (--instance, default the selected one), after checking each .hnmod again. That instance then plays the build. The game's own home builds into the Native mods instance. Pruning keeps every native build an instance plays.
  • Legal wiring (mods-standard, MOD-POLICY). Every registry project now says who made it. Projects by Horizon (authors Horizon and source in horizon-rust, the policy's definition) say "Made by Horizon". Any other project says "Made by . Not made or endorsed by the Horizon project (https://playhorizon.dev/mods/policy)". A native mod also says "Native code: it is compiled into the game and runs with full access to your computer…" and "Built by the launcher on Horizon ". These lines show in the Mods page details and in mods search.

Proof (Mac mini, isolated HORIZON_HOME / HORIZON_LAUNCHER_HOME / XDG_* / NO_SELF_UPDATE / NO_AUDIO / TRASH / CLIPBOARD)

  • I built a test registry with cargo horizon-mod registry build from horizon-mods#20's veinminer.toml and the staged file ec308c02…, and pointed the launcher at it with HORIZON_MOD_INDEX.

  • mods search --source horizon veinminer shows the authorship, policy, unsigned, native-code and "Built … on Horizon 83f15fa" lines.

  • mods install --source horizon --instance vein-test veinminer gives horizon-native-mods/veinminer.hnmod and mod.veinminer:true.

  • native-build --instance vein-test without --trust-native-code is refused. With it, the build gives native-83f15fa-4bbdb580b9ca in 194 s (warm target). This is the same key as the build from the unpacked folder in #3189, so the content is identical. instance list shows Vein test pinned to it, and the other instance's build was kept.

  • That build ran in #3189's proof (/veinminer status answered in game). play --instance vein-test stops at the owner gate without a Microsoft sign-in, and an isolated home has none, so the in-launcher Play needs a signed-in run (orchestrator).

  • Tests:

    • native entries are mods, and mod_id reads both folders;
    • only Horizon's own projects skip the "not endorsed" line, and the name alone doesn't make a project official;
    • installed mods are unpacked only when they are on, and a .hnmod carrying build.sh is refused.

    pr_ready --quick passed: clippy, cargo-horizon-mod and horizon-mods tests (78), launcher tests (218).

Left

The window: a "Native mods (experimental)" switch, a Build button with the warning and progress on the Mods page (native-mixins-1's GUI, to port), and rebuilding when the mods or the Nightly change.

🤖 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/3194 **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/launcher-native-mods-page` --- ### 📝 Commits (4) - [`0ee2425`](https://github.com/horizon-rust/horizon/commit/0ee2425d40b06c50e66fa66bc11088ae9ce9f26c) Merge levzzz5154's #3140 (native-mod registry kind, .hnmod validator) - [`cd1f58e`](https://github.com/horizon-rust/horizon/commit/cd1f58ef7256116598ff166713b653a041f6029f) Launcher: native mods from the registry install and build like the others - [`07ab7cc`](https://github.com/horizon-rust/horizon/commit/07ab7ccfc19138da84893325b8436e050a02e9ab) Merge the native build's measured numbers - [`1f6511d`](https://github.com/horizon-rust/horizon/commit/1f6511d0f38d0a7005a73d70bef0bc5a257b678b) Merge main into feat/launcher-native-mods-page (#3140 and #3189 merged) ### 📊 Changes **5 files changed** (+202 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+3 -2) 📝 `launcher/src/browser/horizon.rs` (+59 -10) 📝 `launcher/src/browser/horizon/tests.rs` (+28 -3) 📝 `launcher/src/cli.rs` (+20 -3) 📝 `launcher/src/native_mods.rs` (+92 -8) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Stacked on #3189** (native build) and **includes levzzz5154's #3140** (`native-mod` kind, `.hnmod` validator; merged in unchanged, queued separately). This PR's own change is commit `cd1f58ef7`. It covers the rest of levzzz's request: registry native mods are listed and installable, and the launcher builds and loads them. ## What changes - **Registry → Mods page.** `native-mod` entries are listed as mods (WASM mods are on their way out, so native mods are simply "the mods"). Installing one downloads the `.hnmod`, checks size and SHA-256 against the index, then runs `index::native::Bundle::read` on it, which accepts only Rust and TOML under `mixins/<id>/` and the id the index names. The file goes to `<instance>/horizon-native-mods/<id>.hnmod` and is turned on in `horizon-mods.txt`. `mod_id` and take-downs (`turn_off_revoked`) know that folder. - **Build what's installed.** `native-build` with no folder builds the native mods turned on in the instance (`--instance`, default the selected one), after checking each `.hnmod` again. **That instance then plays the build.** The game's own home builds into the Native mods instance. Pruning keeps every native build an instance plays. - **Legal wiring (mods-standard, MOD-POLICY).** Every registry project now says who made it. Projects by Horizon (authors `Horizon` and source in horizon-rust, the policy's definition) say "Made by Horizon". Any other project says "Made by <authors>. Not made or endorsed by the Horizon project (https://playhorizon.dev/mods/policy)". A native mod also says "Native code: it is compiled into the game and runs with full access to your computer…" and "Built by the launcher on Horizon <commit>". These lines show in the Mods page details and in `mods search`. ## Proof (Mac mini, isolated HORIZON_HOME / HORIZON_LAUNCHER_HOME / XDG_* / NO_SELF_UPDATE / NO_AUDIO / TRASH / CLIPBOARD) - I built a test registry with `cargo horizon-mod registry build` from horizon-mods#20's `veinminer.toml` and the staged file `ec308c02…`, and pointed the launcher at it with `HORIZON_MOD_INDEX`. - `mods search --source horizon veinminer` shows the authorship, policy, unsigned, native-code and "Built … on Horizon 83f15fa" lines. - `mods install --source horizon --instance vein-test veinminer` gives `horizon-native-mods/veinminer.hnmod` and `mod.veinminer:true`. - `native-build --instance vein-test` without `--trust-native-code` is refused. With it, the build gives `native-83f15fa-4bbdb580b9ca` in 194 s (warm target). This is the same key as the build from the unpacked folder in #3189, so the content is identical. `instance list` shows `Vein test` pinned to it, and the other instance's build was kept. - That build ran in #3189's proof (`/veinminer status` answered in game). `play --instance vein-test` stops at the owner gate without a Microsoft sign-in, and an isolated home has none, so the in-launcher Play needs a signed-in run (orchestrator). - Tests: - native entries are mods, and `mod_id` reads both folders; - only Horizon's own projects skip the "not endorsed" line, and the name alone doesn't make a project official; - installed mods are unpacked only when they are on, and a `.hnmod` carrying `build.sh` is refused. `pr_ready --quick` passed: clippy, cargo-horizon-mod and horizon-mods tests (78), launcher tests (218). ## Left The window: a "Native mods (experimental)" switch, a Build button with the warning and progress on the Mods page (native-mixins-1's GUI, to port), and rebuilding when the mods or the Nightly change. 🤖 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:20 +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#4841
No description provided.