feat(recomplauncher): an update builds the game again without the player's copy, and the build's work folder uninstalls with the game #1840
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1840
Loading…
Reference in a new issue
No description provided.
Delete branch "Xarishark/Longshot:builder/recomplauncher-keeps-copy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
RecompLauncher builds Longshot from the player's own copy through the builder's
recomplauncher.json. Three things went wrong there:prepare.versionchanges. Longshot's stayed"2"in every release, and Play starts the game withLONGSHOT_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..longshot_exefsandromfs), and--update <folder>already rebuilds from them; the setup step just never used that.~/.cache/longshot-builderor%LOCALAPPDATA%\LongshotBuilder), since it lived outside the game.What this changes:
nx2/make_game.py:--preparewith no copy given (no--game,.nup,--romfs/--exefsor--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-placechecks, so they see the update mode.recomplauncher.json: the copy goes as one argument (--game={game}, so a path with spaces stays whole),image.binis the step'sdone(the launcher can tell the build is there), andkeeps_copyis on: with the copy gone, RecompLauncher runs the same line without--game.recomplauncher.json:--work {install}/recompdata/cache/work.recompdatais 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 leavecachefolders out. A rebuild reuses it, so it compiles only what changed.scripts/builder_package.pyrelease_manifest: each release's copy ofrecomplauncher.jsoncarries the release's version inprepare.version, in the Windows zip and (through itsmanifestcommand,scripts/linux/appimage.sh) in the AppImage. The file in the tree keeps"2"; nothing else of it changes.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.prepareblock at the end ofmake_game.py's argument parsing,recomplauncher.json, andrelease_manifestinscripts/builder_package.py. The RecompLauncher paragraph indocs/dev/reference/releases.mdsays the same in words.Testing
Tested:
LONGSHOT_JOBS=3), from the builder laid out as the release packs it (LongshotBuilder\tools: this branch's sources, andtools.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.binthere, the work folder inrecompdata\cache\work(0.77 GB), and%LOCALAPPDATA%\LongshotBuildernever made.--game(what RecompLauncher runs withkeeps_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.binthere,%LOCALAPPDATA%\LongshotBuilderstill not made.recomplauncher.jsonin an installed release's layout): no unknown keys, nokeeps_copywarnings, and the setup step it would run isLongshotBuilder.exe --cli --prepare --game=<copy> --out {install}/Longshot --work {install}/recompdata/cache/work, without the copy the same line minus--game=;doneis{install}/Longshot/image.bin.python3 -I -B tests/run_all.py --strict(whatmise run testruns) onmain@068fb8eband 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.pyonly because its Python has nolz4). Run again on Python 3.14 withlz4:test_make_game_cache.py48 tests OK (46 onmain),test_make_game_prepare.py20 OK (17),test_recomplauncher_json.py10 OK (5), and every other check that readsbuilder_package.py,appimage.shorrecomplauncher.jsonthe same on both. New checks:test_make_game_prepare.py(--game=read as one argument;--preparewithout a copy becomes an update of the game folder; without--prepareit 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:
%LOCALAPPDATA%\LongshotBuilderafter uninstalling (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
"2"becomes the release's version.~/.cache/longshot-builderor%LOCALAPPDATA%\LongshotBuilderstays until deleted. Builds outside RecompLauncher keep the default work folder.keeps_copyand--game=need RecompLauncher 0.90 Beta 65 or newer; an older launcher ignoreskeeps_copyand asks for the copy for the rebuild.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.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]>Possibly related, for context:
WIP: feat(recomplauncher): an update builds the game again without the player's copy, and the build's work folder uninstalls with the gameto feat(recomplauncher): an update builds the game again without the player's copy, and the build's work folder uninstalls with the game