fix(linux): prevent implicit game downgrades in the builder #2406
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2406
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/linux-downgrade-protection"
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
On Linux, the game-folder launcher could select an older installed Builder and offer to rebuild a newer game backwards, even offline. This keeps the recorded Builder associated with its game and prevents an implicit downgrade, while preserving confirmed version changes.
Fixes #2352. Claim. Scope coordinated with #2373; this does not redesign its launcher.
Technical changes
Validation
Current tested head
04ea74bb, rebased onto main34f05785. The worklist conflict preserves main’s damaged-file row and places this package’s row in score order. Focused version-admission tests pass again on Windows and Linux; Windows skips the POSIX executable-permission case, which passes on Linux. No fresh game rebuild or native Linux GUI run is claimed. Fresh hosted checks are separate exact-head evidence.Earlier validation evidence and limits
Tested
2dcca138on main7759a6f3:No game files, real downloads or builds were used. Native Linux GUI rendering, a real AppImage upgrade and gameplay remain untested. Unknown hashes/differing nightlies retain the existing ordering policy; version labels are not commit-ancestry proof. Behavior and limits.
This does what #2352 needs, and the consent handling is tight.
choose_modeno longer offers an older target as an update.older_oknow guards every rebuild entry point inbegin_update, before any page change or download, so the DLSS-change rebuild and the game's own--updatepath are covered too. The--allow-downgrade-fromhandoff only counts when the game version, the requested tag and the running tools all match, and it's cleared after one use. The newmanifest.tag != targetcheck also closes the case where an API/list lag silently rebuilt a newer target with the running, older tools. CI is green on04ea74bb, andtest_linux_downgrade,test_linux_update,test_linux_update_skipandtest_hookshot_launchpass locally.older_versionreturns False for anythingrelease_keycan't order (hashes,None), so nightlies and unversioned builds keep today's behaviour.question
builder/linux/hookshot-folder:30-33: flipping the order to preferbuilder=fixes the "older installed Builder opens a newer game" case, but it makes the reverse case worse. Take a folder built from an AppImage that is still on disk (say~/Applications/Hookshot-2.0.AppImage), while a newer Builder has since been installed under$XDG_DATA_HOME/hookshot/builderby another folder's update. Today that folder opens the newer installed Builder, which can rebuild it offline with the tools it already has. After this PR it opens the older AppImage. Offline, that one only knows its own version, so it shows Play. Online, it goes back throughlinux_update.installfor a version that is already installed. The downgrade guard inchoose_modealready stops the backwards rebuild whichever Builder opens, so would it be enough to pick the newer of the two? The installed one's tag is in$root/currentand the recorded one built the game named byversion=, so you can compare them without running either. Asort -Vin the wrapper would do, and that keeps the no-interpreter property you wanted. If you'd rather keep the simple rule, please mention the offline trade-off indocs/linux-builder-version-selection.md.minor: the new page and its 45 KB screenshot (
docs/images/linux-builder-newer-game.png, a Windows rendering of the Linux Tk launcher with made-up versions) document one launcher behaviour. A short paragraph in the existing Linux section ofdocs/development.mdor the readme, with the screenshot kept in the PR description, would be easier to keep current. Your call, not blocking.Thanks for the review and merge. The reverse case is a real trade-off of the accepted recorded-Builder priority: an older AppImage can offer only Play offline even when a newer Builder is installed separately, and online it may fetch tools already installed there. Opening the installed Builder and selecting the game explicitly remains available; the downgrade guard still applies whichever Builder opens it.
I would keep a newest-candidate policy coordinated with #2373, with stable/pre-release/nightly and unorderable versions decided explicitly. This PR protects rebuild admission; it does not automatically choose the newest available Builder.
github-sync referenced this pull request2026-11-12 06:22:54 +00:00