feat(recomplauncher): an update builds the game again without the player's copy, and the build's work folder uninstalls with the game #1840

Merged
HumanBean merged 6 commits from Xarishark/Longshot:builder/recomplauncher-keeps-copy into main 2026-11-20 15:59:18 +00:00
Contributor

Summary

RecompLauncher builds Longshot from the player's own copy through the builder's recomplauncher.json. Three things went wrong there:

  • An update never built the game again. RecompLauncher keeps a game set up through an update and builds it again only when the setup step's prepare.version changes. Longshot's stayed "2" in every release, and Play starts the game with LONGSHOT_NO_UPDATE_CHECK, so a player who updated kept playing the build of the release they first set up, with nothing asking them to build again.
  • A build without the copy wasn't possible. A player who deleted their copy after the first build was asked for it again. The game folder already keeps the game files it was built from (.longshot_exefs and romfs), and --update <folder> already rebuilds from them; the setup step just never used that.
  • Uninstalling the game left the builder's work folder behind (its compile cache, in ~/.cache/longshot-builder or %LOCALAPPDATA%\LongshotBuilder), since it lived outside the game.

What this changes:

  1. nx2/make_game.py: --prepare with no copy given (no --game, .nup, --romfs/--exefs or --update) builds again from the game folder (--update <out>). A folder that kept no game files says so plainly instead of the generic update error. It comes before the --romfs-in-place checks, so they see the update mode.
  2. recomplauncher.json: the copy goes as one argument (--game={game}, so a path with spaces stays whole), image.bin is the step's done (the launcher can tell the build is there), and keeps_copy is on: with the copy gone, RecompLauncher runs the same line without --game.
  3. recomplauncher.json: --work {install}/recompdata/cache/work. recompdata is the folder RecompLauncher gives a game for everything it makes; the work folder moves and uninstalls with the game, and RecompLauncher's backups and cloud saves leave cache folders out. A rebuild reuses it, so it compiles only what changed.
  4. scripts/builder_package.py release_manifest: each release's copy of recomplauncher.json carries the release's version in prepare.version, in the Windows zip and (through its manifest command, scripts/linux/appimage.sh) in the AppImage. The file in the tree keeps "2"; nothing else of it changes.
  5. recomplauncher.json: the step's label is "Building the game (15 to 30 minutes the first time)", since a rebuild doesn't use the copy and takes minutes.

The result in RecompLauncher: after an update, the next Play builds the game again from what the folder kept, without the player's copy, and then starts it (RecompLauncher 0.90 Beta 65 shows this as Easy Setup's Build It Again; its next release as a small "Finish the Update" window). A player can delete their copy after the first build, and uninstalling leaves nothing of the build on the PC.

Read first: the a.prepare block at the end of make_game.py's argument parsing, recomplauncher.json, and release_manifest in scripts/builder_package.py. The RecompLauncher paragraph in docs/dev/reference/releases.md says the same in words.

Testing

