[PR #7448] Launcher: move managed data to another drive #7609

Open
opened 2026-11-03 07:20:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7448
Author: @masa-masa-0314
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: feat/launcher-data-location


📝 Commits (1)

  • 7df27f1 Launcher: move managed data to another drive

📊 Changes

24 files changed (+1280 additions, -9 deletions)

View changed files

📝 launcher/README.md (+13 -0)
📝 launcher/lang/de.json (+13 -0)
📝 launcher/lang/es.json (+13 -0)
📝 launcher/lang/fr.json (+13 -0)
📝 launcher/lang/ja.json (+13 -0)
📝 launcher/lang/pl.json (+13 -0)
📝 launcher/lang/pt-br.json (+13 -0)
📝 launcher/lang/ru.json (+13 -0)
📝 launcher/lang/tr.json (+13 -0)
📝 launcher/lang/uk.json (+13 -0)
📝 launcher/lang/zh.json (+13 -0)
📝 launcher/src/backend.rs (+21 -1)
➕ launcher/src/data_location.rs (+620 -0)
📝 launcher/src/export_page.rs (+6 -0)
📝 launcher/src/github_mods_page.rs (+1 -1)
📝 launcher/src/import_page.rs (+6 -0)
📝 launcher/src/instances_page.rs (+6 -0)
📝 launcher/src/internet.rs (+4 -0)
📝 launcher/src/lib.rs (+2 -0)
➕ launcher/src/location_page.rs (+213 -0)

...and 4 more files

📄 Description

🤖 Opened by masa-masa-0314's AI agent (ZCode, GPT-6), not by masa-masa-0314 personally.

What and why

Fixes #7218.

Settings' Data folder row previously only displayed its path. Add Move… → folder selection → Move and restart, covering managed launcher data (versions, downloads, account files), game data (worlds and instances) and native build data. The requested scope is all managed data, not only future downloads.

The window checks active work before selection, after selection and before confirmation. It starts an offline worker and exits. The worker waits for the process-wide data-location lease, copies into a staging tree on the destination, verifies every file by SHA-256, remaps known structured paths, and commits an independent location pointer only after success. New launcher processes take a shared lease before reading the pointer. A stale worker cannot replace a newer migration.

The bootstrap lives in the platform config directory under horizon-launcher-location/location.json, outside both movable data trees. An absolute HORIZON_LAUNCHER_LOCATION_FILE override supports isolated/portable configuration. Existing nonempty HORIZON_LAUNCHER_HOME/HORIZON_HOME overrides retain priority; migration refuses them. Default game launches explicitly receive the relocated HORIZON_HOME.

Safety and scope:

  • Require an empty destination; reject same, nested/ancestor, overlapping, symlink/junction/reparse and unsupported special-file layouts. Preserve build-root aliases rather than duplicate them.
  • Keep the original data as recovery copies. This does not immediately free the old drive: the UI tells the user to verify worlds/instances before removing the old folders themselves. No source deletion is performed.
  • A failed copy or pointer commit keeps the old location active; partial destination copies are retained and the error identifies the retry/cleanup location.
  • Preserve Windows DACLs before writing copied bytes, preserve ordinary permissions, and use atomic pointer replacement. On Unix, extended ACLs/xattrs are not preserved.
  • Known structured path fields in settings, server list and instance Java-home metadata are remapped only when under a migrated root, including Windows case-insensitive matches. External folders and arbitrary custom command/env strings are not rewritten.
  • Detect running Horizon game/server/preparer processes and managed Java/Rust build processes. The lease coordinates this launcher version's processes; older/external tools must also be stopped. The copy checks for file changes, but it is not a filesystem snapshot.
  • Windows destinations for native build tools must use ASCII without spaces. Existing source links (including server-managed symlinks/junctions) cause an explicit refusal rather than an incomplete migration.

This is larger than the preferred 500-line PR: 24 files, +1280/-9, including 130 translation entries and busy-state accessors. The new copying/permission/commit module, offline worker, bootstrap resolution and UI form one usable migration transaction; shipping the UI or path switch without its safeguards would be incomplete. No new dependencies or lockfile changes.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only launcher storage management. No gameplay changes.

Other projects' code

None.

Self-check

Frozen baseline: 0de9fbac48620023876055e275ec57f2c891f3a4. Validation ran on the final source, with committed files checked against source hashes. Builds used the existing shared Cargo target, CARGO_PROFILE_DEV_DEBUG=0, CARGO_PROFILE_TEST_DEBUG=0 and CARGO_INCREMENTAL=0.

  • Launcher all-targets check and library/binary build passed.
  • 18/18 temporary tests linked to the real launcher library passed, including actual E:→C: copying, byte verification, original-data preservation, separate/aliased/nested build roots, structured path remapping, invalid destinations, junction refusal, shared-lock exclusion, injected preparation failure, Windows no-delete pointer handle, atomic old-pointer preservation and retry, unavailable roots, fresh-process reload, mixed-case paths and canonical aliases.
  • The actual offline worker completed against an explicit isolated location pointer; a fresh CLI process loaded the migrated settings. Override precedence, refusal under home overrides and unavailable-target failure passed.
  • An actual-library launch probe confirmed default game cwd/HORIZON_HOME, installed-version discovery, default instance and saved data use relocated roots.
  • Initial Clippy failed on a Windows-only unused mut; corrected and the final self-check below passed. An initial worker isolation attempt using APPDATA alone timed out because Windows known-folder resolution did not follow it; no pointer was committed, its partial target was removed, and subsequent worker validation used the explicit isolated pointer. The source directories were not modified by the migration.
  • Temporary probes/scripts/logs are archived locally, not included as permanent regression tests per contributor preference. Existing tests are retained. Runtime migration tests were on Windows; Unix behavior has not been executed.

Original final self-check output:

pr_ready (tools/pr_ready.py --quick --base 0de9fbac48620023876055e275ec57f2c891f3a4 on DESKTOP-3050AHP, against 0de9fbac48 at 0de9fbac4, 4 min 5 s)

Check Result
Scope ⚠️ 24 files, +1280 −9; 1276 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed (3 min 13 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (15 s)
launcher tests ✅ 437 passed (33 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)

The root-workspace rows are skipped because launcher is a separate workspace. Gameplay parity was intentionally not run (--quick).

Screenshots

Not captured. Native GUI automation was unavailable in this session, so folder-picker clicks, layout and the automatic GUI reopening were not visually verified. Actual-library tests and the real offline worker/fresh CLI processes were run as described above.

🤖 Generated with ZCode (GPT-6).


🔄 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/7448 **Author:** [@masa-masa-0314](https://github.com/masa-masa-0314) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/launcher-data-location` --- ### 📝 Commits (1) - [`7df27f1`](https://github.com/horizon-rust/horizon/commit/7df27f1cf9f7b703132ebbb10c9ea999870f47e9) Launcher: move managed data to another drive ### 📊 Changes **24 files changed** (+1280 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `launcher/README.md` (+13 -0) 📝 `launcher/lang/de.json` (+13 -0) 📝 `launcher/lang/es.json` (+13 -0) 📝 `launcher/lang/fr.json` (+13 -0) 📝 `launcher/lang/ja.json` (+13 -0) 📝 `launcher/lang/pl.json` (+13 -0) 📝 `launcher/lang/pt-br.json` (+13 -0) 📝 `launcher/lang/ru.json` (+13 -0) 📝 `launcher/lang/tr.json` (+13 -0) 📝 `launcher/lang/uk.json` (+13 -0) 📝 `launcher/lang/zh.json` (+13 -0) 📝 `launcher/src/backend.rs` (+21 -1) ➕ `launcher/src/data_location.rs` (+620 -0) 📝 `launcher/src/export_page.rs` (+6 -0) 📝 `launcher/src/github_mods_page.rs` (+1 -1) 📝 `launcher/src/import_page.rs` (+6 -0) 📝 `launcher/src/instances_page.rs` (+6 -0) 📝 `launcher/src/internet.rs` (+4 -0) 📝 `launcher/src/lib.rs` (+2 -0) ➕ `launcher/src/location_page.rs` (+213 -0) _...and 4 more files_ </details> ### 📄 Description > 🤖 Opened by masa-masa-0314's AI agent (ZCode, GPT-6), not by masa-masa-0314 personally. ## What and why Fixes #7218. Settings' Data folder row previously only displayed its path. Add Move… → folder selection → Move and restart, covering managed launcher data (versions, downloads, account files), game data (worlds and instances) and native build data. The requested scope is all managed data, not only future downloads. The window checks active work before selection, after selection and before confirmation. It starts an offline worker and exits. The worker waits for the process-wide data-location lease, copies into a staging tree on the destination, verifies every file by SHA-256, remaps known structured paths, and commits an independent location pointer only after success. New launcher processes take a shared lease before reading the pointer. A stale worker cannot replace a newer migration. The bootstrap lives in the platform config directory under `horizon-launcher-location/location.json`, outside both movable data trees. An absolute `HORIZON_LAUNCHER_LOCATION_FILE` override supports isolated/portable configuration. Existing nonempty HORIZON_LAUNCHER_HOME/HORIZON_HOME overrides retain priority; migration refuses them. Default game launches explicitly receive the relocated HORIZON_HOME. Safety and scope: - Require an empty destination; reject same, nested/ancestor, overlapping, symlink/junction/reparse and unsupported special-file layouts. Preserve build-root aliases rather than duplicate them. - Keep the original data as recovery copies. **This does not immediately free the old drive:** the UI tells the user to verify worlds/instances before removing the old folders themselves. No source deletion is performed. - A failed copy or pointer commit keeps the old location active; partial destination copies are retained and the error identifies the retry/cleanup location. - Preserve Windows DACLs before writing copied bytes, preserve ordinary permissions, and use atomic pointer replacement. On Unix, extended ACLs/xattrs are not preserved. - Known structured path fields in settings, server list and instance Java-home metadata are remapped only when under a migrated root, including Windows case-insensitive matches. External folders and arbitrary custom command/env strings are not rewritten. - Detect running Horizon game/server/preparer processes and managed Java/Rust build processes. The lease coordinates this launcher version's processes; older/external tools must also be stopped. The copy checks for file changes, but it is not a filesystem snapshot. - Windows destinations for native build tools must use ASCII without spaces. Existing source links (including server-managed symlinks/junctions) cause an explicit refusal rather than an incomplete migration. This is larger than the preferred 500-line PR: 24 files, +1280/-9, including 130 translation entries and busy-state accessors. The new copying/permission/commit module, offline worker, bootstrap resolution and UI form one usable migration transaction; shipping the UI or path switch without its safeguards would be incomplete. No new dependencies or lockfile changes. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only launcher storage management. No gameplay changes. ## Other projects' code None. ## Self-check Frozen baseline: `0de9fbac48620023876055e275ec57f2c891f3a4`. Validation ran on the final source, with committed files checked against source hashes. Builds used the existing shared Cargo target, `CARGO_PROFILE_DEV_DEBUG=0`, `CARGO_PROFILE_TEST_DEBUG=0` and `CARGO_INCREMENTAL=0`. - Launcher all-targets check and library/binary build passed. - **18/18 temporary tests linked to the real launcher library passed**, including actual E:→C: copying, byte verification, original-data preservation, separate/aliased/nested build roots, structured path remapping, invalid destinations, junction refusal, shared-lock exclusion, injected preparation failure, Windows no-delete pointer handle, atomic old-pointer preservation and retry, unavailable roots, fresh-process reload, mixed-case paths and canonical aliases. - The actual offline worker completed against an explicit isolated location pointer; a fresh CLI process loaded the migrated settings. Override precedence, refusal under home overrides and unavailable-target failure passed. - An actual-library launch probe confirmed default game cwd/HORIZON_HOME, installed-version discovery, default instance and saved data use relocated roots. - Initial Clippy failed on a Windows-only unused mut; corrected and the final self-check below passed. An initial worker isolation attempt using APPDATA alone timed out because Windows known-folder resolution did not follow it; no pointer was committed, its partial target was removed, and subsequent worker validation used the explicit isolated pointer. The source directories were not modified by the migration. - Temporary probes/scripts/logs are archived locally, not included as permanent regression tests per contributor preference. Existing tests are retained. Runtime migration tests were on Windows; Unix behavior has not been executed. Original final self-check output: **pr_ready** (`tools/pr_ready.py --quick --base 0de9fbac48620023876055e275ec57f2c891f3a4` on DESKTOP-3050AHP, against 0de9fbac48620023876055e275ec57f2c891f3a4 at 0de9fbac4, 4 min 5 s) | Check | Result | | --- | --- | | Scope | ⚠️ 24 files, +1280 −9; 1276 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed (3 min 13 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (15 s) | | launcher tests | ✅ 437 passed (33 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) | The root-workspace rows are skipped because launcher is a separate workspace. Gameplay parity was intentionally not run (`--quick`). ## Screenshots Not captured. Native GUI automation was unavailable in this session, so folder-picker clicks, layout and the automatic GUI reopening were not visually verified. Actual-library tests and the real offline worker/fresh CLI processes were run as described above. 🤖 Generated with ZCode (GPT-6). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7609
No description provided.