feat(build): a completely cold build, for a build that keeps failing #179
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!179
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/LongshotLauncher:feat/cold-build"
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?
Players whose build keeps failing, or whose game misbehaves after a build, had no way to rule out something left over from an earlier build. A completely cold build starts from nothing earlier builds kept.
Builds on #178 (Free up space says what it deletes), now merged; it reuses its deletion code.
What changed
Step 2's Advanced has a "Completely cold build" switch, for that build only (
BuildJob.Cold). It works for a first build, a rebuild, an update or going back.The problem page after a failed build offers Try a completely cold build (unless the build was already cold). It opens step 2 with the switch on and Advanced open, so the player reads what it deletes before starting.
Before make_game.py starts, a cold build (
ColdBuild.Clear):Seedsays so in the log);LONGSHOT_ROMFS_FROMnot set), so the .nup is read again.The build page shows "Deleting what earlier builds kept" on its first row meanwhile, and the log says how much went.
Never while Longshot runs. Step 2 refuses with a toast. If the game starts in between, the build stops on the problem page and nothing is deleted.
Saves, settings and mods are never touched.
The bug report's settings line ends with
, cold build. It's fixed text, no free text. I put it there rather than in the report'skind, which says what was built (first build, update, go back, rebuild), not how.README describes it.
Screenshots
New scenes
build-failedandsettings-coldintools/screenshots: attached in the first comment. Before and after, againstmain: #179 (comment)Tested
python -I tests/test_launcher_core.py: 1543 checks passed. New checks: a cold build deletes nothing while Longshot runs; otherwise it deletes the build files, stores, caches and notes and keeps the player's own files in both folders.python -I tests/test_release.py: 37 tests OK.dotnet build App -c Release: 0 warnings, 0 errors.Not done
main, and the check only lists them.mise run ci:smoke: mise isn't installed on this PC.Screenshots (tools/screenshots: build-failed, settings-cold): the problem page offering a completely cold build, and step 2's Advanced with it on.
Possibly related, for context:
Screenshots: before and after
Drawn with
tools/screenshots(headless, the same scene and window on both sides): before frommain@321a9e1, after from this branch.mainhas no scene for either screen, so the before shots use temporary copies of this PR's two scenes without the cold build (build-failed, and step 2 with Advanced open), not committed.The problem page after a failed build
Before
After: Try a completely cold build, beside Build again.
Step 2: Advanced
Before
After: the completely cold build switch, ticked, with what it deletes and what it costs.
Before and after screenshots added.
WIP: feat(build): a completely cold build, for a build that keeps failingto feat(build): a completely cold build, for a build that keeps failingRebased onto main (
7a4a61e), now that #178 is merged: this PR is its own commit only. Launcher checks (1614) and release tests pass; the app builds with 0 warnings.639fc820a524d97059c9A code review, posted as a comment: the PR merged before it, and Forgejo reviews only open PRs.
Verdict: Request changes. The PR is already merged, so these need a follow-up before the next stable. Two things go wrong for exactly the players this is for. "Build again" after a failed cold build quietly runs another cold build, which throws away everything the failed attempt built. And a cold update or rebuild deletes the installed version's shader caches and pipeline notes before it starts, with no way to get them back if that build then fails or is stopped.
For a player whose build keeps failing, this gives a one-build "start from nothing" switch, offered from the problem page. That's a real gain and a small, well-placed change: it reuses Free up space's deletion, and the deletion itself is tight. The two gaps are in what happens around the deletion, not in what it deletes.
Reviewed:
24d97059against7a4a61e7(the merge base):Core/ColdBuild.cs,App/ViewModels/BuildStepViewModel.cs(Run, Seed, ClearForCold, Stop, Fail, ProblemViewModel),SettingsStepViewModel.cs,WizardViewModel.cs,ProblemView.axaml,SettingsStepView.axamland the new check inShaderCacheChecks.cs, all read in full where they changed. Also read what they rely on:Disk.FreeWork/WorkBytes/WorkParts,ShaderCaches.Clearable/Clear,BuildRegistry.FolderOf, the single-instance lock inApp/Program.cs, and the home's build start after 180. I only skimmed the README paragraph and the screenshot scenes. Nothing was run (a code review). The squash onmain(8594b470) has the same code as the PR head.Fixed in this review: nothing.
Checked and fine:
Disk.WorkParts. The build files folder itself and the player's own files in it stay. A link is removed, never followed.cache/files named as caches. A linkedcache/is skipped, anduser/savestays (the new check covers this).LONGSHOT_ROMFS_FROM), other versions' game folders, or the launcher's settings.ColdBuild.Clear, before anything is deleted.InstanceLock), and one build job at a time, so a second launcher or a parallel build can't have its files deleted from under it.Seedis skipped, so no caches move from the replaced build.Path.CombineandDeleteTree, so Windows and Linux are the same., cold buildis fixed text.Blocking (for a follow-up before stable)
App/ViewModels/BuildStepViewModel.cs:819: Build again repeats the cold build.BuildJob.Coldis never cleared, andRetryCommandstarts a newBuildStepViewModelon the same job. So after a cold build fails at, say, 70% compiling, "Build again" deletesobjcache,saand both stores again and starts from zero. That's another first-build-length run, with no step 2 text in front of the player, and it contradicts the same page's "Then build again: what was built so far is kept, so it starts where it stopped." "For this build only" should mean the clearing happens once. A fix: onceClearForColdhas succeeded, mark the job as cleared (keepColdfor the report line and theSeed/romfs skip), and skip the clearing on a retry. A check should cover a retry after a failed cold build.Core/ColdBuild.cs:17: The playable version loses its caches and notes when the cold build doesn't finish. Updates, going back and rebuilds go into the build's own folder (BuildRegistry.FolderOf), soShaderCaches.Clear(job.InstallDir, notes: true)deletes the caches and pipeline notes of the version the player still has listed and plays. And it does so before make_game.py starts. If the cold build then fails (likely, since it's offered for builds that keep failing) or is stopped, that version prepares all its shaders again at its next start. It also stays without the shipped pipeline list until some build succeeds. Your ownClearablecomment says that means it prepares less ahead until then. The warm update protects exactly this withSeed/Undo, and the cold path bypasses it. Neither the switch's text ("Your saves and settings stay") nor the problem page ("Your other versions … are not touched") says so. A fix: move the caches and notes aside rather than deleting them, put them back when the build doesn't finish (asShaderCaches.Undodoes), and delete them once it does. At least, say inColdDescthat the version you play now loses its prepared shaders even if the build doesn't finish.Suggestions
SettingsStepViewModel.cs:386: say how much goes, as Free up space does (Disk.WorkBytes(work)plusShaderCaches.ClearableBytes(game, notes: true)), e.g. "Deletes 14 GB". Right now the player doesn't know what they lose until it's in the log.BuildStepViewModel.cs:339: Stop during "Deleting what earlier builds kept" sends the player home, but the deletion carries on. If it then fails,Failnavigates to the problem page anyway, andSummarizeruns a second time (cancelled, then failed). Checkcancel.IsCancellationRequestedbefore failing.Testing:
ColdBuild.Clearhas a game-free check (it deletes nothing while Longshot runs, and otherwise keeps the player's files). Nothing checksBuildJob.Coldthrough the view models: retry, theSeedskip, the romfs skip. The author ran the launcher checks and the release tests, and built the app. No cold build ran end to end (no game dump), and CI's compile-and-test job was skipped (manual dispatch). For the follow-up, one real cold update that is stopped partway would show both blocking points.Overlaps and merge order: 180 (the home's one button) merged first, and this one was squashed after it with no conflict. 180's button still goes through
StartWizard, so step 2 and its Advanced, where this switch lives, are unchanged. The two don't touch the same UI.