Tested:

  • A real build, as RecompLauncher runs it, on Windows 11 (VM, 8 threads, LONGSHOT_JOBS=3), from the builder laid out as the release packs it (LongshotBuilder\tools: this branch's sources, and tools.lock's Python, llvm-mingw, cpm and third-party), with a player's own copy (Ocarina of Time for Switch 2, version 131072, as a .nup), {install} being the game's folder:
    • make_game.py --prepare --game=<copy> --out {install}\Longshot --work {install}\recompdata\cache\work: done in 24.1 minutes, exit 0, image.bin there, the work folder in recompdata\cache\work (0.77 GB), and %LOCALAPPDATA%\LongshotBuilder never made.
    • The copy deleted, then the same line without --game (what RecompLauncher runs with keeps_copy): it read the game files the folder kept, kept the translation and the compiled objects, and was done in 1.4 minutes, exit 0, image.bin there, %LOCALAPPDATA%\LongshotBuilder still not made.
    • That game folder, copied to a Windows 11 PC (the same CPU, the PC's own GPU) and started from it: its first start prepared the shaders and then 40,784 pipelines (about 9 minutes, as after any update), then the game ran, 6,480 frames presented at about 222 fps with no frame waiting on shaders or pipelines.
  • RecompLauncher's own manifest check (its developer tools, on its main with this recomplauncher.json in an installed release's layout): no unknown keys, no keeps_copy warnings, and the setup step it would run is LongshotBuilder.exe --cli --prepare --game=<copy> --out {install}/Longshot --work {install}/recompdata/cache/work, without the copy the same line minus --game=; done is {install}/Longshot/image.bin.
  • The checks: Bazzite (Fedora-based Linux, KDE), no GPU needed: python3 -I -B tests/run_all.py --strict (what mise run test runs) on main @ 068fb8eb and on this branch, from the same checkout. The same checks fail on both, and nothing fails only here: 688 passed, 165 failed, 17 skipped either way, the failures from what the VM lacks (most of them a toolchain this host doesn't have; tests/test_make_game_cache.py only because its Python has no lz4). Run again on Python 3.14 with lz4: test_make_game_cache.py 48 tests OK (46 on main), test_make_game_prepare.py 20 OK (17), test_recomplauncher_json.py 10 OK (5), and every other check that reads builder_package.py, appimage.sh or recomplauncher.json the same on both. New checks: test_make_game_prepare.py (--game= read as one argument; --prepare without a copy becomes an update of the game folder; without --prepare it doesn't), test_make_game_cache.py (a folder with only the kept files builds again from them, and one with none fails with the message), test_recomplauncher_json.py (--game={game}, done, keeps_copy, the work folder in the install folder on both builders, and each release's copy carrying its version with nothing else changed, in the zip and the AppImage).

Still to test:

  • Windows 10 or 11, RecompLauncher 0.90 Beta 65 or newer: install a nightly with this, build from your copy, delete the copy, then bring in a newer nightly. Expecting Play to open Easy Setup at Build It Again, the build to run without asking for the copy, and nothing left in %LOCALAPPDATA%\LongshotBuilder after uninstalling (by hand).
  • Linux, the same with the AppImage (by hand).

Measurements

Nothing to measure: the builder's setup arguments, its RecompLauncher manifest and the release's copy of it. No change to what the game runs or how fast it builds (the rebuild above is the build's own cache at work).

Risks

  • After this ships, every Longshot update asks RecompLauncher players to build again on their next Play, as the Longshot Launcher does: from what the folder kept, reusing the work folder. Players already set up are asked once on their first update past this, since "2" becomes the release's version.
  • A setup run without a copy on a folder that kept no game files now stops with "This game folder has no copy of the game files to build from." instead of the update error. Run by hand with a copy, nothing changes.
  • The work folder moves for RecompLauncher installs only: their first build after this compiles from scratch, and the old ~/.cache/longshot-builder or %LOCALAPPDATA%\LongshotBuilder stays until deleted. Builds outside RecompLauncher keep the default work folder.
  • keeps_copy and --game= need RecompLauncher 0.90 Beta 65 or newer; an older launcher ignores keeps_copy and asks for the copy for the rebuild.
  • A revert is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A check under tests/ that reads changed source is updated, not weakened.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary RecompLauncher builds Longshot from the player's own copy through the builder's `recomplauncher.json`. Three things went wrong there: - **An update never built the game again.** RecompLauncher keeps a game set up through an update and builds it again only when the setup step's `prepare.version` changes. Longshot's stayed `"2"` in every release, and Play starts the game with `LONGSHOT_NO_UPDATE_CHECK`, so a player who updated kept playing the build of the release they first set up, with nothing asking them to build again. - **A build without the copy wasn't possible.** A player who deleted their copy after the first build was asked for it again. The game folder already keeps the game files it was built from (`.longshot_exefs` and `romfs`), and `--update <folder>` already rebuilds from them; the setup step just never used that. - **Uninstalling the game left the builder's work folder behind** (its compile cache, in `~/.cache/longshot-builder` or `%LOCALAPPDATA%\LongshotBuilder`), since it lived outside the game. What this changes: 1. `nx2/make_game.py`: `--prepare` with no copy given (no `--game`, `.nup`, `--romfs`/`--exefs` or `--update`) builds again from the game folder (`--update <out>`). A folder that kept no game files says so plainly instead of the generic update error. It comes before the `--romfs-in-place` checks, so they see the update mode. 2. `recomplauncher.json`: the copy goes as one argument (`--game={game}`, so a path with spaces stays whole), `image.bin` is the step's `done` (the launcher can tell the build is there), and `keeps_copy` is on: with the copy gone, RecompLauncher runs the same line without `--game`. 3. `recomplauncher.json`: `--work {install}/recompdata/cache/work`. `recompdata` is the folder RecompLauncher gives a game for everything it makes; the work folder moves and uninstalls with the game, and RecompLauncher's backups and cloud saves leave `cache` folders out. A rebuild reuses it, so it compiles only what changed. 4. `scripts/builder_package.py` `release_manifest`: each release's copy of `recomplauncher.json` carries the release's version in `prepare.version`, in the Windows zip and (through its `manifest` command, `scripts/linux/appimage.sh`) in the AppImage. The file in the tree keeps `"2"`; nothing else of it changes. 5. `recomplauncher.json`: the step's label is "Building the game (15 to 30 minutes the first time)", since a rebuild doesn't use the copy and takes minutes. The result in RecompLauncher: after an update, the next Play builds the game again from what the folder kept, without the player's copy, and then starts it (RecompLauncher 0.90 Beta 65 shows this as Easy Setup's **Build It Again**; its next release as a small "Finish the Update" window). A player can delete their copy after the first build, and uninstalling leaves nothing of the build on the PC. Read first: the `a.prepare` block at the end of `make_game.py`'s argument parsing, `recomplauncher.json`, and `release_manifest` in `scripts/builder_package.py`. The RecompLauncher paragraph in `docs/dev/reference/releases.md` says the same in words. ## Testing **Tested:** - **A real build, as RecompLauncher runs it**, on Windows 11 (VM, 8 threads, `LONGSHOT_JOBS=3`), from the builder laid out as the release packs it (`LongshotBuilder\tools`: this branch's sources, and `tools.lock`'s Python, llvm-mingw, cpm and third-party), with a player's own copy (Ocarina of Time for Switch 2, version 131072, as a `.nup`), `{install}` being the game's folder: - `make_game.py --prepare --game=<copy> --out {install}\Longshot --work {install}\recompdata\cache\work`: done in 24.1 minutes, exit 0, `image.bin` there, the work folder in `recompdata\cache\work` (0.77 GB), and `%LOCALAPPDATA%\LongshotBuilder` never made. - The copy deleted, then the same line without `--game` (what RecompLauncher runs with `keeps_copy`): it read the game files the folder kept, kept the translation and the compiled objects, and was done in 1.4 minutes, exit 0, `image.bin` there, `%LOCALAPPDATA%\LongshotBuilder` still not made. - That game folder, copied to a Windows 11 PC (the same CPU, the PC's own GPU) and started from it: its first start prepared the shaders and then 40,784 pipelines (about 9 minutes, as after any update), then the game ran, 6,480 frames presented at about 222 fps with no frame waiting on shaders or pipelines. - **RecompLauncher's own manifest check** (its developer tools, on its main with this `recomplauncher.json` in an installed release's layout): no unknown keys, no `keeps_copy` warnings, and the setup step it would run is `LongshotBuilder.exe --cli --prepare --game=<copy> --out {install}/Longshot --work {install}/recompdata/cache/work`, without the copy the same line minus `--game=`; `done` is `{install}/Longshot/image.bin`. - **The checks:** Bazzite (Fedora-based Linux, KDE), no GPU needed: `python3 -I -B tests/run_all.py --strict` (what `mise run test` runs) on `main` @ 068fb8eb and on this branch, from the same checkout. The same checks fail on both, and nothing fails only here: 688 passed, 165 failed, 17 skipped either way, the failures from what the VM lacks (most of them a toolchain this host doesn't have; `tests/test_make_game_cache.py` only because its Python has no `lz4`). Run again on Python 3.14 with `lz4`: `test_make_game_cache.py` 48 tests OK (46 on `main`), `test_make_game_prepare.py` 20 OK (17), `test_recomplauncher_json.py` 10 OK (5), and every other check that reads `builder_package.py`, `appimage.sh` or `recomplauncher.json` the same on both. New checks: `test_make_game_prepare.py` (`--game=` read as one argument; `--prepare` without a copy becomes an update of the game folder; without `--prepare` it doesn't), `test_make_game_cache.py` (a folder with only the kept files builds again from them, and one with none fails with the message), `test_recomplauncher_json.py` (`--game={game}`, `done`, `keeps_copy`, the work folder in the install folder on both builders, and each release's copy carrying its version with nothing else changed, in the zip and the AppImage). **Still to test:** - Windows 10 or 11, RecompLauncher 0.90 Beta 65 or newer: install a nightly with this, build from your copy, delete the copy, then bring in a newer nightly. Expecting Play to open Easy Setup at Build It Again, the build to run without asking for the copy, and nothing left in `%LOCALAPPDATA%\LongshotBuilder` after uninstalling (by hand). - Linux, the same with the AppImage (by hand). ## Measurements Nothing to measure: the builder's setup arguments, its RecompLauncher manifest and the release's copy of it. No change to what the game runs or how fast it builds (the rebuild above is the build's own cache at work). ## Risks - After this ships, every Longshot update asks RecompLauncher players to build again on their next Play, as the Longshot Launcher does: from what the folder kept, reusing the work folder. Players already set up are asked once on their first update past this, since `"2"` becomes the release's version. - A setup run without a copy on a folder that kept no game files now stops with "This game folder has no copy of the game files to build from." instead of the update error. Run by hand with a copy, nothing changes. - The work folder moves for RecompLauncher installs only: their first build after this compiles from scratch, and the old `~/.cache/longshot-builder` or `%LOCALAPPDATA%\LongshotBuilder` stays until deleted. Builds outside RecompLauncher keep the default work folder. - `keeps_copy` and `--game=` need RecompLauncher 0.90 Beta 65 or newer; an older launcher ignores `keeps_copy` and asks for the copy for the rebuild. - A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
