[PR #1446] make_game: stage the runtime install and publish it all or none (RT-249) (OLD-9937) #1475

Open
opened 2026-11-26 20:21:23 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1446
Author: @LouisRiverstone
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: carry-old-9937


📝 Commits (5)

  • d516872 make_game: stage the runtime install before replacing the old files (RT-249)
  • 354142d Merge main into carry-old-9937
  • 860291a install_runtime: keep the old file when its own restore fails, drop stale staging folders, build the BCPack history under shaders/ (review of #1446)
  • d1ec021 Merge remote-tracking branch 'ubq/main' into HEAD
  • 6a72150 install_runtime: keep the old file when its own restore fails, drop stale staging folders, build the BCPack history under shaders/ (review of #1446)

📊 Changes

2 files changed (+357 additions, -27 deletions)

View changed files

📝 make_game.py (+115 -27)
➕ tests/test_make_game_runtime_staging.py (+242 -0)

📄 Description

Claimed in the coordination issue as: OLD-9937 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148463379)

Replaces the carried-over draft #204. I'm the original author of old upstream PR 9937.

What and why

RT-249. The runtime stage of make_game.py copied the files into --out one by one. A failure partway through (disk full, an interrupt, or on Windows a destination file held open by an antivirus scan or another program) could leave a new gta6rt.exe next to an old gta6rt_tls_host.dll.

The stage now writes every file, including game_path.txt, shader_path.txt and gta6rt.sh, to a staging folder inside --out, on the same filesystem. Only once everything is there does publish() move the files into place, all or none: each old file is first moved aside, and any failure puts back the files already published. If the rollback itself is blocked, IncompleteRollback keeps the staging folder, which then holds the old copies as <name>.old, and the error says where they are. On main the stage already refuses an --out where one of the runtime file names is a directory, and that check is kept; it runs before the build.

tests/test_make_game_runtime_staging.py (new, 12 tests) covers a failed copy, a failed game_path.txt write, a failed publish with and without an old copy, a blocked rollback, a missing output folder, a --runtime-build that is the output folder itself, shader_path.txt staged with the rest, and a restore that fails for the file being published, stale staging folders removed by the next install, the BCPack history path, and a successful run that leaves no staging folder.

The old branch's final diff, applied on current main as one commit. It applied cleanly.

Tested

  • python -I tests/test_make_game_runtime_staging.py: 9 tests OK on Linux (Python 3.14.4) and on Windows 11 (Python 3.11).
  • The other 23 tests/test_make_game*.py files pass on Linux. On Windows 11 with Python 3.11, seven of them fail, and they fail the same way on main, so the cause is that environment and not this change.
  • python -m compileall -q make_game.py tools tests: OK.

GPUs tested: n/a

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator rule changes)

On Windows a running gta6rt.exe can be renamed, so it does not block the install; its old copy may stay in a .runtime-staging-* folder, which the next install removes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1446 **Author:** [@LouisRiverstone](https://github.com/LouisRiverstone) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry-old-9937` --- ### 📝 Commits (5) - [`d516872`](https://github.com/ubiquitarianism/leonida/commit/d516872f9bb858d7e3ac3f0cb7fdabc9643738d5) make_game: stage the runtime install before replacing the old files (RT-249) - [`354142d`](https://github.com/ubiquitarianism/leonida/commit/354142d901752c2e0fd5b4a72b91f3e9487a020f) Merge main into carry-old-9937 - [`860291a`](https://github.com/ubiquitarianism/leonida/commit/860291a08389dbcd4f490730851e38f84e2c0c0b) install_runtime: keep the old file when its own restore fails, drop stale staging folders, build the BCPack history under shaders/ (review of #1446) - [`d1ec021`](https://github.com/ubiquitarianism/leonida/commit/d1ec0218e50e8518363cd8c560569c54d737d24f) Merge remote-tracking branch 'ubq/main' into HEAD - [`6a72150`](https://github.com/ubiquitarianism/leonida/commit/6a721500ae7e39772be6acb86ff3500eb6327d5c) install_runtime: keep the old file when its own restore fails, drop stale staging folders, build the BCPack history under shaders/ (review of #1446) ### 📊 Changes **2 files changed** (+357 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `make_game.py` (+115 -27) ➕ `tests/test_make_game_runtime_staging.py` (+242 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9937 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148463379) Replaces the carried-over draft #204. I'm the original author of old upstream PR 9937. ### What and why RT-249. The runtime stage of `make_game.py` copied the files into `--out` one by one. A failure partway through (disk full, an interrupt, or on Windows a destination file held open by an antivirus scan or another program) could leave a new `gta6rt.exe` next to an old `gta6rt_tls_host.dll`. The stage now writes every file, including `game_path.txt`, `shader_path.txt` and `gta6rt.sh`, to a staging folder inside `--out`, on the same filesystem. Only once everything is there does `publish()` move the files into place, all or none: each old file is first moved aside, and any failure puts back the files already published. If the rollback itself is blocked, `IncompleteRollback` keeps the staging folder, which then holds the old copies as `<name>.old`, and the error says where they are. On `main` the stage already refuses an `--out` where one of the runtime file names is a directory, and that check is kept; it runs before the build. `tests/test_make_game_runtime_staging.py` (new, 12 tests) covers a failed copy, a failed `game_path.txt` write, a failed publish with and without an old copy, a blocked rollback, a missing output folder, a `--runtime-build` that is the output folder itself, `shader_path.txt` staged with the rest, and a restore that fails for the file being published, stale staging folders removed by the next install, the BCPack history path, and a successful run that leaves no staging folder. The old branch's final diff, applied on current `main` as one commit. It applied cleanly. ### Tested - `python -I tests/test_make_game_runtime_staging.py`: 9 tests OK on Linux (Python 3.14.4) and on Windows 11 (Python 3.11). - The other 23 `tests/test_make_game*.py` files pass on Linux. On Windows 11 with Python 3.11, seven of them fail, and they fail the same way on `main`, so the cause is that environment and not this change. - `python -m compileall -q make_game.py tools tests`: OK. GPUs tested: n/a AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator rule changes) On Windows a running `gta6rt.exe` can be renamed, so it does not block the install; its old copy may stay in a `.runtime-staging-*` folder, which the next install removes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1475
No description provided.