From eeb4cdb680bb16739a1f4c85e3bea24ad2097052 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Fri, 23 Oct 2026 15:06:50 +0200 Subject: [PATCH] Mod SDK: export_mod! exports only in WebAssembly, so the guests link on macOS A host build of a mod (cargo build or test on the workspace) made a cdylib whose component exports macOS's ld couldn't take: its exported-symbols list cuts `horizon:mods/events@0.1.0#init` at the `#`, so coords-hud and horizon-mods-test-guest failed to link. The exports now exist only for wasm32; on the host the macro still checks the mod and keeps it used. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-mod-sdk/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/horizon-mod-sdk/src/lib.rs b/crates/horizon-mod-sdk/src/lib.rs index ccfdb7947..71c36cf80 100644 --- a/crates/horizon-mod-sdk/src/lib.rs +++ b/crates/horizon-mod-sdk/src/lib.rs @@ -135,7 +135,13 @@ macro_rules! export_mod { with(|m| $crate::Mod::chat(m, &text)) } } + // Only WebAssembly has the component's exports: a host build (cargo test or + // clippy on the workspace) checks the mod without them, which macOS + // couldn't link (its exported-symbols list cuts names at the `#`). + #[cfg(target_arch = "wasm32")] $crate::__export_horizon_mod!(Export); + #[cfg(not(target_arch = "wasm32"))] + let _ = ::init; }; }; }