WIP: fix(update): an update built from its own folder's game files reads them after the folder is renamed #248
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
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/LongshotLauncher!248
Loadingβ¦
Reference in a new issue
No description provided.
Delete branch "dyst/LongshotLauncher:fix/update-rename-paths"
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?
An update built from the game files in the version's own folder (its
romfsand.longshot_exefs) always fails. The build step renames the folder to the new version's name and then gives make_game.py the old folder's paths, which no longer exist, so every retry fails the same way (Longshot#2142, #240). #207 was meant to fix this: it movesjob.Pickedto the new paths, butRun()had already readjob.Pickedby then. That is why #2142's log shows "game files: in the renamed folder, read from β¦" and still fails.Based on #246 (main's CI fix), so its first commit is that one until #246 merges.
Summary
App/ViewModels/BuildStepViewModel.cs: the request make_game.py gets is made in a newRequest(), which renames the folder first and only then reads the game files.Run()calls it; nothing else inRun()changed.tests/launcher_app/Program.cs:UpdateFromOwnFoldermakes a fake instance inbuilds/nightly/nightly-100-β¦with its ownromfsand.longshot_exefs(text files, no game data). It updates it tonightly-101-β¦throughBuildJobandBuildStepViewModel.Request(), and requires the request to name the renamed folder's files and to build into that folder.Read first:
BuildStepViewModel.Request().Testing
Tested (Windows 11, .NET SDK 10.0.404):
tests/launcher_appbuilds and passes.romfspath, as #2142 reports.Still to test:
Risks
Low. The only change in order is that the rename now happens before the game files are read. A refused rename still fails the build before anything starts, with the same message.
π€ Generated with Claude Code
f9fb7bda2d552702457dA red-first source check for #2142's order (
tests/launcher_core)tests/launcher_app'sUpdateFromOwnFolderis a good behavioural test, but it can't be this PR's red-first test: it callsRequest(), which doesn't exist onmain. A source-order check can run on both heads β it fails onmaintoday, for the bug's reason, and passes here.Where:
tests/launcher_core/InstanceFolderChecks.cs, inserted beforestatic void InstanceFolderChecks()(line 93), and one call intests/launcher_core/Program.csafterInstanceFolderChecks().On
mainit fails (App/ViewModels/BuildStepViewModel.cs,Run()):var file = job.Picked!is at:175andif (!RenameFolder()) return;at:177β the read is the stale one. On this PR: the rename is:180, the read:181, andnew BuildRequest(file.Source, β¦):187, so it passes.Why not the literal regex.
Regex.IsMatch(build, @"RenameFolder\(\)[\s\S]*?var file = job\.Picked!")is green onmainas written: over the whole file the non-greedy span starts at the rename (:177) and runs toComplete()'s ownvar file = job.Picked!at:619. It never sees the order. Scoped to theRun()body it would be red, but it can't also be green here, where that body moved toRequest(). The index form anchors on the rename call and on the first read before theBuildRequestit feeds, soComplete()'s later read can't satisfy it, and neither can a comment that mentionsRenameFolder().Why it matters: this is the regression #207 missed β the rename and the read were both there, only in the wrong order. A text check is the only form that is red on
main; it keeps a later refactor ofRequest()/Run()from flipping the order back.The patch applies cleanly to both
mainand this PR's head5527024. I haven't pushed it to your branch β take it as your own commit if you want it (the three strings are the only thing to adjust if you rename the local).Not run here (no build slot on this PC): the red/green above is from the exact
IndexOfpositions in each head'sBuildStepViewModel.cs, not from a test run.β dazemc
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.