fix(tests): the game-free checks pass on Windows #255

Open
Yeetbot90 wants to merge 5 commits from Yeetbot90/Longshot:fix/windows-game-free-checks into main
First-time contributor

Why

The game-free checks (python -I -B tests/run_all.py) fail four tests on Windows, so a contributor there can't get a clean run before opening a pull request. The causes are text-mode newlines, POSIX-only fixtures and a stale menu translation. One of them is a real bug in scripts/check_third_party.py.

What changed

  • scripts/check_third_party.py: paths go to git check-ignore --stdin NUL-separated (-z). In text mode on Windows each line ended \r\n, so git looked up <path>\r, which no rule ignores. An ignored build file (a .dll in a part) was then hashed into the part, and the part "differed from its note". The repository's own third_party/ passes today only because no ignored file sits in a part.
  • tests/test_release.py:
    • The signed SHA256SUMS is the served bytes. write_text wrote \r\n on Windows, so the signature never matched.
    • On Windows the git-cliff stand-in is a .cmd that hands its arguments to Python (Windows runs no #!/bin/sh script: WinError 193). Following monsterlag's review, the .cmd is ASCII. It reads Python's and the script's paths from the environment, which cmd.exe keeps as Unicode, and the stub prints UTF-8, as git-cliff does. cliff_stub() builds it for both tests.
    • A new test, test_the_git_cliff_stand_in_runs_from_a_unicode_path, runs it from a folder with an accented letter.
  • nx2/test_nup_paths.py: one file_link helper. Where Windows refuses a file symbolic link (WinError 1314, no Developer Mode), those 5 tests skip: without the privilege nobody can plant such a link. Anywhere else, the error still fails the test.
  • gpu/vk/menu_i18n.h: the 13 translations of the Debug tab's "Testing tools..." row follow main's English text, which gained "and damage" (tests/test_menu_i18n.py).

Flags and settings

None.

Measurements

main: d9648863 (2026-11-13)
this PR: fix/windows-game-free-checks @ 01943afa
Hardware: Windows 11 Pro (26200), Python 3.14, llvm-mingw 20261104, Git for Windows (core.autocrlf=true)
Scene: no game: the game-free suite, python -I -B tests/run_all.py, 24 at once
Method: one run of the whole suite on each side, back to back (main d9648863, then this PR). The results are pass/fail and the same on every run. Also one earlier run of this PR at e62e488a, before the stand-in's Unicode fix, with the same counts.
How to reproduce: on Windows with LONGSHOT_MINGW set (docs/development.md), check out each commit and run python -I -B tests/run_all.py

main @ d9648863 this PR @ 01943afa
passed 462 466
failed 4 0
skipped 67 67
main @ d9648863:   462 passed, 4 failed, 67 skipped in 92 s (windows, 24 at once)
                   nx2/test_nup_paths.py, tests/test_check_third_party.py, tests/test_menu_i18n.py, tests/test_release.py
this PR @ 01943afa: 466 passed, 0 failed, 67 skipped in 89 s (windows, 24 at once)

Testing

Tested:

  • On Windows 11 (above): the whole suite at 01943afa.
  • tests/test_release.py alone, with TEMP and TMP set to a folder with accented letters: 29 OK.
    • Before the fix, Bump.test_the_first_notes_give_git_cliff_no_range failed there, as the review found.
    • With the fix, both git-cliff tests and the whole file pass, under that TEMP and under a normal one.
  • monsterlag ran the head before this fix on native Windows 11: 496 passed, 0 failed, 33 skipped.

Not tested:

  • Not run on Linux here. Linux's paths are unchanged except -z, which git check-ignore has had since 1.8, and the stand-in, which is still the #!/bin/sh one there.
  • The WinError 1314 skip was not exercised by the reviewer, whose account can create the links; it was exercised here.

Needs other testers: None. CI's Linux Python source checks run the suite once a maintainer approves the run.

Screenshots

Nothing on screen.

Risk and rollback

Small: the only change outside the tests is how check_third_party.py passes paths to git. With Developer Mode on, the 5 symbolic-link tests run as before. Reverting the commits is enough.

Reviewer notes

Start with scripts/check_third_party.py (one line), then cliff_stub() in tests/test_release.py.

Issues

See #252, whose game-free run on Windows had these four failures.

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main. (main d9648863 merged in.)
  • python -I -B tests/run_all.py run and passing (any failure that also fails on main is named above).
  • Tested in the game, or what wasn't is named under Testing. (No game: these are tools and tests only.)
  • Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests).
  • Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (One run each, back to back, plus one earlier run of this PR: the results are pass/fail and don't vary.)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

If applicable

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • A game-free test added for the fix, failing on main and passing here.
## Why The game-free checks (`python -I -B tests/run_all.py`) fail four tests on Windows, so a contributor there can't get a clean run before opening a pull request. The causes are text-mode newlines, POSIX-only fixtures and a stale menu translation. One of them is a real bug in `scripts/check_third_party.py`. ## What changed - **`scripts/check_third_party.py`:** paths go to `git check-ignore --stdin` NUL-separated (`-z`). In text mode on Windows each line ended `\r\n`, so git looked up `<path>\r`, which no rule ignores. An ignored build file (a `.dll` in a part) was then hashed into the part, and the part "differed from its note". The repository's own `third_party/` passes today only because no ignored file sits in a part. - **`tests/test_release.py`:** - The signed `SHA256SUMS` is the served bytes. `write_text` wrote `\r\n` on Windows, so the signature never matched. - On Windows the git-cliff stand-in is a `.cmd` that hands its arguments to Python (Windows runs no `#!/bin/sh` script: WinError 193). Following monsterlag's review, the `.cmd` is ASCII. It reads Python's and the script's paths from the environment, which `cmd.exe` keeps as Unicode, and the stub prints UTF-8, as git-cliff does. `cliff_stub()` builds it for both tests. - A new test, `test_the_git_cliff_stand_in_runs_from_a_unicode_path`, runs it from a folder with an accented letter. - **`nx2/test_nup_paths.py`:** one `file_link` helper. Where Windows refuses a file symbolic link (WinError 1314, no Developer Mode), those 5 tests skip: without the privilege nobody can plant such a link. Anywhere else, the error still fails the test. - **`gpu/vk/menu_i18n.h`:** the 13 translations of the Debug tab's "Testing tools..." row follow main's English text, which gained "and damage" (`tests/test_menu_i18n.py`). ## Flags and settings None. ## Measurements main: d9648863 (2026-11-13) this PR: fix/windows-game-free-checks @ 01943afa Hardware: Windows 11 Pro (26200), Python 3.14, llvm-mingw 20261104, Git for Windows (`core.autocrlf=true`) Scene: no game: the game-free suite, `python -I -B tests/run_all.py`, 24 at once Method: one run of the whole suite on each side, back to back (main d9648863, then this PR). The results are pass/fail and the same on every run. Also one earlier run of this PR at e62e488a, before the stand-in's Unicode fix, with the same counts. How to reproduce: on Windows with `LONGSHOT_MINGW` set (docs/development.md), check out each commit and run `python -I -B tests/run_all.py` | | main @ d9648863 | this PR @ 01943afa | |---|---|---| | passed | 462 | 466 | | failed | 4 | 0 | | skipped | 67 | 67 | ``` main @ d9648863: 462 passed, 4 failed, 67 skipped in 92 s (windows, 24 at once) nx2/test_nup_paths.py, tests/test_check_third_party.py, tests/test_menu_i18n.py, tests/test_release.py this PR @ 01943afa: 466 passed, 0 failed, 67 skipped in 89 s (windows, 24 at once) ``` ## Testing **Tested:** - On Windows 11 (above): the whole suite at 01943afa. - `tests/test_release.py` alone, with TEMP and TMP set to a folder with accented letters: 29 OK. - Before the fix, `Bump.test_the_first_notes_give_git_cliff_no_range` failed there, as the review found. - With the fix, both git-cliff tests and the whole file pass, under that TEMP and under a normal one. - monsterlag ran the head before this fix on native Windows 11: 496 passed, 0 failed, 33 skipped. **Not tested:** - Not run on Linux here. Linux's paths are unchanged except `-z`, which `git check-ignore` has had since 1.8, and the stand-in, which is still the `#!/bin/sh` one there. - The WinError 1314 skip was not exercised by the reviewer, whose account can create the links; it was exercised here. **Needs other testers:** None. CI's Linux Python source checks run the suite once a maintainer approves the run. ## Screenshots Nothing on screen. ## Risk and rollback Small: the only change outside the tests is how `check_third_party.py` passes paths to git. With Developer Mode on, the 5 symbolic-link tests run as before. Reverting the commits is enough. ## Reviewer notes Start with `scripts/check_third_party.py` (one line), then `cliff_stub()` in `tests/test_release.py`. ## Issues See #252, whose game-free run on Windows had these four failures. ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. (main d9648863 merged in.) - [x] `python -I -B tests/run_all.py` run and passing (any failure that also fails on `main` is named above). - [x] Tested in the game, or what wasn't is named under Testing. (No game: these are tools and tests only.) - [x] Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests). - [x] Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (One run each, back to back, plus one earlier run of this PR: the results are pass/fail and don't vary.) - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### If applicable - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] A game-free test added for the fix, failing on `main` and passing here.
fix(tests): the game-free checks pass on Windows
Some checks failed
PR description / Description follows the template (pull_request_target) Failing after 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
50f22d96ed
check_third_party.py gave git check-ignore its paths one per line in text mode; on Windows each line
ends "\r\n", git looks up "<path>\r", and an ignored build file was hashed into the part. The paths
go NUL-separated (-z).

test_release.py signed a SHA256SUMS written in text mode ("\r\n" on Windows) but served the "\n"
bytes, and ran a #!/bin/sh git-cliff stub; it writes the bytes it serves, and on Windows the stub
is a .cmd that hands its arguments to Python.

test_nup_paths.py's file-link fixtures skip, as the directory ones fall back to junctions, where
Windows refuses a file symbolic link (WinError 1314: no Developer Mode).
monsterlag requested changes 2026-11-13 18:22:44 +00:00
Dismissed
monsterlag left a comment

Tested head 50f22d96ed on native Windows 11, Python 3.14.7, llvm-mingw 20261104, with the SDK and OpenSSL available. The three affected check groups pass; the complete suite reports 496 passed, 0 failed, 33 skipped in 142 seconds. The checkout also contained the ignored SDL DLLs from the documented development setup.

Two changes are needed before this is ready:

  1. [P2] The Windows git-cliff stand-in still fails from a Unicode temporary path (tests/test_release.py:225). Setting TEMP and TMP to a directory containing an accented character, then running python -I -B tests/test_release.py Bump.test_the_first_notes_give_git_cliff_no_range, fails because cmd.exe reads the UTF-8 bytes embedded in the batch file using its current code page. The Python interpreter starts, but receives a corrupted path to git-cliff-stub.py and cannot open it. Keep the batch source ASCII and pass its Python/script paths through Unicode environment values, or use another argv probe that preserves these paths. Please retain a focused test of this case as well as both existing range assertions.

  2. [P2] The ready description does not pass the project's required PR-description check. python -I scripts/forge.py pr status 255 reports five missing sections: Why, Measurements, Testing, Risk and rollback, and the complete Checklist. Please migrate the existing useful explanation into the current template, name the main and PR commits in Measurements, include Tested / Not tested / Needs other testers, and settle the checklist against this diff. Flags and settings can be None. This is a contribution-workflow blocker, separate from the code results above.

No game build or gameplay test was needed for these three tooling/fixture changes. I did not exercise the WinError 1314 skip path because this Windows account can create the file-link fixtures; the NUP path tests ran without that privilege skip here.

Tested head 50f22d96edcd3fede012f3f846e419f90f62f5b9 on native Windows 11, Python 3.14.7, llvm-mingw 20261104, with the SDK and OpenSSL available. The three affected check groups pass; the complete suite reports 496 passed, 0 failed, 33 skipped in 142 seconds. The checkout also contained the ignored SDL DLLs from the documented development setup. Two changes are needed before this is ready: 1. [P2] The Windows git-cliff stand-in still fails from a Unicode temporary path (tests/test_release.py:225). Setting TEMP and TMP to a directory containing an accented character, then running `python -I -B tests/test_release.py Bump.test_the_first_notes_give_git_cliff_no_range`, fails because cmd.exe reads the UTF-8 bytes embedded in the batch file using its current code page. The Python interpreter starts, but receives a corrupted path to git-cliff-stub.py and cannot open it. Keep the batch source ASCII and pass its Python/script paths through Unicode environment values, or use another argv probe that preserves these paths. Please retain a focused test of this case as well as both existing range assertions. 2. [P2] The ready description does not pass the project's required PR-description check. `python -I scripts/forge.py pr status 255` reports five missing sections: Why, Measurements, Testing, Risk and rollback, and the complete Checklist. Please migrate the existing useful explanation into the current template, name the main and PR commits in Measurements, include Tested / Not tested / Needs other testers, and settle the checklist against this diff. Flags and settings can be None. This is a contribution-workflow blocker, separate from the code results above. No game build or gameplay test was needed for these three tooling/fixture changes. I did not exercise the WinError 1314 skip path because this Windows account can create the file-link fixtures; the NUP path tests ran without that privilege skip here.
@ -223,0 +222,4 @@
if os.name == "nt": # (Windows runs no #! script: a .cmd hands its arguments to Python, which prints them)
(self.dir / "git-cliff-stub.py").write_text("import sys\nfor a in sys.argv[1:]: print(a)\n", encoding="utf-8")
stub = self.dir / "git-cliff-stub.cmd"
stub.write_text('@"%s" -I "%s" %%*\n' % (sys.executable, self.dir / "git-cliff-stub.py"), encoding="utf-8")
First-time contributor

This UTF-8 batch source embeds absolute paths, but cmd.exe decodes them with its current code page. The focused Bump.test_the_first_notes_give_git_cliff_no_range fails when TEMP/TMP contains an accented character: Python receives a corrupted path to git-cliff-stub.py. Please preserve Unicode paths in the stand-in and add that focused case; the normal-path full suite passed here.

This UTF-8 batch source embeds absolute paths, but cmd.exe decodes them with its current code page. The focused Bump.test_the_first_notes_give_git_cliff_no_range fails when TEMP/TMP contains an accented character: Python receives a corrupted path to git-cliff-stub.py. Please preserve Unicode paths in the stand-in and add that focused case; the normal-path full suite passed here.
fix(i18n): the Debug tools help is translated again after Damage taken (its English gained 'and damage')
Some checks failed
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Failing after 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
39a4b505ff
Author
First-time contributor

Thanks for testing it. At 01943afa, with main d9648863 merged in:

  1. The git-cliff stand-in from a Unicode path. Fixed. The .cmd is ASCII now and reads Python's and the script's paths from GIT_CLIFF_STUB_PYTHON and GIT_CLIFF_STUB_SCRIPT, which cmd.exe keeps as Unicode. The stub also prints UTF-8, as git-cliff does: with the path fixed, the accented repository path it echoed came back in the ANSI code page and
    elease.notes could not decode it. cliff_stub() builds it for both tests. A new focused test, est_the_git_cliff_stand_in_runs_from_a_unicode_path, runs it from a folder with an accented letter, and both range assertions are kept. With TEMP and TMP under an accented folder, Bump.test_the_first_notes_give_git_cliff_no_range failed before the fix and passes now, and so does the whole of ests/test_release.py (29 OK).
  2. The description. Moved to the current template: Why, Measurements (main @ d9648863: 462 passed, 4 failed; this PR @ 01943afa: 466 passed, 0 failed), Tested / Not tested / Needs other testers, Risk and rollback, and the checklist settled against the diff. Flags and settings: None. scripts/check_pr_description.py --file passes it here.

I also merged main in, because it had moved on.

Thanks for testing it. At 01943afa, with main d9648863 merged in: 1. **The git-cliff stand-in from a Unicode path.** Fixed. The .cmd is ASCII now and reads Python's and the script's paths from GIT_CLIFF_STUB_PYTHON and GIT_CLIFF_STUB_SCRIPT, which cmd.exe keeps as Unicode. The stub also prints UTF-8, as git-cliff does: with the path fixed, the accented repository path it echoed came back in the ANSI code page and elease.notes could not decode it. cliff_stub() builds it for both tests. A new focused test, est_the_git_cliff_stand_in_runs_from_a_unicode_path, runs it from a folder with an accented letter, and both range assertions are kept. With TEMP and TMP under an accented folder, Bump.test_the_first_notes_give_git_cliff_no_range failed before the fix and passes now, and so does the whole of ests/test_release.py (29 OK). 2. **The description.** Moved to the current template: Why, Measurements (main @ d9648863: 462 passed, 4 failed; this PR @ 01943afa: 466 passed, 0 failed), Tested / Not tested / Needs other testers, Risk and rollback, and the checklist settled against the diff. Flags and settings: None. scripts/check_pr_description.py --file passes it here. I also merged main in, because it had moved on.
fix(tests): the Windows git-cliff stand-in runs from a Unicode temporary path
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Has been cancelled
01943afac4
monsterlag's review of #255: cmd.exe read the paths written into the .cmd in the console's code page, so under a TEMP with an accented letter Python got a broken path to the stub. The .cmd is now ASCII and reads Python's and the script's paths from the environment (Unicode in cmd.exe); the stub prints in UTF-8, as git-cliff does. A focused test runs it from a folder named with an accented letter.

Co-authored-by: Cursor <[email protected]>
monsterlag approved these changes 2026-11-13 19:20:22 +00:00
monsterlag left a comment

Approved follow-up head 01943afa after independently reproducing and verifying the Unicode-path repair on native Windows Python 3.14.7.

The original head 50f22d96 still fails Bump.test_the_first_notes_give_git_cliff_no_range under TEMP/TMP containing Zoë. The follow-up passes. Two sequential interleaved old/fixed pairs gave exit 1/0, then 1/0 (median failing cases 1 -> 0). The complete release file also gave 28 cases with 1 error on the old head versus all 29 passing on the follow-up, in two runs each; those longer runs overlapped, so their durations are not a timing comparison. The new Unicode regression passes in both complete-file runs.

The three other affected groups (third-party provenance, NUP paths and menu translations) all pass at this head. The description now has the required sections; the 13 expanded help translations include the damage-reset meaning. My previous blocking Unicode-path and missing-template findings are resolved. The ASCII .cmd plus Unicode environment variables and explicit UTF-8 Python output address the demonstrated input and output encoding failures.

Please incorporate these two focused interleaved pairs in Measurements: its checked two-pair box currently describes only one whole-suite pair. No performance improvement is claimed. I did not repeat the full Longshot suite at this head; my earlier 496-pass full run was on 50f22d96, and your current-head full run is separately recorded. My account can create symbolic links, so the privilege-denied NUP skip branch still has only your reported coverage.

Approved follow-up head 01943afa after independently reproducing and verifying the Unicode-path repair on native Windows Python 3.14.7. The original head 50f22d96 still fails Bump.test_the_first_notes_give_git_cliff_no_range under TEMP/TMP containing Zoë. The follow-up passes. Two sequential interleaved old/fixed pairs gave exit 1/0, then 1/0 (median failing cases 1 -> 0). The complete release file also gave 28 cases with 1 error on the old head versus all 29 passing on the follow-up, in two runs each; those longer runs overlapped, so their durations are not a timing comparison. The new Unicode regression passes in both complete-file runs. The three other affected groups (third-party provenance, NUP paths and menu translations) all pass at this head. The description now has the required sections; the 13 expanded help translations include the damage-reset meaning. My previous blocking Unicode-path and missing-template findings are resolved. The ASCII .cmd plus Unicode environment variables and explicit UTF-8 Python output address the demonstrated input and output encoding failures. Please incorporate these two focused interleaved pairs in Measurements: its checked two-pair box currently describes only one whole-suite pair. No performance improvement is claimed. I did not repeat the full Longshot suite at this head; my earlier 496-pass full run was on 50f22d96, and your current-head full run is separately recorded. My account can create symbolic links, so the privilege-denied NUP skip branch still has only your reported coverage.
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Has been cancelled
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
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 'fix/windows-game-free-checks:Yeetbot90-fix/windows-game-free-checks'
git switch 'Yeetbot90-fix/windows-game-free-checks'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/Longshot!255
No description provided.