fix(saves): the save script's Linux backups go beside the saves, where the launcher keeps its own #1473
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1473
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:fix/linux-backup-folder"
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?
Type: fix · Risk: low · Tested on: Windows 11 and Linux (Ubuntu 24.04 under WSL), game-free · Needs: none
TL;DR
On Linux and the Steam Deck, the save script put its backups in a different folder from the launcher, so the launcher never saw them and a player looking for a backup could think it was gone. This PR makes the script back up into the launcher's folder, beside the saves. Backups already made stay where they are, and Windows is unchanged. New tests check the folder on Linux and Windows, and a copy's backup landing there.
Breakdown
scripts/longshot_saves.py, and anyone who later needs one of those backups back.~/.local/share/oot-save-backups, while the launcher has used~/.local/share/longshot/save-backupsince LongshotLauncher#80.~/.local/share/longshot/save-backup, the same folder as the launcher's.%LOCALAPPDATA%\Longshot\oot-save-backups, already the launcher's),--backup-dir, the copies themselves, and every backup already on the disk (nothing is moved or deleted).tests/test_longshot_saves.py, passing on Linux and Windows (the 3 Linux ones fail onmain's script); the rest of that file is unchanged on Linux (one error thatmainhas too).oot-save-backupsfolder too (LongshotLauncher#188), and #1428's game backups using the same folder.Why
On Linux, save backups are split between two folders, and the launcher lists only one: the launcher writes
$XDG_DATA_HOME/longshot/save-backup, while this script (and #1428's game backups) write$XDG_DATA_HOME/oot-save-backups. A player restoring a backup from the launcher (LongshotLauncher#182), or following docs/saves.md, doesn't see the script's. Windows has one folder for all of them already.See MagicBeanDev/LongshotLauncher#188 (found in the review of MagicBeanDev/LongshotLauncher#182 (comment)).
How to reproduce
Seen on: Linux or Steam Deck, any GPU
Settings and switches: defaults
Steps:
python -I scripts/longshot_saves.py import lichii(or any import or export) with no--backup-dirExpected: the backup in the launcher's backups folder,
~/.local/share/longshot/save-backup/Actual: the backup in
~/.local/share/oot-save-backups/, which the launcher doesn't readWhat changed
The script's default backup folder on Linux is the launcher's. Nothing else in the copy changes, and the script never reads or lists backups, so there is nothing to read from the old folder.
default_backup_dir()inscripts/longshot_saves.pyreturns$XDG_DATA_HOME/longshot/save-backupon Linux (Windows unchanged), with the module docstring saying where older backups are.docs/saves-script.md(where a copy backs up, and where to delete old ones) anddocs/saves.md's table row for Linux.BackupFolderclass intests/test_longshot_saves.py: the Linux default with and withoutXDG_DATA_HOME, the Windows default unchanged, and an import with no--backup-dirbacking up intolongshot/save-backupwhile an old backup inoot-save-backupsstays exactly as it was.Measurements
Nothing to measure: a script's default folder and its tests, nothing the game runs.
Flags and settings
None.
Testing
Tested:
python3 -I -B tests/test_longshot_saves.py: 67 tests, the 4 new ones pass; one error,Copy.test_old_save_that_cannot_be_deleted(a permission test), also fails onmainon that PC (checked in a cleanmainworktree).tests/test_longshot_saves.py BackupFolder). The rest of that file is Linux-only (RUN_ALL_SKIPon Windows).python -I -B tests/run_all.pyon Windows: 546 passed, 65 failed, 123 skipped (main @6438c2efon the same PC: 544 passed, 67 failed). No check fails here that passes on main: every failure is one main has too (this PC has no llvm-mingw, Vulkan headers or spirv-val, which most of them need), and test_gpu_hang_watch and test_mesh_args_cleanup failed on main's run only (they vary between runs).tests/test_longshot_saves.pyis skipped on Windows by its own RUN_ALL_SKIP, so it ran on Linux above.Not tested: a real copy on a Steam Deck; the tests use temp folders standing in for the data folder.
Must be tested: None.
Risks
What could break: a script or habit that expects new backups in
~/.local/share/oot-save-backupson Linux; the docs now name the new folder.Turning it off:
--backup-dir ~/.local/share/oot-save-backupsfor one copy, or revert the commit.Compatibility: Nothing changes for saves; backups already on the disk stay where they are. On Linux, new script backups appear in the launcher's backups folder.
Issues
See MagicBeanDev/LongshotLauncher#188
Related: #1428 (the game's own backups, WIP, also writes
oot-save-backupson Linux) and #1397 (the script's Windows save folder; it edits the docstring lines just above this one, so whichever merges second has a one-line rebase).Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.WIP: fix(saves): the save script's Linux backups go beside the saves, where the launcher keeps its ownto fix(saves): the save script's Linux backups go beside the saves, where the launcher keeps its ownView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.