From 601fbb533a051e92f0ad3df327f686948c602d79 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 13 Oct 2026 21:59:34 +0200 Subject: [PATCH] Ship horizon-ctl in the release folders release.yml builds horizon-ctl beside the client (checked for system-only imports like it), packaging/package.sh copies it from beside the client binary and refuses to package without it (the macOS folders made by hand go through the same script), and package_native_client.py adds it to private archives. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 15 ++++++++++----- packaging/PLAY.txt | 9 +++++++++ packaging/package.sh | 11 ++++++++++- tools/package_native_client.py | 5 ++++- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6e36a6e3..e36ce3685 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,7 @@ name: release builds # Started by hand: gh workflow run release.yml --ref -# Builds the Windows x64 and Linux x86_64 clients and uploads the playable folders as artifacts. +# Builds the Windows x64 and Linux x86_64 clients (with horizon-ctl) and uploads the playable folders +# as artifacts. # macOS builds are made on the development machines. Linux is built here, on an older Ubuntu, # so the binary uses the standard loader and runs on any recent distribution (and on NixOS # through nix-ld): a build made on NixOS asks for a /nix/store loader no other system has. @@ -19,11 +20,13 @@ jobs: # The C runtime linked in, so the game runs without the Visual C++ redistributable. env: RUSTFLAGS: -C target-feature=+crt-static - run: cargo +stable build --release --locked -p horizon-client --bin horizon-client + run: cargo +stable build --release --locked -p horizon-client --bin horizon-client --bin horizon-ctl - name: Only system DLLs # Vulkan and the rest are loaded at run time; a linked non-system DLL is a # "DLL not found" dialog on some players' machines. - run: python tools/check_imports.py target/release/horizon-client.exe + run: | + python tools/check_imports.py target/release/horizon-client.exe + python tools/check_imports.py target/release/horizon-ctl.exe - name: Package shell: bash run: packaging/package.sh target/release/horizon-client.exe dist/horizon-windows-x64 @@ -40,9 +43,11 @@ jobs: - name: ALSA headers run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libasound2-dev - name: Build the client - run: cargo +stable build --release --locked -p horizon-client --bin horizon-client + run: cargo +stable build --release --locked -p horizon-client --bin horizon-client --bin horizon-ctl - name: Standard loader and libraries only - run: python3 tools/check_imports.py target/release/horizon-client + run: | + python3 tools/check_imports.py target/release/horizon-client + python3 tools/check_imports.py target/release/horizon-ctl - name: Package run: packaging/package.sh target/release/horizon-client dist/horizon-linux-x86_64 - uses: actions/upload-artifact@v4 diff --git a/packaging/PLAY.txt b/packaging/PLAY.txt index 292656c55..e932c0db3 100644 --- a/packaging/PLAY.txt +++ b/packaging/PLAY.txt @@ -30,3 +30,12 @@ Downloaded this archive directly? Controls: mouse look, WASD move, Space jump, Left Shift sneak, Left Ctrl sprint, left click break, right click place/use, 1-9 or scroll for the hotbar, E inventory, Q drop, F1 hide the HUD, F3 debug, Esc pause. + +Scripts and AI agents + horizon-ctl, in this folder, plays the game from a terminal or a script: + ./horizon-ctl launch --world Test --wait (horizon-ctl.exe on Windows) + ./horizon-ctl state + ./horizon-ctl help lists every command + horizon-ctl mcp is an MCP server for AI agents (stdio; add it to your MCP + client as the command horizon-ctl with the argument mcp). It finds the game + beside it or the version the launcher installed. diff --git a/packaging/package.sh b/packaging/package.sh index 0cab07331..a289116a0 100755 --- a/packaging/package.sh +++ b/packaging/package.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # packaging/package.sh BINARY OUTDIR: a playable Horizon folder with the game -# binary, the resource preparation tool and what it compiles, and PLAY.txt. +# binary, horizon-ctl (built beside it: cargo build --release -p horizon-client --bins), +# the resource preparation tool and what it compiles, and PLAY.txt. # It holds none of Minecraft's files: players prepare those from their own copy. set -euo pipefail bin=$1 @@ -10,4 +11,12 @@ rm -rf "$out" mkdir -p "$out" git -C "$repo" archive HEAD tools mods/horizon/src/test/java research-lock.json LICENSE | tar -x -C "$out" cp "$bin" "$out/" +# horizon-ctl, the command line and MCP server that play the game, sits beside the client. +ctl="$(dirname "$bin")/horizon-ctl" +case "$bin" in *.exe) ctl="$ctl.exe" ;; esac +if [ ! -f "$ctl" ]; then + echo "package.sh: $ctl is missing; build it too: cargo build --release -p horizon-client --bins" >&2 + exit 1 +fi +cp "$ctl" "$out/" cp "$repo/packaging/PLAY.txt" "$out/PLAY.txt" diff --git a/tools/package_native_client.py b/tools/package_native_client.py index 82847ee4b..abda2210f 100644 --- a/tools/package_native_client.py +++ b/tools/package_native_client.py @@ -3,7 +3,7 @@ tarball for one of your own Linux or macOS machines. The resources are Mojang assets: keep the archive in ignored .local/ and never publish or commit it. - cargo build --release -p horizon-client + cargo build --release -p horizon-client --bins python3 tools/package_native_client.py """ import argparse @@ -102,6 +102,9 @@ def main(): archive = args.out / f'{name}.tar.gz' with tarfile.open(archive, 'w:gz', compresslevel=1) as tar: tar.add(args.binary, 'horizon/horizon-client') + ctl = args.binary.with_name('horizon-ctl') # built with --bins: scripts and agents play through it + if ctl.is_file(): + tar.add(ctl, 'horizon/horizon-ctl') add_bytes(tar, 'horizon/horizon.sh', LAUNCHER.encode(), 0o755) tar.add(ROOT / 'docs/media/icon-256.png', 'horizon/horizon.png') add_bytes(tar, 'horizon/README.txt', README.format(version=version, commit=commit, platform=plat).encode())