[PR #1447] [MERGED] Code mods are the client's mods feature: tests and probes skip wasmtime #3528

Closed
opened 2026-11-03 04:10:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: chore/client-mods-feature


📝 Commits (3)

  • b15e5e8 Code mods are the client's mods feature: tests and probes skip wasmtime
  • 0cc3b4a Merge remote-tracking branch 'origin/main' into mm1-1447
  • ee79b8f Merge remote-tracking branch 'origin/main' into mm1-1447

📊 Changes

14 files changed (+139 additions, -53 deletions)

View changed files

📝 .github/workflows/ci.yml (+4 -3)
📝 .github/workflows/release.yml (+5 -3)
📝 Cargo.lock (+0 -1)
📝 crates/horizon-client/Cargo.toml (+5 -1)
📝 crates/horizon-client/src/game/chat.rs (+2 -2)
📝 crates/horizon-client/src/game/extras.rs (+1 -1)
📝 crates/horizon-client/src/game/mods.rs (+70 -13)
📝 crates/horizon-mods/Cargo.toml (+7 -4)
📝 crates/horizon-mods/src/lib.rs (+1 -1)
📝 crates/horizon-mods/src/manifest.rs (+19 -1)
📝 crates/horizon-mods/src/runtime.rs (+0 -17)
📝 docs/mods.md (+10 -2)
📝 tests/test_pr_ready.py (+3 -2)
📝 tools/pr_ready.py (+12 -2)

📄 Description

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

What

Workstream 6 (review-plan.md): code mods become the client's mods feature, on in every release build, so the game's tests, probes and dev builds stop compiling wasmtime and cranelift.

  • horizon-mods: runtime is no longer a default feature. The sandbox test now has required-features = ["runtime", "pack"] instead of a dev-dependency on itself: that dev-dependency turned the runtime on in every workspace build with examples, including parity.py's cargo build --workspace --examples probe build (checked on a two-crate toy workspace: a member's self-dev-dependency features are unified into --workspace --example X builds).
  • horizon_mods::find moves from runtime.rs to manifest.rs: content mods use it without the runtime.
  • Client: mods = ["horizon-mods/runtime"]. Without it game/mods.rs still layers content mods, logs Horizon: N mod(s) not started: this build has no mod runtime (build with --features mods), and every hook is a no-op (two small ModsState helpers replace the three direct self.mods.mods reads in chat.rs and extras.rs).
  • release.yml: the client build passes --features horizon-client/mods, the horizon-engine server build --no-default-features --features mods (it linked the runtime before too).
  • ci.yml: workspace clippy with horizon-client/mods, workspace tests with horizon-client/mods,horizon-mods/pack (so the sandbox test still runs; CI built wasmtime for horizon-mods' tests before as well, so CI time doesn't change). The --no-default-features clippy line still checks the no-mods path.
  • pr_ready.py: turns the same features on wherever horizon-mods is checked (+ a test).
  • docs/mods.md: how to build the game with code mods from source.

Numbers (Mac mini, clean, -j10, sccache off, dev profile; other agents were building, so wall times are ±20%)

before (main) after
cargo build -p horizon-client --bins (what a probe / cargo run builds) 451 units, 393 unit-s, 88.8 s 370 units, 360 unit-s, 74.3 s
of which the wasm stack (wasmtime, cranelift, wasm-tools…) 57 units, 102 unit-s 0
cargo build --workspace (minus the 2 guests) 506 units, 480 unit-s, 85.0 s 442 units, 416 unit-s, 85.4 s
of which the wasm stack 81 units, 148 unit-s 24 units, 44 unit-s (wit-component for cargo-horizon-mod, wit-bindgen for the SDK)
target dir after it 4.9 GB 4.2 GB
cargo tree -d (host, crates with 2+ versions) 20 19

The workspace build's wall time is set by the horizon-world → client chain, so it barely moves; the per-crate builds (probes, cargo run, pr_ready's -p tests) lose the whole wasm stack.