RecompLauncher's prepare.keeps_copy runs the step again with every argument holding the player's copy left out, when the copy is gone and the game has to be built again. With no --game, --prepare now builds from the folder's .longshot_exefs and romfs, as --update does, so the player isn't asked for their copy. A folder without them stops with an error line, and the launcher then asks for the copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
RecompLauncher's prepare.keeps_copy runs the setup step again without --game when the player's copy is gone, so the game is built again from the files its folder kept (the builder side is the commit before). --game=<copy> is one argument, so a path with spaces stays whole, and image.bin in prepare.done tells the launcher the build is there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The builder's work folder (its compile cache) was in ~/.cache/longshot-builder or %LOCALAPPDATA%\LongshotBuilder, outside the game, so uninstalling the game in RecompLauncher left it behind. --work now puts it in {install}/recompdata/cache/work: recompdata is RecompLauncher's data folder for a game, and its backups and cloud saves leave cache folders out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
RecompLauncher keeps a game set up through an update and builds it again only when prepare.version changes. Longshot's stayed "2" in every release, so a player who updated kept playing the build of the release they first set up (LONGSHOT_NO_UPDATE_CHECK keeps the game's own question away). builder_package.py release_manifest writes the release's version into prepare.version, for the Windows zip and, through its manifest command, the AppImage. With keeps_copy the new build runs from the game files the folder kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(recomplauncher): the setup step's label fits a rebuild after an update too
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
1403024b39
A rebuild runs without the player's copy and takes minutes, so the label no longer says from your copy or 15 to 30 minutes outright.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • issue #1754 Install: — RecompLauncher update asks for a copy despite retained game files
  • issue #1674 Install: Updating game versions does not run the build — Windows update reportedly fails to run the build
  • PR #1000 fix(builder): RecompLauncher builds the game in its own install folder, not ~/Games — Prior manifest change moves RecompLauncher builds into install folder
Possibly related, for context: - issue #1754 Install: — RecompLauncher update asks for a copy despite retained game files - issue #1674 Install: Updating game versions does not run the build — Windows update reportedly fails to run the build - PR #1000 fix(builder): RecompLauncher builds the game in its own install folder, not ~/Games — Prior manifest change moves RecompLauncher builds into install folder
Merge branch 'main' into builder/recomplauncher-keeps-copy
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 9s
c499db2adc
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Xarishark changed title from WIP: feat(recomplauncher): an update builds the game again without the player's copy, and the build's work folder uninstalls with the game to feat(recomplauncher): an update builds the game again without the player's copy, and the build's work folder uninstalls with the game 2026-11-20 05:06:48 +00:00
HumanBean deleted branch builder/recomplauncher-keeps-copy 2026-11-20 15:59:18 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 9s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/Longshot!1840
No description provided.