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

Merged
leonida/mandy
abnalstlll-byte merged 1 commit from feat/gdk-runtime-source-collision into main 2026-11-28 10:58:11 +00:00

Pull request successfully merged and closed

abnalstlll-byte commented 2026-11-24 12:24:01 +00:00

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).
### 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).
PierreEbele commented 2026-11-25 01:17:06 +00:00

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

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
abnalstlll-byte commented 2026-11-25 21:33:39 +00:00

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)

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)
MoonEyes commented 2026-11-28 10:58:05 +00:00

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 23 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18). Targeted batch of 23 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.