[PR #6700] [MERGED] Launcher: import a game build you already have as its own version #7041

Closed
opened 2026-11-03 06:32:36 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6700
Author: @some-du6e
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: feature/launcher-import-client


📝 Commits (9)

  • f898dc0 Launcher: import a game build you already have as its own version
  • a9a8695 Launcher import: fix the build and the partner timer, harden the import
  • 7990e63 Launcher import: share the copy with native builds, test the checks
  • bb2440c Launcher import: fit the repo's names, docs and translations
  • bbd01b8 Launcher import: read Actions artifacts as downloaded, guard races
  • a8e24bc Launcher import: a version appears whole, in one rename
  • 058edc6 Launcher import: retry the move on Windows, let leftovers give way
  • 97a91ce Launcher import: wait for removals, say when --version can't apply
  • 73047c1 Merge remote-tracking branch 'upstream/main' into feature/launcher-import-client

📊 Changes

20 files changed (+934 additions, -58 deletions)

View changed files

📝 docs/launcher-commands.md (+11 -0)
📝 launcher/README.md (+7 -2)
📝 launcher/lang/de.json (+11 -1)
📝 launcher/lang/es.json (+11 -1)
📝 launcher/lang/fr.json (+11 -1)
📝 launcher/lang/ja.json (+11 -1)
📝 launcher/lang/pl.json (+11 -1)
📝 launcher/lang/pt-br.json (+11 -1)
📝 launcher/lang/ru.json (+11 -1)
📝 launcher/lang/tr.json (+11 -1)
📝 launcher/lang/uk.json (+11 -1)
📝 launcher/lang/zh.json (+11 -1)
📝 launcher/src/backend.rs (+17 -3)
➕ launcher/src/build_import.rs (+579 -0)
📝 launcher/src/cli.rs (+33 -0)
📝 launcher/src/cli_tools.rs (+2 -0)
📝 launcher/src/home.rs (+2 -0)
📝 launcher/src/lib.rs (+1 -0)
📝 launcher/src/main.rs (+148 -28)
📝 launcher/src/native_mods.rs (+24 -15)

📄 Description

Trying a merged change before the next Nightly means building horizon-client on your fork's Actions. Run on its own, that program can't start: it has none of Minecraft's prepared files ("No prepared game files in …/.local/horizon-client/26.3"). Today the only way to play it is to copy it over the game inside an installed version's folder by hand. That overwrites a signed version, and the next update undoes it.

What this adds

The Versions page gets Import a game build… at the end of the "Installed versions use …" line. It opens a file picker for the game program (horizon-client.exe on Windows), or for a zip holding one, such as an Actions artifact.

  • Checks: the file must be a program for this platform (PE, Mach-O or ELF) and carry the game's mod API mark (horizon-mod-api-level:), and a picked file must be named like the game (horizon-client…), because the launcher and horizon-ctl carry the mark too. Anything over 1 GiB is refused before it is read. Anything else is refused: "… is not a Horizon game for this computer."
  • Its own version: the import becomes imported-<date>-<sha7>. It is a copy of the selected (or newest) release or Nightly's folder with the picked program in place of the game, made the way native mod builds are (native_mods::install, carried_over). Its research-lock.json, preparer sources and prepared resources come with it, so it is ready to play without preparing again, and reuse_prepared still fills it in when the base wasn't prepared. Copies are clones where the disk supports them. The official version's folder is never touched. Importing the same program again just selects it. It plays with the base's game files and preparer as they are, so a build from a commit that changed the preparer's output (OUTPUT_VERSION) needs a base at least that new. The base is the selected release or Nightly, or --version on the CLI.
  • Listed apart: a new "Imported builds" section, like "Native mod builds", with a danger notice: unsigned, picked by the player, Horizon can't check where it came from. Each row shows "Imported · 2026-11-01", the version its game files came from, the picked file's name and its size on disk, plus Use and Remove. The labels on Home and in the version picker read the same.
  • Updates leave it alone: the tag is neither a release's nor a Nightly's, so no update replaces it or prunes it. select_after_update now keeps an imported selection, so a Nightly update no longer moves the player off the build they are trying.
  • CLI: horizon-launcher import-build <PATH> [--version <tag>] --trust-unsigned, beside install and remove. Like native-build, it needs an explicit trust flag, and it is in NOT_TOOLS: running a program nothing signed is the player's decision, not an agent's. docs/launcher-commands.md and launcher/README.md describe it.
  • Translations: the new strings are in all ten language tables (fr, ru, de, zh, es, uk, pl, pt-br, ja, tr).

It's ~650 lines, more than the usual ~500: 100 of them are the translation tables and ~125 the tests (imported::tests: the copied folder and its record, re-import, zip and plain-file reading, the platform check, base choice; plus a select_after_update case).

Testing

Nothing was built locally (shared host). CI's launcher job runs fmt, clippy -D warnings and cargo test --lib on this branch. Not yet tried on a real Windows install.

Label, since this fork can't set labels: feature.

Note

Filed by Opus 5.5 using 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/6700 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feature/launcher-import-client` --- ### 📝 Commits (9) - [`f898dc0`](https://github.com/horizon-rust/horizon/commit/f898dc0bb7c4fdce5d314447f869f752a1b9b91f) Launcher: import a game build you already have as its own version - [`a9a8695`](https://github.com/horizon-rust/horizon/commit/a9a86950bd9b996de9449ca6904c50f5af7626cd) Launcher import: fix the build and the partner timer, harden the import - [`7990e63`](https://github.com/horizon-rust/horizon/commit/7990e63009aa5a392db86a3ba9eab10016887990) Launcher import: share the copy with native builds, test the checks - [`bb2440c`](https://github.com/horizon-rust/horizon/commit/bb2440cd12ebcec2da29bbd42d381a0aace15b38) Launcher import: fit the repo's names, docs and translations - [`bbd01b8`](https://github.com/horizon-rust/horizon/commit/bbd01b89dbe0b93e9bf52f2a63acc4a821d2dd1b) Launcher import: read Actions artifacts as downloaded, guard races - [`a8e24bc`](https://github.com/horizon-rust/horizon/commit/a8e24bc735466d48b32d2cbb49563d08aebf0ace) Launcher import: a version appears whole, in one rename - [`058edc6`](https://github.com/horizon-rust/horizon/commit/058edc663ca69df505782816cac2b912e5eebfed) Launcher import: retry the move on Windows, let leftovers give way - [`97a91ce`](https://github.com/horizon-rust/horizon/commit/97a91ce8f73bbb5d608095c45603076fde8540d6) Launcher import: wait for removals, say when --version can't apply - [`73047c1`](https://github.com/horizon-rust/horizon/commit/73047c18107e112675f0579d34e310a221e403e7) Merge remote-tracking branch 'upstream/main' into feature/launcher-import-client ### 📊 Changes **20 files changed** (+934 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+11 -0) 📝 `launcher/README.md` (+7 -2) 📝 `launcher/lang/de.json` (+11 -1) 📝 `launcher/lang/es.json` (+11 -1) 📝 `launcher/lang/fr.json` (+11 -1) 📝 `launcher/lang/ja.json` (+11 -1) 📝 `launcher/lang/pl.json` (+11 -1) 📝 `launcher/lang/pt-br.json` (+11 -1) 📝 `launcher/lang/ru.json` (+11 -1) 📝 `launcher/lang/tr.json` (+11 -1) 📝 `launcher/lang/uk.json` (+11 -1) 📝 `launcher/lang/zh.json` (+11 -1) 📝 `launcher/src/backend.rs` (+17 -3) ➕ `launcher/src/build_import.rs` (+579 -0) 📝 `launcher/src/cli.rs` (+33 -0) 📝 `launcher/src/cli_tools.rs` (+2 -0) 📝 `launcher/src/home.rs` (+2 -0) 📝 `launcher/src/lib.rs` (+1 -0) 📝 `launcher/src/main.rs` (+148 -28) 📝 `launcher/src/native_mods.rs` (+24 -15) </details> ### 📄 Description Trying a merged change before the next Nightly means building `horizon-client` on your fork's Actions. Run on its own, that program can't start: it has none of Minecraft's prepared files ("No prepared game files in …/.local/horizon-client/26.3"). Today the only way to play it is to copy it over the game inside an installed version's folder by hand. That overwrites a signed version, and the next update undoes it. ## What this adds The Versions page gets **Import a game build…** at the end of the "Installed versions use …" line. It opens a file picker for the game program (`horizon-client.exe` on Windows), or for a zip holding one, such as an Actions artifact. - **Checks:** the file must be a program for this platform (PE, Mach-O or ELF) and carry the game's mod API mark (`horizon-mod-api-level:`), and a picked file must be named like the game (`horizon-client…`), because the launcher and horizon-ctl carry the mark too. Anything over 1 GiB is refused before it is read. Anything else is refused: "… is not a Horizon game for this computer." - **Its own version:** the import becomes `imported-<date>-<sha7>`. It is a copy of the selected (or newest) release or Nightly's folder with the picked program in place of the game, made the way native mod builds are (`native_mods::install`, `carried_over`). Its research-lock.json, preparer sources and prepared resources come with it, so it is ready to play without preparing again, and `reuse_prepared` still fills it in when the base wasn't prepared. Copies are clones where the disk supports them. The official version's folder is never touched. Importing the same program again just selects it. It plays with the base's game files and preparer as they are, so a build from a commit that changed the preparer's output (`OUTPUT_VERSION`) needs a base at least that new. The base is the selected release or Nightly, or `--version` on the CLI. - **Listed apart:** a new "Imported builds" section, like "Native mod builds", with a danger notice: unsigned, picked by the player, Horizon can't check where it came from. Each row shows "Imported · 2026-11-01", the version its game files came from, the picked file's name and its size on disk, plus Use and Remove. The labels on Home and in the version picker read the same. - **Updates leave it alone:** the tag is neither a release's nor a Nightly's, so no update replaces it or prunes it. `select_after_update` now keeps an imported selection, so a Nightly update no longer moves the player off the build they are trying. - **CLI:** `horizon-launcher import-build <PATH> [--version <tag>] --trust-unsigned`, beside `install` and `remove`. Like `native-build`, it needs an explicit trust flag, and it is in `NOT_TOOLS`: running a program nothing signed is the player's decision, not an agent's. `docs/launcher-commands.md` and `launcher/README.md` describe it. - **Translations:** the new strings are in all ten language tables (fr, ru, de, zh, es, uk, pl, pt-br, ja, tr). It's ~650 lines, more than the usual ~500: 100 of them are the translation tables and ~125 the tests (`imported::tests`: the copied folder and its record, re-import, zip and plain-file reading, the platform check, base choice; plus a `select_after_update` case). ## Testing Nothing was built locally (shared host). CI's `launcher` job runs fmt, clippy `-D warnings` and `cargo test --lib` on this branch. Not yet tried on a real Windows install. Label, since this fork can't set labels: `feature`. > [!NOTE] > Filed by Opus 5.5 using 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 06:32:36 +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#7041
No description provided.