Release binaries keep mods

  • cargo build --release --locked --features horizon-client/mods -p horizon-client --bin horizon-client --bin horizon-ctl (release.yml's line): 14 min, binary has 3906 wasmtime symbols (the no-mods dev build: 0).
  • That release game, launched offscreen with --dev-mod coords_hud.hmod (scratch HOME/XDG dirs): horizon-ctl command where → chat [Coordinates HUD] -22, 69, -3 in minecraft:overworld.
  • The no-mods dev build, same command: Unknown or incomplete command, and the log says Horizon: 1 mod(s) not started: this build has no mod runtime (build with --features mods).
  • Sandbox tests: cargo test -p horizon-mods --features runtime,pack: 11 + 12 passed, 1 ignored (benchmark).

Self-check

  • cargo fmt --all -- --check: OK
  • cargo clippy --workspace --all-targets --features horizon-client/mods -- -D warnings: OK; also without the feature, -p horizon-client --no-default-features, and -p horizon-client --no-default-features --features mods: OK
  • cargo test -p horizon-client --tests: 1043 + 98 + 18 + 7 passed
  • python3 -m unittest tests.test_pr_ready: 17 passed
  • tools/parity.py --changed origin/main: Cargo.lock and pr_ready.py are root inputs, so all 329 harnesses: left to CI. The harnesses' probes don't use code mods (the lib's only horizon-mods use is content, unchanged).

Conflicts to expect (one-line resolutions)

  • #1435 (review-1-ci) rewrites the same cargo +stable test --workspace line in ci.yml: whichever lands second keeps #1435's --lib --bins --tests / --doc split and adds --features horizon-client/mods,horizon-mods/pack to both.
  • #1171 (macOS x64) edits the same release.yml build line (adds --target): keep both.

Needs Ludovic

Nothing to decide. Note: cargo run -p horizon-client from source no longer runs code mods unless --features mods is passed (docs/mods.md says so); every published build has them.

🤖 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/1447 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/client-mods-feature` --- ### 📝 Commits (3) - [`b15e5e8`](https://github.com/horizon-rust/horizon/commit/b15e5e893ed96733ebcdb1e8a1e7e41969251f59) Code mods are the client's mods feature: tests and probes skip wasmtime - [`0cc3b4a`](https://github.com/horizon-rust/horizon/commit/0cc3b4a0575827ff5acd0708069d06cf2c3e45ce) Merge remote-tracking branch 'origin/main' into mm1-1447 - [`ee79b8f`](https://github.com/horizon-rust/horizon/commit/ee79b8f0cddddfb6a703800dbd0fdc5522b2dafc) Merge remote-tracking branch 'origin/main' into mm1-1447 ### 📊 Changes **14 files changed** (+139 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+4 -3) 📝 `.github/workflows/release.yml` (+5 -3) 📝 `Cargo.lock` (+0 -1) 📝 `crates/horizon-client/Cargo.toml` (+5 -1) 📝 `crates/horizon-client/src/game/chat.rs` (+2 -2) 📝 `crates/horizon-client/src/game/extras.rs` (+1 -1) 📝 `crates/horizon-client/src/game/mods.rs` (+70 -13) 📝 `crates/horizon-mods/Cargo.toml` (+7 -4) 📝 `crates/horizon-mods/src/lib.rs` (+1 -1) 📝 `crates/horizon-mods/src/manifest.rs` (+19 -1) 📝 `crates/horizon-mods/src/runtime.rs` (+0 -17) 📝 `docs/mods.md` (+10 -2) 📝 `tests/test_pr_ready.py` (+3 -2) 📝 `tools/pr_ready.py` (+12 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Workstream 6 (review-plan.md): code mods become the client's **`mods` feature**, on in every release build, so the game's tests, probes and dev builds stop compiling wasmtime and cranelift. - `horizon-mods`: `runtime` is no longer a default feature. The sandbox test now has `required-features = ["runtime", "pack"]` instead of a dev-dependency on itself: that dev-dependency turned the runtime on in **every** workspace build with examples, including parity.py's `cargo build --workspace --examples` probe build (checked on a two-crate toy workspace: a member's self-dev-dependency features are unified into `--workspace --example X` builds). - `horizon_mods::find` moves from `runtime.rs` to `manifest.rs`: content mods use it without the runtime. - Client: `mods = ["horizon-mods/runtime"]`. Without it `game/mods.rs` still layers content mods, logs `Horizon: N mod(s) not started: this build has no mod runtime (build with --features mods)`, and every hook is a no-op (two small `ModsState` helpers replace the three direct `self.mods.mods` reads in chat.rs and extras.rs). - **release.yml**: the client build passes `--features horizon-client/mods`, the horizon-engine server build `--no-default-features --features mods` (it linked the runtime before too). - **ci.yml**: workspace clippy with `horizon-client/mods`, workspace tests with `horizon-client/mods,horizon-mods/pack` (so the sandbox test still runs; CI built wasmtime for horizon-mods' tests before as well, so CI time doesn't change). The `--no-default-features` clippy line still checks the no-mods path. - **pr_ready.py**: turns the same features on wherever horizon-mods is checked (+ a test). - docs/mods.md: how to build the game with code mods from source. ## Numbers (Mac mini, clean, `-j10`, sccache off, dev profile; other agents were building, so wall times are ±20%) | | before (main) | after | |---|---|---| | `cargo build -p horizon-client --bins` (what a probe / `cargo run` builds) | 451 units, 393 unit-s, 88.8 s | 370 units, 360 unit-s, 74.3 s | | of which the wasm stack (wasmtime, cranelift, wasm-tools…) | 57 units, 102 unit-s | **0** | | `cargo build --workspace` (minus the 2 guests) | 506 units, 480 unit-s, 85.0 s | 442 units, 416 unit-s, 85.4 s | | of which the wasm stack | 81 units, 148 unit-s | 24 units, 44 unit-s (wit-component for cargo-horizon-mod, wit-bindgen for the SDK) | | target dir after it | 4.9 GB | 4.2 GB | | `cargo tree -d` (host, crates with 2+ versions) | 20 | 19 | The workspace build's wall time is set by the horizon-world → client chain, so it barely moves; the per-crate builds (probes, `cargo run`, pr_ready's `-p` tests) lose the whole wasm stack. ## Release binaries keep mods - `cargo build --release --locked --features horizon-client/mods -p horizon-client --bin horizon-client --bin horizon-ctl` (release.yml's line): 14 min, binary has 3906 wasmtime symbols (the no-mods dev build: 0). - That release game, launched offscreen with `--dev-mod coords_hud.hmod` (scratch HOME/XDG dirs): `horizon-ctl command where` → chat `[Coordinates HUD] -22, 69, -3 in minecraft:overworld`. - The no-mods dev build, same command: `Unknown or incomplete command`, and the log says `Horizon: 1 mod(s) not started: this build has no mod runtime (build with --features mods)`. - Sandbox tests: `cargo test -p horizon-mods --features runtime,pack`: 11 + 12 passed, 1 ignored (benchmark). ## Self-check - `cargo fmt --all -- --check`: OK - `cargo clippy --workspace --all-targets --features horizon-client/mods -- -D warnings`: OK; also without the feature, `-p horizon-client --no-default-features`, and `-p horizon-client --no-default-features --features mods`: OK - `cargo test -p horizon-client --tests`: 1043 + 98 + 18 + 7 passed - `python3 -m unittest tests.test_pr_ready`: 17 passed - `tools/parity.py --changed origin/main`: Cargo.lock and pr_ready.py are root inputs, so all 329 harnesses: left to CI. The harnesses' probes don't use code mods (the lib's only horizon-mods use is content, unchanged). ## Conflicts to expect (one-line resolutions) - **#1435** (review-1-ci) rewrites the same `cargo +stable test --workspace` line in ci.yml: whichever lands second keeps #1435's `--lib --bins --tests` / `--doc` split and adds `--features horizon-client/mods,horizon-mods/pack` to both. - **#1171** (macOS x64) edits the same release.yml build line (adds `--target`): keep both. ## Needs Ludovic Nothing to decide. Note: `cargo run -p horizon-client` from source no longer runs code mods unless `--features mods` is passed (docs/mods.md says so); every published build has them. 🤖 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 04:10:11 +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#3528
No description provided.