fix(scripts): check_third_party reads git check-ignore in bytes, so Windows skips ignored files #80

Open
d4nkn3ss wants to merge 1 commit from d4nkn3ss/Longshot:fix/check-third-party-windows-newlines into main
First-time contributor

Why

On Windows, scripts/check_third_party.py fails on any checkout set up the way CONTRIBUTING.md says: the Builder's binaries copied into third_party/ (a64emit.dll, lld-link.exe, SDL2.dll, zbic.dll and others) are counted although .gitignore leaves them out, so a64-kit, sdl2 and zbic "differ from their notes".

What changed

  • scripts: ignored() in scripts/check_third_party.py sends the paths to git check-ignore --no-index --stdin as UTF-8 bytes and decodes the reply, instead of text=True. In text mode on Windows, Python writes each \n as \r\n, so git read every path with a trailing \r, matched no rule, and nothing was skipped. Linux is unchanged: it was already bytes-for-bytes the same there.

Flags and settings

None

Measurements

Not a performance change, so no fps or timings: the check's result on both sides.

main: 77f605a2 (2026-11-12)
this PR: fix/check-third-party-windows-newlines @ 388d24f8
Hardware: Windows 11, Python 3 from python.org, git 2.56.1 (core.autocrlf=true)
Scene: n/a (game-free)
Method: each command run once on each side, on the same checkout, set up as CONTRIBUTING.md says with the Builder's third_party binaries copied in
How to reproduce: on Windows, copy the Builder's tools\third_party binaries in as CONTRIBUTING.md says, then run the two commands below

main @ 77f605a2 this PR @ 388d24f8
python -I scripts/check_third_party.py 3 errors: a64-kit, sdl2, zbic differ from their notes third_party: 11 parts as their notes say
python -I -B tests/test_check_third_party.py FAILED (failures=2) OK (9 tests, 1 skipped)

Testing

Tested: the two commands above on Windows 11, on main and on this PR, and:

  • git check-ignore --no-index --stdin given third_party/sdl2/SDL2.dll\n through Python with text=True prints nothing (exit 1); given the same bytes it prints the path (exit 0).
  • The tracked files of those three parts are byte-identical to HEAD on disk, so the difference was only the ignored binaries.
  • python -I -B tests/run_all.py on this branch: 456 passed, 4 failed. test_setup_runtime.py and test_release.py fail on main @ 77f605a2 too. test_fpx_sticky.py and test_spawn_emit.py pass when run alone, on main and here. In the full run, test_fpx_sticky.py failed because LONGSHOT_MINGW wasn't set in that shell; why test_spawn_emit.py failed only in the full run I don't know.

Not tested: Linux and macOS: the bytes and text paths are the same there, and CI's third-party job runs on Linux.

Needs other testers: None

Screenshots

Nothing on screen

Risk and rollback

Only the check script changes; reverting the commit is enough. If git check-ignore ever printed a path that isn't UTF-8, the decode would fail loudly rather than quietly hashing the file.

Reviewer notes

CI runs this check on Linux only, which is why it didn't catch this.

Issues

