flake: link host code with mold on Linux; DECISIONS: mold, and no LTO

mold applies to the host target only, in the dev shell, the crane builds,
and the packaged binary (proc macros and build scripts of plugins). A
rebuild of the host test binary after a change takes 0.9 s (15 s with
GNU ld). Measured LTO: no gain worth 4 more minutes per release build.
This commit is contained in:
2026-10-23 10:20:39 +01:00
parent 9fb1e05686
commit ab1adbd5e3
2 changed files with 26 additions and 7 deletions
+7
View File
@@ -75,6 +75,13 @@ a plugin, or a change that the agent makes to itself.
`sdk/<hash>/`. A path that depends only on the content of the SDK lets
cargo reuse the compiled SDK in every world. Tests run in the release
profile, so that they share compiled crates with the release build.
- **mold links host code where Nix provides it.** On Linux, the dev shell,
the Nix builds, and the packaged `sausage` (for the proc macros and build
scripts of plugins) link with mold, much faster than GNU ld. Plugins for
`wasm32-wasip2` link with rust-lld. Without Nix, the default linker stays.
- **No LTO.** Measured: fat LTO makes the binary 28 % smaller, but compiles
plugins and answers calls at most 5–8 % faster, for 4 more minutes per
release build. Thin LTO brings nothing.
- **Discovery has a deadline of 10 seconds.** It is an internal call of the
core, not a limit on plugins. Without it, one plugin that does not answer
would block every activation.