gdk_runtime_calls: protect runtime-source directory files from collision (OLD-8468) #702

Open
github-bot wants to merge 1 commit from github-bot/gh-702 into main AGit
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 12:24 UTC · original
abnalstlll-byte:feat/gdk-runtime-source-collision → main · +52 −7 · 2 files · 1 commits · open

Summary

Restores old upstream PR 8468 (OLD-8468).

When --runtime-source\ is a directory of \xgameruntime*.cpp\ (such as the default
untime/shims), \main()\ checked only \if os.path.isfile(a.runtime_source): inputs.append(a.runtime_source). This left all scanned shim C++ files omitted from collision detection, allowing --out\ to overwrite them.

This change extracts
untime_source_paths()\ to properly enumerate the scanned shim files and include them in the collision check against .json\ and .txt\ output paths.

Verification

  • Ran standard-library test suite: \python -I tests/test_gdk_runtime_calls.py\ (25/25 PASS).
  • Clean-room verification: \python -I scripts/check_no_game_data.py\ clean.
  • Zero dependencies outside the Python standard library. No game files, retail binaries, or keys.
  • AI-assisted (Claude Code).
**@⁠abnalstlll-byte** on GitHub · 2026-11-24 12:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/702) `abnalstlll-byte:feat/gdk-runtime-source-collision` → `main` · +52 −7 · 2 files · 1 commits · open ### Summary Restores old upstream PR 8468 (OLD-8468). When \--runtime-source\ is a directory of \xgameruntime*.cpp\ (such as the default \ untime/shims\), \main()\ checked only \if os.path.isfile(a.runtime_source): inputs.append(a.runtime_source)\. This left all scanned shim C++ files omitted from collision detection, allowing \--out\ to overwrite them. This change extracts \ untime_source_paths()\ to properly enumerate the scanned shim files and include them in the collision check against \.json\ and \.txt\ output paths. ### Verification - Ran standard-library test suite: \python -I tests/test_gdk_runtime_calls.py\ (25/25 PASS). - Clean-room verification: \python -I scripts/check_no_game_data.py\ clean. - Zero dependencies outside the Python standard library. No game files, retail binaries, or keys. - AI-assisted (Claude Code).
When --runtime-source is a directory of xgameruntime*.cpp (the default
runtime/shims), main() checked if os.path.isfile(a.runtime_source):
inputs.append(a.runtime_source). This left all scanned shim C++ files
omitted from collision detection, allowing --out to overwrite them.

Extract 
untime_source_paths to enumerate the scanned shim files and
include them in the collision check against json/txt output paths.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:17:04 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 01:17 UTC · original

Reviewed a008a756. I read the diff and ran the tests in a Linux sandbox:

  • tests/test_gdk_runtime_calls.py: 25 tests OK on this branch.
  • The PR's test file copied onto a main worktree: both new tests fail. test_main_refuses_out_that_overwrites_runtime_source_folder_file fails because main exits 0, and test_runtime_source_paths_directory_and_file errors because the helper is missing.
  • check_no_game_data.py on both changed files: clean.
  • The branch merges cleanly into current main (b4b7756e).

Before this change, the collision check only added --runtime-source when it was a single file. With the default folder source, a shim .cpp reached by the output path was not protected. runtime_source_paths() now feeds every scanned xgameruntime*.cpp into the check. read_runtime_source() is moved onto the same helper and behaves the same: an empty folder still raises FileNotFoundError. No findings.

AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 01:17 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/702#issuecomment-7149391007) Reviewed a008a756. I read the diff and ran the tests in a Linux sandbox: - `tests/test_gdk_runtime_calls.py`: 25 tests OK on this branch. - The PR's test file copied onto a main worktree: both new tests fail. `test_main_refuses_out_that_overwrites_runtime_source_folder_file` fails because main exits 0, and `test_runtime_source_paths_directory_and_file` errors because the helper is missing. - `check_no_game_data.py` on both changed files: clean. - The branch merges cleanly into current main (b4b7756e). Before this change, the collision check only added `--runtime-source` when it was a single file. With the default folder source, a shim `.cpp` reached by the output path was not protected. `runtime_source_paths()` now feeds every scanned `xgameruntime*.cpp` into the check. `read_runtime_source()` is moved onto the same helper and behaves the same: an empty folder still raises `FileNotFoundError`. No findings. AI-assisted review. **Recommendation:** Merge
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-25 21:33 UTC · original

Rebased cleanly onto latest \main\ (\e34ff17e9), resolving the stale base CI failure. Verified: all 25 tests in \ est_gdk_runtime_calls.py\ pass.

AI-assisted (Claude Code)

**@⁠abnalstlll-byte** on GitHub · 2026-11-25 21:33 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/702#issuecomment-7175239208) Rebased cleanly onto latest \main\ (\e34ff17e9\), resolving the stale base CI failure. Verified: all 25 tests in \ est_gdk_runtime_calls.py\ pass. AI-assisted (Claude Code)
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/702/head:github-bot/gh-702'
git switch 'github-bot/gh-702'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-702'
git switch 'github-bot/gh-702'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-702'
git switch 'github-bot/gh-702'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-702'
git switch 'main'
git merge --squash 'github-bot/gh-702'
git switch 'main'
git merge --ff-only 'github-bot/gh-702'
git switch 'main'
git merge 'github-bot/gh-702'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.