None

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main.
  • 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 code changed: a script fix.)
  • 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. (n/a: not a performance change; both sides' results are in the table.)
  • 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.
  • Flags table filled in; README / docs/development.md switch reference updated. (n/a)
  • Screenshots for a change that shows on screen. (n/a)
  • A row in docs/tested-configurations.md for each measured run. (n/a)
  • MKWVK_API_VERSION bumped (gpu/vk/vk_api.h's MkwVkHost or MkwVkRenderer changed). (n/a)
  • The SPIR-V headers regenerated with glslang (a shader changed). (n/a)
  • A game-free test added for the fix, failing on main and passing here. (The existing tests/test_check_third_party.py already does on Windows: 2 failures on main, OK here.)
  • A check under tests/ that reads changed source updated in this PR, not weakened. (n/a)
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (n/a: no host code)
  • Docs updated. (n/a)

🤖 Generated with Claude Code

## Why On Windows, `scripts/check_third_party.py` fails on any checkout set up the way CONTRIBUTING.md says: the Builder's binaries copied into `third_party/` (`a64emit.dll`, `lld-link.exe`, `SDL2.dll`, `zbic.dll` and others) are counted although `.gitignore` leaves them out, so a64-kit, sdl2 and zbic "differ from their notes". ## What changed - scripts: `ignored()` in `scripts/check_third_party.py` sends the paths to `git check-ignore --no-index --stdin` as UTF-8 bytes and decodes the reply, instead of `text=True`. In text mode on Windows, Python writes each `\n` as `\r\n`, so git read every path with a trailing `\r`, matched no rule, and nothing was skipped. Linux is unchanged: it was already bytes-for-bytes the same there. ## Flags and settings None ## Measurements Not a performance change, so no fps or timings: the check's result on both sides. main: 77f605a2 (2026-11-12) this PR: fix/check-third-party-windows-newlines @ 388d24f8 Hardware: Windows 11, Python 3 from python.org, git 2.56.1 (`core.autocrlf=true`) Scene: n/a (game-free) Method: each command run once on each side, on the same checkout, set up as CONTRIBUTING.md says with the Builder's third_party binaries copied in How to reproduce: on Windows, copy the Builder's `tools\third_party` binaries in as CONTRIBUTING.md says, then run the two commands below | | main @ 77f605a2 | this PR @ 388d24f8 | |---|---|---| | `python -I scripts/check_third_party.py` | 3 errors: a64-kit, sdl2, zbic differ from their notes | `third_party: 11 parts as their notes say` | | `python -I -B tests/test_check_third_party.py` | FAILED (failures=2) | OK (9 tests, 1 skipped) | ## Testing **Tested:** the two commands above on Windows 11, on main and on this PR, and: - `git check-ignore --no-index --stdin` given `third_party/sdl2/SDL2.dll\n` through Python with `text=True` prints nothing (exit 1); given the same bytes it prints the path (exit 0). - The tracked files of those three parts are byte-identical to `HEAD` on disk, so the difference was only the ignored binaries. - `python -I -B tests/run_all.py` on this branch: 456 passed, 4 failed. `test_setup_runtime.py` and `test_release.py` fail on main @ 77f605a2 too. `test_fpx_sticky.py` and `test_spawn_emit.py` pass when run alone, on main and here. In the full run, `test_fpx_sticky.py` failed because `LONGSHOT_MINGW` wasn't set in that shell; why `test_spawn_emit.py` failed only in the full run I don't know. **Not tested:** Linux and macOS: the bytes and text paths are the same there, and CI's third-party job runs on Linux. **Needs other testers:** None ## Screenshots Nothing on screen ## Risk and rollback Only the check script changes; reverting the commit is enough. If `git check-ignore` ever printed a path that isn't UTF-8, the decode would fail loudly rather than quietly hashing the file. ## Reviewer notes CI runs this check on Linux only, which is why it didn't catch this. ## Issues None ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. - [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 code changed: a script fix.) - [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. (n/a: not a performance change; both sides' results are in the table.) - [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. - [ ] Flags table filled in; README / docs/development.md switch reference updated. (n/a) - [ ] Screenshots for a change that shows on screen. (n/a) - [ ] A row in `docs/tested-configurations.md` for each measured run. (n/a) - [ ] `MKWVK_API_VERSION` bumped (`gpu/vk/vk_api.h`'s `MkwVkHost` or `MkwVkRenderer` changed). (n/a) - [ ] The SPIR-V headers regenerated with glslang (a shader changed). (n/a) - [x] A game-free test added for the fix, failing on `main` and passing here. (The existing `tests/test_check_third_party.py` already does on Windows: 2 failures on main, OK here.) - [ ] A check under `tests/` that reads changed source updated in this PR, not weakened. (n/a) - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (n/a: no host code) - [ ] Docs updated. (n/a) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(scripts): check_third_party reads git check-ignore in bytes, so Windows skips ignored files
Some checks failed
Linux AppImage / appimage (pull_request) Blocked by required conditions
Windows builder / Longshot Builder zip (pull_request) Blocked by required conditions
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Blocked by required conditions
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Blocked by required conditions
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 / Python source checks (windows-2022, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (windows-2022, 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
388d24f8f2
In text mode on Windows, subprocess sends each path to `git check-ignore --stdin` with a trailing \r, which matches
no .gitignore rule. Every ignored file under third_party/ was then hashed, so a checkout set up as CONTRIBUTING.md
says (the Builder's a64emit.dll, lld-link.exe, SDL2.dll, zbic.dll copied in) failed the check for a64-kit, sdl2 and
zbic, and tests/test_check_third_party.py failed twice on Windows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Some checks failed
Linux AppImage / appimage (pull_request) Blocked by required conditions
Windows builder / Longshot Builder zip (pull_request) Blocked by required conditions
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Blocked by required conditions
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Blocked by required conditions
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 / Python source checks (windows-2022, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (windows-2022, 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/check-third-party-windows-newlines:d4nkn3ss-fix/check-third-party-windows-newlines'
git switch 'd4nkn3ss-fix/check-third-party-windows-newlines'
Sign in to join this conversation.
No description provided.