Merge pull request #1449 from ludovic111/chore/wasmtime-48

🤖 Agent: main merged into the branch (merge commit); verify passed on this head.
This commit is contained in:
Ludovic Marie
2026-10-26 04:19:14 +01:00
committed by GitHub
5 changed files with 242 additions and 321 deletions
Generated
+229 -310
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -7,7 +7,7 @@ rust-version = "1.85"
description = "Write Horizon mods in Rust: WebAssembly components for the horizon:mod world (docs/mods.md)"
[dependencies]
wit-bindgen = { version = "0.57.1", default-features = false, features = ["macros", "realloc"] }
wit-bindgen = { version = "0.60.0", default-features = false, features = ["macros", "realloc"] }
[lints]
workspace = true
+5 -5
View File
@@ -3,7 +3,7 @@ name = "horizon-mods"
version = "0.1.0"
edition.workspace = true
license.workspace = true
rust-version = "1.86"
rust-version = "1.95"
description = "Horizon's mod runtime: sandboxed WebAssembly components (docs/mods.md)"
[dependencies]
@@ -12,11 +12,11 @@ serde_json = "1"
toml = "1.1.6"
zip = { version = "2", default-features = false, features = ["deflate"] }
log = "0.4"
# The 36 LTS line: security fixes until August 2027, and it builds on the client's Rust.
wasmtime = { version = "36.0.18", default-features = false, features = ["runtime", "cranelift", "component-model", "std"], optional = true }
# The 48 LTS line: security fixes until August 2028, on the same wasm-tools (0.254) as wit-component and the SDK's wit-bindgen.
wasmtime = { version = "48.0.7", default-features = false, features = ["runtime", "cranelift", "component-model", "std"], optional = true }
# Turns a mod's core module into a component (cargo horizon-mod build, the tests).
wit-component = { version = "0.239", optional = true }
wit-parser = { version = "0.239", optional = true }
wit-component = { version = "0.254", optional = true }
wit-parser = { version = "0.254", optional = true }
# The registry index's checks (feature `index`): SHA-256, and minisign signatures (no dependencies of its own).
sha2 = { version = "0.10", optional = true }
minisign-verify = { version = "0.3", optional = true }
+2 -2
View File
@@ -52,7 +52,7 @@ fn definition(resolve: &Resolve, kind: &TypeDefKind) -> String {
match kind {
TypeDefKind::Option(t) => format!("option<{}>", ty(resolve, t)),
TypeDefKind::List(t) => format!("list<{}>", ty(resolve, t)),
TypeDefKind::FixedSizeList(t, n) => format!("list<{}, {n}>", ty(resolve, t)),
TypeDefKind::FixedLengthList(t, n) => format!("list<{}, {n}>", ty(resolve, t)),
TypeDefKind::Result(r) => match (&r.ok, &r.err) {
(None, None) => "result".into(),
(ok, None) => format!("result<{}>", of(ok)),
@@ -82,7 +82,7 @@ fn signature(resolve: &Resolve, f: &Function) -> String {
let params: Vec<_> = f
.params
.iter()
.map(|(name, t)| format!("{name}: {}", ty(resolve, t)))
.map(|p| format!("{}: {}", p.name, ty(resolve, &p.ty)))
.collect();
let result = f
.result
+5 -3
View File
@@ -15,7 +15,7 @@ folder, loads no runtime and plays exactly like vanilla 26.3.
| The contract (WIT) | `crates/horizon-mod-sdk/wit/horizon.wit` | 0.1: log, game-read, chat, hud, storage, command, ui; tick, frame, chat and command hooks |
| SDK for mod authors | `crates/horizon-mod-sdk` | 0.1 |
| Example mods | `crates/horizon-mod-sdk/examples/coords-hud`, `examples/predator-missile` | coordinates, facing and time HUD, `/where`, `/coords`; `/missile`, a guided missile from vanilla commands |
| Runtime | `crates/horizon-mods` | wasmtime 36 LTS, component model |
| Runtime | `crates/horizon-mods` | wasmtime 48 LTS, component model |
| Authoring tool | `crates/cargo-horizon-mod` | `cargo horizon-mod new [--template code\|content] / build / run / check`, and the registry's CI (`registry build / review / list`) |
| In the game | `crates/horizon-client/src/game/mods.rs`, Options > Mods | client mods |
| Launcher mod browser (Modrinth, CurseForge with a key) | [mod-browser.md](mod-browser.md) | resource packs, modpacks |
@@ -135,8 +135,10 @@ There is no file, socket, process or raw-input interface, on purpose.
| native `cdylib` plugins | none | no: per OS and arch, unstable Rust ABI | yes | none | unsafe for players |
| an embedded JVM | none per mod | yes | Java | 100+ MB, seconds of startup | see the research |
wasmtime 36 is a long-term-support line (security fixes until August 2027)
that builds on the client's Rust 1.90. Only its `runtime`, `cranelift`,
wasmtime 48 is a long-term-support line (security fixes until August 2028)
and needs Rust 1.95. It reads WebAssembly with the same wasm-tools release
(0.254) as the `wit-component` that packs mods and the SDK's `wit-bindgen`, so
the build carries one copy of them. Only its `runtime`, `cranelift`,
`component-model` and `std` features are on: no WASI, no async, no GC
proposal, no profiling. Its cranelift backend generates native code for x86-64
and ARM64 on Windows, macOS and Linux, which is why one `.hmod` serves them