[PR #3567] [MERGED] horizon-prepare: --output and --check (#3545) #5058

Closed
opened 2026-11-03 05:09:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3567
Author: @GIGABAIT93
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: feat/launch-api-prepare


📝 Commits (6)

  • da7aa1f horizon-prepare: --output and --check (#3545)
  • 8dfd374 horizon-prepare: name check's extras type for clippy
  • 6f0f282 horizon-prepare: lock a folder while preparing, unstamp before writing (#3545)
  • c83cf8c Merge remote-tracking branch 'upstream/main' into feat/launch-api-prepare
  • 277b7ee Merge main; refill_own_store asks missing_extras too
  • e5cbdb4 horizon-prepare: one lock when --output is .local; absolute Java paths

📊 Changes

11 files changed (+465 additions, -107 deletions)

View changed files

➕ crates/horizon-prepare/src/check.rs (+227 -0)
📝 crates/horizon-prepare/src/exporters.rs (+1 -1)
📝 crates/horizon-prepare/src/java.rs (+8 -1)
📝 crates/horizon-prepare/src/lib.rs (+87 -6)
📝 crates/horizon-prepare/src/main.rs (+60 -22)
📝 crates/horizon-prepare/src/sounds.rs (+43 -29)
📝 crates/horizon-prepare/src/worker.rs (+2 -0)
📝 docs/native-client.md (+14 -0)
📝 launcher/src/backend.rs (+14 -45)
📝 tests/test_prepare_output.py (+2 -0)
📝 tools/prepare_output.py (+7 -3)

📄 Description

🤖 Opened by GIGABAIT93's AI agent (Claude Code, Claude Opus 5.5), not by GIGABAIT93 directly.

What and why

The second part of #3545 (the first is #3551): what another launcher needs to prepare Horizon outside a release folder and to know when a preparation is still good. Independent of #3551; the docs/api/launch.md section for the preparer follows once both are in.

  • --output DIR: the prepared resources go there instead of <root>/.local/horizon-client/<version>, for --prepare and for the asset commands (sounds, panorama, fonts, packs, languages). One prepared set can then live outside a release folder and serve every build with the same OUTPUT_VERSION. The exporters' scratch files stay in <root>/.local/. The five asset commands now go through one add_assets(kind, root, output, minecraft, log); sounds(), panorama()… keep their signatures, so the launcher's COMPLETIONS are unchanged.
  • --check: exits 0 when the resources are complete and current for this preparer, else 1 with one line per gap naming the command that fills it. It runs no Java and reads no game files. It compares the manifest's schema and minecraft with this preparer's, the OUTPUT_VERSION that made the resources, and the extras the launcher completes (built-in packs, panorama, Unifont, languages, sounds; the same tests as launcher/src/backend.rs). --check with --prepare or --server-jar is refused (exit 2).
  • The stamp: a preparation now writes horizon-prepare.json ({"output_version": N}) beside horizon-resources.json. tools/prepare_output.py leaves it out of the digest (with a test), so it needs no new OUTPUT_VERSION and nobody prepares again for it. Resources prepared before it report an unknown output version to --check until they are prepared again; horizon-launcher doesn't run --check, so players see no change.
  • Help text and docs/native-client.md describe both and the exit codes (0 done, 1 failed or gaps found, 2 refused command line).
  • launcher/src/backend.rs: output: None in the in-process Options.

Tested on Windows against a real launcher install: --check --root <nightly-2026-10-28 folder> reports the missing stamp and exits 1; --check on an empty --output says it is not prepared; panorama --root R --output O --minecraft-dir <launcher's minecraft> copies the panorama into O and exits 0; --check --prepare exits 2. A full --prepare --output was not run here.

Suggested label: feature.

Vanilla reference

None: Horizon-only tooling (the preparer's command line).

Self-check

Run on Linux (WSL2).

pr_ready (tools/pr_ready.py --quick --base upstream/main on GIGABAIT, against upstream/main at ff0e16e3b, 5 min 37 s)

Check Result
Scope ✅ 8 files, +311 −58
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed (34 s)
rustfmt ✅ (8 s)
clippy ✅ (1 min 3 s)
tests: horizon-prepare ✅ 44 passed (6 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (1 min 23 s)
launcher tests ✅ 249 passed (2 min 20 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3567 **Author:** [@GIGABAIT93](https://github.com/GIGABAIT93) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launch-api-prepare` --- ### 📝 Commits (6) - [`da7aa1f`](https://github.com/horizon-rust/horizon/commit/da7aa1f73b129b2f41c86e4b1f1a000c9f744616) horizon-prepare: --output and --check (#3545) - [`8dfd374`](https://github.com/horizon-rust/horizon/commit/8dfd37428a22fa110e5fd0c99adf08ae6c699b3e) horizon-prepare: name check's extras type for clippy - [`6f0f282`](https://github.com/horizon-rust/horizon/commit/6f0f282cf1023ed15b64296bdcc521fe9660f2f7) horizon-prepare: lock a folder while preparing, unstamp before writing (#3545) - [`c83cf8c`](https://github.com/horizon-rust/horizon/commit/c83cf8cbed554fd4a26c71e63cc3a312ff21e4f3) Merge remote-tracking branch 'upstream/main' into feat/launch-api-prepare - [`277b7ee`](https://github.com/horizon-rust/horizon/commit/277b7ee5da3677efe02fb99a120066193a4918e2) Merge main; refill_own_store asks missing_extras too - [`e5cbdb4`](https://github.com/horizon-rust/horizon/commit/e5cbdb422e8580bc044624e6c4e2d105effa2292) horizon-prepare: one lock when --output is .local; absolute Java paths ### 📊 Changes **11 files changed** (+465 additions, -107 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-prepare/src/check.rs` (+227 -0) 📝 `crates/horizon-prepare/src/exporters.rs` (+1 -1) 📝 `crates/horizon-prepare/src/java.rs` (+8 -1) 📝 `crates/horizon-prepare/src/lib.rs` (+87 -6) 📝 `crates/horizon-prepare/src/main.rs` (+60 -22) 📝 `crates/horizon-prepare/src/sounds.rs` (+43 -29) 📝 `crates/horizon-prepare/src/worker.rs` (+2 -0) 📝 `docs/native-client.md` (+14 -0) 📝 `launcher/src/backend.rs` (+14 -45) 📝 `tests/test_prepare_output.py` (+2 -0) 📝 `tools/prepare_output.py` (+7 -3) </details> ### 📄 Description > 🤖 Opened by GIGABAIT93's AI agent (Claude Code, Claude Opus 5.5), not by GIGABAIT93 directly. ## What and why The second part of #3545 (the first is #3551): what another launcher needs to prepare Horizon outside a release folder and to know when a preparation is still good. Independent of #3551; the `docs/api/launch.md` section for the preparer follows once both are in. - `--output DIR`: the prepared resources go there instead of `<root>/.local/horizon-client/<version>`, for `--prepare` and for the asset commands (`sounds`, `panorama`, `fonts`, `packs`, `languages`). One prepared set can then live outside a release folder and serve every build with the same `OUTPUT_VERSION`. The exporters' scratch files stay in `<root>/.local/`. The five asset commands now go through one `add_assets(kind, root, output, minecraft, log)`; `sounds()`, `panorama()`… keep their signatures, so the launcher's `COMPLETIONS` are unchanged. - `--check`: exits 0 when the resources are complete and current for this preparer, else 1 with one line per gap naming the command that fills it. It runs no Java and reads no game files. It compares the manifest's `schema` and `minecraft` with this preparer's, the `OUTPUT_VERSION` that made the resources, and the extras the launcher completes (built-in packs, panorama, Unifont, languages, sounds; the same tests as `launcher/src/backend.rs`). `--check` with `--prepare` or `--server-jar` is refused (exit 2). - **The stamp:** a preparation now writes `horizon-prepare.json` (`{"output_version": N}`) beside `horizon-resources.json`. `tools/prepare_output.py` leaves it out of the digest (with a test), so it needs no new `OUTPUT_VERSION` and nobody prepares again for it. Resources prepared before it report an unknown output version to `--check` until they are prepared again; `horizon-launcher` doesn't run `--check`, so players see no change. - Help text and `docs/native-client.md` describe both and the exit codes (0 done, 1 failed or gaps found, 2 refused command line). - `launcher/src/backend.rs`: `output: None` in the in-process `Options`. Tested on Windows against a real launcher install: `--check --root <nightly-2026-10-28 folder>` reports the missing stamp and exits 1; `--check` on an empty `--output` says it is not prepared; `panorama --root R --output O --minecraft-dir <launcher's minecraft>` copies the panorama into `O` and exits 0; `--check --prepare` exits 2. A full `--prepare --output` was not run here. Suggested label: `feature`. ## Vanilla reference None: Horizon-only tooling (the preparer's command line). ## Self-check Run on Linux (WSL2). **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on GIGABAIT, against upstream/main at ff0e16e3b, 5 min 37 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +311 −58 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (34 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (1 min 3 s) | | tests: horizon-prepare | ✅ 44 passed (6 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (1 min 23 s) | | launcher tests | ✅ 249 passed (2 min 20 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:09:56 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5058
No description provided.