fix(upgrade): stable builds on, and a smoother first start after the stable launcher #425
No reviewers
Labels
No labels
area/build
area/install
area/mods
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!425
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:fix/stable-upgrade"
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 coming from the stable v1.3.1 launcher would land on nightly game builds and hit several rough edges on their first start, so this makes that upgrade path ready for the v2 / Longshot v4 stable release.
Stable game builds on:
STABLE_BUILDS_AVAILABLE = true, so Stable is selectable and the default track again. Before this, stable launcher players were moved to Nightly without being told.Stable's shortcuts:
--playwith no version built yet opens the launcher instead of an error dialog. A shortcut,--playor--launchnaming one of stable's own builds plays the selected version (or opens the launcher before one exists) without a notice, from the window, the profile chooser and a running launcher alike; any other unknown folder still shows one. A damagedbuilds.jsonor a failed save import is logged and no longer stops every shortcut launch.Data folder stays where it is: stable's
buildsFolderis not carried over. Versions are small now, and moving profiles and saves to an SD card or second drive without asking put them at risk. A test checks that stable's builds folder and work folder move neither the data nor the cache.Cleanup: Storage → Previous launcher now covers:
stable's Windows
toolchains/<tag>: only the files listed in itsSetuprecord, and paths that point outside the folder are refused. Its records list every unpacked file (518 KB for v3.2.0 on Linux), so they are read up to 32 MiB, not the scan's usual 64 KiB;stable's Linux builders: the whole unpacked AppImage (its record lists only the tools inside it), but only when
toolchain.jsonis aLinuxrecord for that tag withdest: "."and anAppRun. Symlinks are never followed or removed, so a few bytes of them stay;stable's unfinished downloads (
toolchains/.downloads,<tag>.part);the make_game.py work parts
sa,lift-store,exefsandprobe;the
ngx,ffxandxessSDK folders, only from stable's own cache (next to its default work folder, which must exist, also when it is v2's cache as on the old Windows portable layout), never next to a work folder the player chose;the folders the cleanup emptied (up to each file's group, never a link).
stable's custom build-files folder, which v2 reuses as its cache (
home/stable_prefs.rs): itsobjcache,obj-store,sa,lift-store,exefsandprobethere, only when itssystem_headers.txtshows stable built there. v2'slongshot-builder/beside them is never touched.Stable's tools are offered under Previous launcher only. In the folder walks, folders named
mods,profiles,user,save,savesorbackupsand.nup/.nx/.savfiles are skipped; every file also goes through the protected-path and stable-game checks. Stable's work folder is no longer adopted as v2's cache unless an earlier v2 build has filled it (longshot-builder/inside it). On Linux, stable's default work folder (~/.cache/longshot/launcher/work) lies inside v2's cache (~/.cache/longshot). The overlap check used to hide it, so none of its files were ever offered. Now a previous work folder is excluded only when it is or contains the active cache, or lies in itslongshot-builder/files.Steam tile: stable's
steamTilesetting is now read in camelCase, as stable writes it. The tests used PascalCase before.NFC on Windows portable: a copy copies stable's tags from
%LOCALAPPDATA%\Longshot\nfcinto its ownnfc/once, beside any it already has (a tag of the same name is kept). Only top-level tags, as the game and stable read no subfolders. Each tag appears whole, andnfc-from-stable.jsonmarks the copy done, so one that failed is finished later even after the copy has tags of its own. One copy runs at a time, and a failure is logged and never stops play. Its changes, and "Delete all", never touch the installed launcher's tags.Tests: the running-game check's whole-PC scan sees no process in tests (tests that check detection name their process or list fakes). Any
longshot-builderrunning on the PC, or another test's fake, madeadding_the_same_release_twice_creates_distinct_instancesandcopies_verified_artifacts_without_sharing_files_or_profile_datafail.Tests: rebased on main (#427).
cargo testpasses (419, 2 ignored) in three parallel runs in a row with a real builder running on the PC, as do Clippy (-D warnings), fmt,tests/test_launcher_core.pyand Toolingtest_release.py. One earlier parallel run failedgame::process::tests::closing_output_readers_releases_pipes_with_a_live_writer: a pre-existing race where another test thread starting a process briefly holds the pipe open. It is not in code this PR touches. New tests cover stable's tools (Windows, with a record over 64 KiB, and Linux), downloads, work folder (separate, and reused as the cache) and SDK cleanup, the portable NFC copy (merge, flat, kept names), and stable settings that must not move the data folder.Tested on Linux with the real v1.3.1 AppImage, in a separate home seeded with a copy of real v1 data, on a virtual display. v1.3.1 offered Nightly 277, then downloaded, checked, self-checked and swapped it in, and v2 started. The PR build then opened the launcher window from
--playinstead of an error, and defaulted to Stable. The build step shows "No stable release has a Longshot builder" until Longshot v4 stable exists, so merge after it. (That run predates the later changes here.)Tested on Windows 11 portable by llun (see the comment): the upgrade,
--play, data folder, save import, NFC copy, the cleanup (13,827 tool files, 1.2 GB, with outside paths refused and saves, mods and a junction's target kept) and--rollbackpassed. The two gaps found there (SDKs beside the reused cache, 658 empty folders) are fixed.Reviewed three times by separate agents against v1.3.1's sources. The self-update hand-off (file names,
SHA256SUMS.sigkey,--self-checkline, tag format) and the save import (every v1 save location on Windows installed and portable, Linux and the Deck; nothing overwritten; safe to repeat) check out. That review also found problems in moving the data and cache folders, which every player can hit and this PR does not touch; they belong in their own issues.Not tested: Windows, a real Steam Deck, the cleanup in the window, and rollback.
🤖 Generated with Claude Code
Possibly related, for context:
580fde108cf48bfa5b8d@review
Recommendation: Request changes. The previous launcher's work folder can still become the active cache, and failed or nested NFC tag imports do not behave as promised. The stable builder also needs to be released before the new default can work.
The change makes Stable the default build track, improves old shortcuts, adds cleanup for previous-launcher files, and copies Windows portable NFC tags. It reduces upgrade friction, but the cache migration and NFC cases need correction.
Blocking (1): must change before merging.
src/home.rs:381: The old work folder can still be adopted through the stable preferences import after this check. (more on the line) Do: Stop importing the stable work setting as the active cache, and test the complete startup path with an existing stable work setting and no longshot-builder directory.Should fix (2): not blocking, but worth doing before merging.
src/players/nfc.rs:34: A failed NFC copy is not necessarily retried once the portable folder is created by another operation. (more on the line) Do: Track completion separately from directory existence and retry or safely merge the installed tags after a failed copy without overwriting portable tags.src/players/nfc.rs:57: Imported tags in subfolders are copied but are not listed by the launcher. (more on the line) Do: Make imported nested tags accessible in the NFC UI, including selection and deletion, or import them into the supported flat layout with collision handling.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1, L2 and L3.Checks: Still running: 5 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven. The author reports a real Linux v1.3.1 upgrade reaching the launcher and defaulting to Stable, but that run predates later changes and no compatible stable builder was available to complete a build. This is not a performance change.
Other systems: The cleanup and shortcut changes affect Windows and Linux, including the Steam Deck; the NFC migration is Windows portable only. The author reports no Windows, real Deck, cleanup-window or rollback run. The NFC copy retains subdirectories, but the launcher lists only top-level tags.
Switches: STABLE_BUILDS_AVAILABLE changes from false to true. Stable becomes the default on supported prebuilt CPUs, but it cannot build until Longshot v4 stable is published. No environment variables are added or changed.
Reviewed:
f48bfa5b8dagainst08fa1329e5: Read the repository rules, commit log and diff, and rechecked the changed hunks and their immediate callers. Read src/players/nfc.rs and src/game/registry.rs in full; inspected relevant portions of the other changed Rust files, their tests, storage execution, preferences and process handling. The larger changed files and their surrounding modules were not all read in full; recorded test runs were reviewed from the PR description. No review checklist or pull request template was present.; nothing run (a code review).Checked and fine:
Testing: No code, scripts or tests were run, as requested. The PR reports four passing parallel cargo test runs and passing lint, formatting and Python suites; its real Linux upgrade run predates later changes.
Overlaps and merge order: None identified from the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -379,3 +379,3 @@}let old_work = previous_work(control);if settings["work"].as_str().is_none_or(str::is_empty) && populated(&old_work) {// Only a cache an earlier build of this launcher filled. The stable launcher's own make_game.pyL1 (blocking): The old work folder can still be adopted through the stable preferences import after this check.
When: When stable settings contain an existing absolute work path, preferences::bind calls link_from_stable, which writes that path into the new settings even if it contains only stable's files. The active cache then moves there and stable_work_folders excludes it from Previous launcher cleanup.
Do: Stop importing the stable work setting as the active cache, and test the complete startup path with an existing stable work setting and no longshot-builder directory.
@ -22,0 +31,4 @@let _one = ADOPTING.lock().unwrap_or_else(std::sync::PoisonError::into_inner);if !disk::is_dir(&own)L2 (should fix): A failed NFC copy is not necessarily retried once the portable folder is created by another operation.
When: If copying an installed tag fails, folder returns the absent portable path. Adding a tag later creates that path; subsequent calls see an existing nfc directory and never retry the installed tags, leaving them unavailable in the portable copy.
Do: Track completion separately from directory existence and retry or safely merge the installed tags after a failed copy without overwriting portable tags.
@ -29,0 +54,4 @@if disk::is_dir(&part) {fs::remove_dir_all(&part).with_context(|| format!("removing {}", part.display()))?;}for file in files(from, true)? {L3 (should fix): Imported tags in subfolders are copied but are not listed by the launcher.
When: For an installed tag such as nfc/amiibo/link.bin, adopt preserves amiibo/link.bin, while refresh_tags calls files with recursive set to false. The copied tag is absent from the launcher's NFC list.
Do: Make imported nested tags accessible in the NFC UI, including selection and deletion, or import them into the supported flat layout with collision handling.
70a5f617270d796bf93dThanks. All three are fixed in
0d796bf9.home/stable_prefs.rs,docs/saves.md): a player who put it on a big drive keeps it there. What was wrong is that stable's own files in it were hidden as the active cache. Previous launcher now offers itsobjcache,obj-store,sa,lift-store,exefsandprobethere, only when stable'ssystem_headers.txtshows it built there, and neverlongshot-builder/. Test:stable_parts_in_its_reused_build_files_folder_are_previous_launcher_files.nfc-from-stable.jsonin the portable home). Until it exists, every call copies the missing tags beside the portable copy's own, never over one of the same name.NfcTags.cs: "no subfolders"), so a nested one was never usable.L4 and L5 (Windows, Linux and Deck runs with v4 stable) stay open: they need Longshot v4 stable first.
🤖 Generated with Claude Code
@review
Recommendation: Request changes. The stable preferences import can still adopt the old work folder as the active cache, which L1 asked to prevent. The completed upgrade and cleanup also await platform runs.
The change prepares the stable-launcher upgrade path, improves shortcut handling and cleanup, and copies portable NFC tags. The latest commit makes stable files in a reused cache eligible for cleanup, but does not prevent that cache from being adopted.
Blocking (1): must change before merging.
src/home.rs:381: The old work folder can still be adopted through the stable preferences import after this check. When: When stable settings contain an existing absolute work path, preferences::bind calls link_from_stable, which writes that path into the new settings even if it contains only stable's files. The active cache then moves there and stable_work_folders excludes it from Previous launcher cleanup. Do: Stop importing the stable work setting as the active cache, and test the complete startup path with an existing stable work setting and no longshot-builder directory.Nits (1): optional.
docs/paths.md:77: The NFC bullet interrupts the paths table and replaces the launcher-instance.json entry. (more on the line) Do: Restore the launcher-instance.json row and put the NFC explanation outside the table.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1 and L6.Since the last review (on
f48bfa5b8d)Resolved: L2 (A failed NFC copy is not necessarily retried once the portable folder is created by anothe…); L3 (Imported tags in subfolders are copied but are not listed by the launcher.)
Still open: L1 (The old work folder can still be adopted through the stable preferences import after this…); L4 (The completed stable upgrade and cleanup have not been exercised on Windows.); L5 (The cleanup and completed stable build have not been exercised on Linux or a real Steam De…)
New: L6 (The NFC bullet interrupts the paths table and replaces the launcher-instance.json entry.)
Checks: Still running: 5 checks.
Also noticed (1; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven: the reported Linux upgrade run predates later changes and could not complete a stable game build before Longshot v4 stable exists.
Other systems: The upgrade and cleanup affect Windows, Linux and Steam Deck storage paths; completed runs on those systems remain outstanding. Portable NFC adoption is Windows-specific.
Switches: STABLE_BUILDS_AVAILABLE changes from false to true; the description says to merge after Longshot v4 stable is available.
Reviewed:
0d796bf93dagainst08fa1329e5: Read the repository rules, the change since the ledger, NFC adoption and stable preference import. Skimmed the full pull request diff and recorded test results; the other changed code files were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build, execute project code or run tests were used. The author reports passing tests and a Linux upgrade run; CI is still running.
Overlaps and merge order: None identified from the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -75,3 +75,3 @@| `versions/<instance>/.longshot-launcher-owner` | Where ownership is recorded separately, the token that matches the launcher's `version-locations/` entry. The launcher checks both before treating the folder as one it owns || `versions/<instance>/builds/<build>/` | The generated game executable, renderer, resources, build metadata and game logs. A build can also have local `cache/` and `mods/` folders || `versions/<instance>/launcher-instance.json` | Written by earlier launchers for `--profile-id`. The current launcher does not write it. Builders still read it for legacy shortcuts that use `--profile <id>` |- A Windows portable copy copies the NFC tags stable kept in `%LOCALAPPDATA%\Longshot\nfc\` into its own `nfc/` once, beside any it already has (a tag of the same name is kept); `nfc-from-stable.json` marks the copy done. Its changes stay its own.L6 (nit): The NFC bullet interrupts the paths table and replaces the launcher-instance.json entry.
When: A reader looking up legacy launcher-instance.json no longer finds its documented purpose, and the NFC bullet appears inside the table.
Do: Restore the launcher-instance.json row and put the NFC explanation outside the table.
Tested on Windows 11 Pro (26300), portable, in a separate test home. v1.3.1's portable zip (SHA-256 checked) switched to Nightly and swapped in nightly-286; then this PR's head (
0d796bf, gnullvm,+crt-static) in its place.Passed:
--playwith no version opens the launcher; Stable is the default (no stable builder yet, as expected); data folder not moved; stable save imported; NFC tag copied once from%LOCALAPPDATA%\Longshot\nfcwithnfc-from-stable.json; Previous launcher cleanup removed stable's v3.2.0 tools (13,827 files, 1.2 GB), its unfinished downloads and the six work parts, and refused record paths outside the folder (..\,C:, absolute,\\?\) while keeping a.sav, amodsfolder and a junction's target;--rollbackbrought v1.3.1 back on its own files.Found: on the old Windows portable layout v2's cache is stable's own
work, songx-sdk/ffx-sdk/xess-sdkbeside it are never offered (the SDKs are only added for a work folder not in use). Also 658 empty folders stay undertoolchains/v3.2.0after cleanup.Not tested: the installed layout, a shortcut naming a stable build.
🤖 Generated with Claude Code
Thanks @llun, that run covered most of what was untested. Both findings, and L6, are fixed in
59288317:ngx-sdk/ffx-sdk/xess-sdkbeside it are now offered too. Test:stable_sdks_beside_its_default_work_reused_as_the_cache_are_cleaned_and_folders_go.launcher-instance.jsonrow. It's back, and the NFC note is now only under "Existing locations".L1: I'm keeping the import on purpose. Reusing stable's custom build-files folder as the cache is the documented behaviour (
home/stable_prefs.rs,docs/saves.md): a player who put it on a bigger drive keeps building there. What made it a problem was that stable's files in it could never be cleaned, and that is fixed: they're offered under Previous launcher when stable'ssystem_headers.txtshows it built there, andlongshot-builder/is never touched. A maintainer can overrule this.Still untested: the Windows installed layout and a shortcut naming a stable build.
🤖 Generated with Claude Code
@review
WIP: fix(upgrade): stable builds on, and a smoother first start after the stable launcherto fix(upgrade): stable builds on, and a smoother first start after the stable launcherRecommendation: Request changes. The stable preferences import can still adopt the old work folder, contrary to the open cleanup and migration requirement. The completed stable build also awaits platform runs once Longshot v4 stable is available.
The change makes Stable the default, improves shortcuts and portable NFC migration, and offers previous-launcher build files for cleanup. It preserves useful preferences and reduces upgrade friction, but still carries the old work folder into the active cache through the stable preferences import.
Blocking (1): must change before merging.
src/home.rs:381: The old work folder can still be adopted through the stable preferences import after this check. When: When stable settings contain an existing absolute work path, preferences::bind calls link_from_stable, which writes that path into the new settings even if it contains only stable's files. The active cache then moves there and stable_work_folders excludes it from Previous launcher cleanup. Do: Stop importing the stable work setting as the active cache, and test the complete startup path with an existing stable work setting and no longshot-builder directory.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1.Since the last review (on
0d796bf93d)Resolved: L6 (The NFC bullet interrupts the paths table and replaces the launcher-instance.json entry.)
Still open: L1 (The old work folder can still be adopted through the stable preferences import after this…); L4 (A completed stable build remains untested on Windows.); L5 (The cleanup and completed stable build have not been exercised on Linux or a real Steam De…)
Checks: Still running: 5 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven for the completed stable upgrade: the reported Linux handoff and Windows portable upgrade, cleanup and rollback passed, but a Longshot v4 stable build was not available for an end-to-end run.
Other systems: Windows portable cleanup and rollback were reported passing; the installed Windows layout and a shortcut naming a stable build remain untested. Linux handoff was tested before later changes; cleanup and a completed stable build remain untested on Linux and a real Steam Deck.
Switches: STABLE_BUILDS_AVAILABLE changes to true, making Stable the default. It requires a Longshot v4 stable builder to be available before release.
Reviewed:
5928831710against08fa1329e5: Read the repository rules, the diff since the ledger head, the relevant work-folder migration and cleanup paths, and the reported runs. Skimmed the overall diff and tests; did not read every changed code file in full. The named review checklist and pull request template were absent.; nothing run (a code review).Checked and fine:
Testing: No commands that build or execute project code were run. The author reports passing tests and lint; CI is still running.
Overlaps and merge order: none found
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
Recommendation: Request changes. The stable preferences import can still adopt the old work folder without a populated longshot-builder directory. The cleanup change does not prevent that adoption.
The PR makes Stable the default and improves the upgrade path, shortcut handling, cleanup and portable NFC migration. It also adds migration and cleanup complexity.
Blocking (1): must change before merging.
src/home.rs:381: The old work folder can still be adopted through the stable preferences import after this check. When: When stable settings contain an existing absolute work path, preferences::bind calls link_from_stable, which writes that path into the new settings even if it contains only stable's files. The active cache then moves there and stable_work_folders excludes it from Previous launcher cleanup. Do: Stop importing the stable work setting as the active cache, and test the complete startup path with an existing stable work setting and no longshot-builder directory.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1.Since the last review (on
5928831710)Still open: L1 (The old work folder can still be adopted through the stable preferences import after this…); L4 (A completed stable build remains untested on Windows.); L5 (The cleanup and completed stable build have not been exercised on Linux or a real Steam De…)
Checks: Still running: 5 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven: the reported Linux and Windows portable runs exercised parts of the upgrade, but a completed stable build still requires Longshot v4 stable.
Other systems: The Windows installed layout and a shortcut naming a stable build remain untested. Cleanup and a completed stable build also need Linux and real Steam Deck runs.
Switches: Stable builds are enabled by default; the release depends on a stable Longshot builder becoming available.
Reviewed:
5928831710against08fa1329e5: Read AGENTS.md, CONTRIBUTING.md, src/home/stable_prefs.rs and the relevant src/home.rs diff and references. Other changed files and the full PR diff were not reread on this check.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run. The author reports passing tests and a Linux upgrade run; llun reports a Windows portable run. CI is still running.
Overlaps and merge order: none found
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as HumanBean took it out of WIP. Nothing was run; a maintainer decides.