[PR #1867] [MERGED] Launcher: a preparation that reuses imported game files still copies the sounds and panorama #3829

Closed
opened 2026-11-03 04:12:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1867
Author: @ludovic111
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/prepare-regression


📝 Commits (1)

  • 204859a Launcher: a preparation reusing imported game files still finds the assets

📊 Changes

1 file changed (+88 additions, -9 deletions)

View changed files

📝 launcher/src/backend.rs (+88 -9)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What players reported

Since about 0.2.48, some installs play no sound and show a grey title panorama, while 0.2.47 and earlier work on the same install. jan.sonki on Discord (CachyOS, Prism Launcher, 0.2.57): the preparation said an assets file was missing, and clicking Prepare again changes nothing. #1773 (no sound, Arch Linux) is probably the same. kevennever: resources have to be prepared again after launcher updates.

Cause

When a new version is installed, the launcher copies an older version's prepared resources only if the preparer sources are byte-for-byte the same (resources_compatible). 0.2.48 changed crates/horizon-prepare (1dffadeea, pack.png), so every player prepared again (0.2.49 and 0.2.52 did the same). That preparation reuses the game files already imported by the earlier version (reuse_imported), and when it does, preparer skipped sources::resolve and handed the chosen folder as it is to the sound copy and to the panorama, fonts, built-in packs and languages step. A Prism Launcher instance folder (or a Modrinth App profile, or no folder chosen at all) holds no assets/indexes/<id>.json, so all of them failed with "Missing …/assets/indexes/34.json", and only a log line said so. Prepare again took the same path.

Fix

preparer now resolves the Minecraft folder in both cases. Another launcher's files are linked into the official layout, as for a first preparation, so the asset store is found. With reused imports, a folder that can't be found (or a version file that can't be fetched) is no longer an error: the preparation goes on without the assets and logs one line saying so (assets_folder).

Tested (Mac mini, launcher CLI prepare, fresh mktemp homes, the env isolation from CLAUDE.md)

The fixture is an installed version with imported game files and no prepared resources (the state after an update). The asset store is index 34 from piston-meta, with objects from the CDN or the prepared sounds. Each run was stopped after the panorama step.

Layout (chosen folder) main this branch
Prism Launcher: PrismLauncher/instances/26.3/minecraft No sound … Missing …/instances/26.3/minecraft/assets/indexes/34.json, then panorama, Unifont, packs and languages "not imported" Using Minecraft 26.3 from the chosen folder (…/PrismLauncher), Sound assets ready: 4962 files, 377.3 MB, Panorama assets ready: 7 files, fonts, packs, Language assets ready: 143 files; panorama_0.png is 1024×1024
Official launcher: .minecraft works works, read in place (nothing linked)
Official layout with the launcher-rewritten 26.3.json from #1772 sound copy fails on the unknown version file Mojang's version file is fetched into the linked layout; sounds and panorama ready
Empty folder (nothing anywhere) silent, no explanation Minecraft 26.3's assets were not found in any launcher folder: the game will be silent and the title screen plain; the preparation goes on

New test: backend::tests::reused_imports_take_the_assets_from_the_launcher_that_has_them (a Prism instance with reused imports gets the linked folder and its assets; no folder gives the chosen one and the log line).

Issues: this fixes jan.sonki's report. It should also fix #1773 for launcher users (the reporter's commenter ran horizon-prepare --prepare by hand without horizon-prepare sounds, which is how the CLI works; see PLAY.txt). It doesn't close #1772: that reporter ran horizon-prepare.exe directly, and the CLI still refuses a rewritten version file. The launcher's Prepare works for that install.

python3 tools/pr_ready.py --quick:

Check Result
Scope ✅ 1 files, +88 −9
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (59 s)
launcher tests ✅ 127 passed (7 s)
Parity ➖ no harness affected
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/1867 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/prepare-regression` --- ### 📝 Commits (1) - [`204859a`](https://github.com/horizon-rust/horizon/commit/204859a2cb893f71b14605ea689f91424ace0671) Launcher: a preparation reusing imported game files still finds the assets ### 📊 Changes **1 file changed** (+88 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `launcher/src/backend.rs` (+88 -9) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What players reported Since about 0.2.48, some installs play no sound and show a grey title panorama, while 0.2.47 and earlier work on the same install. jan.sonki on Discord (CachyOS, Prism Launcher, 0.2.57): the preparation said an assets file was missing, and clicking Prepare again changes nothing. #1773 (no sound, Arch Linux) is probably the same. kevennever: resources have to be prepared again after launcher updates. ## Cause When a new version is installed, the launcher copies an older version's prepared resources only if the preparer sources are byte-for-byte the same (`resources_compatible`). 0.2.48 changed `crates/horizon-prepare` (1dffadeea, pack.png), so every player prepared again (0.2.49 and 0.2.52 did the same). That preparation reuses the game files already imported by the earlier version (`reuse_imported`), and when it does, `preparer` skipped `sources::resolve` and handed the **chosen folder as it is** to the sound copy and to the panorama, fonts, built-in packs and languages step. A Prism Launcher instance folder (or a Modrinth App profile, or no folder chosen at all) holds no `assets/indexes/<id>.json`, so all of them failed with "Missing …/assets/indexes/34.json", and only a log line said so. Prepare again took the same path. ## Fix `preparer` now resolves the Minecraft folder in both cases. Another launcher's files are linked into the official layout, as for a first preparation, so the asset store is found. With reused imports, a folder that can't be found (or a version file that can't be fetched) is no longer an error: the preparation goes on without the assets and logs one line saying so (`assets_folder`). ## Tested (Mac mini, launcher CLI `prepare`, fresh `mktemp` homes, the env isolation from CLAUDE.md) The fixture is an installed version with imported game files and no prepared resources (the state after an update). The asset store is index 34 from piston-meta, with objects from the CDN or the prepared sounds. Each run was stopped after the panorama step. | Layout (chosen folder) | main | this branch | |---|---|---| | Prism Launcher: `PrismLauncher/instances/26.3/minecraft` | `No sound … Missing …/instances/26.3/minecraft/assets/indexes/34.json`, then panorama, Unifont, packs and languages "not imported" | `Using Minecraft 26.3 from the chosen folder (…/PrismLauncher)`, `Sound assets ready: 4962 files, 377.3 MB`, `Panorama assets ready: 7 files`, fonts, packs, `Language assets ready: 143 files`; panorama_0.png is 1024×1024 | | Official launcher: `.minecraft` | works | works, read in place (nothing linked) | | Official layout with the launcher-rewritten `26.3.json` from #1772 | sound copy fails on the unknown version file | Mojang's version file is fetched into the linked layout; sounds and panorama ready | | Empty folder (nothing anywhere) | silent, no explanation | `Minecraft 26.3's assets were not found in any launcher folder: the game will be silent and the title screen plain`; the preparation goes on | New test: `backend::tests::reused_imports_take_the_assets_from_the_launcher_that_has_them` (a Prism instance with reused imports gets the linked folder and its assets; no folder gives the chosen one and the log line). Issues: this fixes jan.sonki's report. It should also fix #1773 for launcher users (the reporter's commenter ran `horizon-prepare --prepare` by hand without `horizon-prepare sounds`, which is how the CLI works; see PLAY.txt). It doesn't close #1772: that reporter ran `horizon-prepare.exe` directly, and the CLI still refuses a rewritten version file. The launcher's Prepare works for that install. `python3 tools/pr_ready.py --quick`: | Check | Result | | --- | --- | | Scope | ✅ 1 files, +88 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (59 s) | | launcher tests | ✅ 127 passed (7 s) | | Parity | ➖ no harness affected | | 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 04:12:37 +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#3829
No description provided.