make_game: keep recovery copies until an install succeeds (RT-INSTALL-KEEP-RECOVERY) #2792
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2792"
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?
Imported from ubiquitarianism/leonida. Originally posted by aznohonza on 2026-11-30T21:24:51Z.
Claimed in the coordination issue as: RT-INSTALL-KEEP-RECOVERY
What and why
install_runtime()removed every.runtime-staging-*folder in the output folder before it started. A blocked rollback (IncompleteRollback) keeps its staging folder because it holds the only copies of the previous runtime files (<name>.old), so a retry that failed deleted those last copies before it had a chance to use them.The cleanup now runs only after a successful publish. A failed retry leaves the recovery folder in place; the next install that completes removes it.
Tested
Red then green, CPU only, no game files or GPU:
test_failed_retry_keeps_the_previous_recovery_folderintests/test_make_game_runtime_staging.py, which puts agta6rt.exe.oldin a stale staging folder and makes the next install fail while copying.maind8ca18240the new case fails: the stale folder and itsgta6rt.exe.oldare already gone when the copy fails.python -I tests/test_make_game_runtime_staging.pypass.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator rule)Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T21:30:35Z.
Verified by OreoFR on macOS 27.2.1, Apple M5, head
0fa9a51ab, main0b6e0e3bc. CPU only, no game files.MEASURED
tests/test_make_game_runtime_staging.py): 1 failed, 12 passed. The only failure is the newtest_failed_retry_keeps_the_previous_recovery_folder.tests/*make_game*file, main vs green: 530 → 531 passed, 5 skipped, and the same single failure on both sides (test_make_game_argparse.py::JobsHandlingTest::test_custom_jobs_forwarded_to_shaders). It also fails on main on this Mac, so this PR does not cause it.READ IN CODE
.runtime-staging-*sweep moved from beforemkdtempto after the successful publish and the removal ofstage. Every failure path still re-raises before the sweep, so a failed retry keeps the recovery folder. The currentstageis already gone when the sweep runs, so the glob only picks up older folders.ASSUMED
AI-assisted: Claude Code
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-30T22:13:39Z.
Independent native Windows check with a real open handle. Tested
0fa9a51abmerged ontob1f91c2f9(tree920307e69), Windows 11 and Python 3.13. I used a temporary installation with two synthetic runtime artifacts and an older.oldrecovery copy.CreateFileWheld the second destination with read sharing only whileinstall_runtime()attempted to publish.Both trees returned Windows error 32 and rolled back the first file. With
main, the older recovery copy was already gone. With the patch, it survived with identical bytes. After I closed the handle, a fresh install on both trees published both artifacts andgame_path.txt, removed staging directories, and preserved an unrelated settings file. All 13 stock runtime-staging tests passed on the patched tree. CPU and synthetic filesystem data only. AI-assisted with OpenAI Codex (GPT-6.2 Sol).Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T23:08:01Z.
Merging. Head
0fa9a51abmerges cleanly withmaineec86d0faand does not force a rebase of #2566. CI green on this head. Red/green by OreoFR (macOS) and a native Windows check with a real open handle by ecox982745, both on this head; I ran the make_game tests on main + PR (Windows, Python 3.14): the new test errors without the change and passes with it. The one other failure (test_make_game_argparse, 1 of 38) is the same on main. Merged by MoonEyes.AI-assisted (Claude Code).