Launcher: build native mods on the Nightly they pin, with its own Rust

horizon-launcher native-build FOLDER --trust-native-code compiles mixin bundles (a folder with a
horizon-mixin.toml, or an unpacked .hnmod from the registry) into a game of their own:
- the Horizon commit the mods pin (all must agree; else the installed version's), its source from
  GitHub by commit (Nightlies keep theirs as nightly-source/ tags);
- horizon-mixins at the commit the mods were tested with, built once with the launcher's Rust;
- horizon-mixins apply, then the release's cargo build, with the portable toolchain;
- installed as native-<commit>-<key>, played by the Native mods instance.
Based on native-mixins-1's unmerged work; docs/native-mods.md describes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-28 13:43:52 +01:00
parent d308df6167
commit 7f3bd901bc
7 changed files with 854 additions and 3 deletions
+2 -2
View File
@@ -74,7 +74,7 @@ const LAUNCHER_BINARY: &str = if cfg!(windows) {
"horizon-launcher"
};
const CLIENT: &str = if cfg!(windows) {
pub(crate) const CLIENT: &str = if cfg!(windows) {
"horizon-client.exe"
} else {
"horizon-client"
@@ -867,7 +867,7 @@ fn files_under(dir: &Path, relative: &Path) -> Vec<PathBuf> {
files
}
fn copy_dir(from: &Path, to: &Path) -> std::io::Result<()> {
pub(crate) fn copy_dir(from: &Path, to: &Path) -> std::io::Result<()> {
fs::create_dir_all(to)?;
for entry in fs::read_dir(from)? {
let entry = entry?;