build: point the build-rev test's hooksPath at an empty folder #2355

Merged
pigalot merged 1 commit from upstream-pr/2363 into main 2026-11-25 13:45:36 +00:00
pigalot commented 2026-11-25 13:40:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-25T13:40:48Z.


Change

tests/startup_build_rev_check.py runs every git command with -c core.hooksPath= so a contributor's hooks cannot run in its temporary repositories. Some git builds reject the empty value and the check fails before it tests anything:

fatal: The empty string is not a valid path

The check now points core.hooksPath at an empty folder inside its temporary directory, which disables hooks the same way on any git. This is an independent build fix; no issue tracks it.

Verification

On fe0c822f + this commit, Windows 11 (26200), git 2.47.2.vfs.0.1:

  • ctest --preset dev --no-tests=error -R '^startup_build_rev_controls$': 1 passed.
  • Before the change, the same command fails with the error above. git -c core.hooksPath= rev-parse HEAD fails the same way outside the test.

Evidence and follow-up

Measured on one git build only (the VFS fork). I have not checked which upstream git versions reject the empty value; CI's git accepts it, so CI cannot reproduce the failure. No new fixture.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture. (No new fixture; the old file fails on this git.)
  • I updated README/docs when a capability or build requirement changed. (None changed.)
  • I did not include game files, dumps, distribution links or secrets.

This change was AI-assisted: written with Claude Code, and the checks above were run locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6605809247 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2363). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-25T13:40:48Z. --- ## Change `tests/startup_build_rev_check.py` runs every git command with `-c core.hooksPath=` so a contributor's hooks cannot run in its temporary repositories. Some git builds reject the empty value and the check fails before it tests anything: ``` fatal: The empty string is not a valid path ``` The check now points `core.hooksPath` at an empty folder inside its temporary directory, which disables hooks the same way on any git. This is an independent build fix; no issue tracks it. ## Verification On `fe0c822f` + this commit, Windows 11 (26200), git 2.47.2.vfs.0.1: - `ctest --preset dev --no-tests=error -R '^startup_build_rev_controls$'`: 1 passed. - Before the change, the same command fails with the error above. `git -c core.hooksPath= rev-parse HEAD` fails the same way outside the test. ## Evidence and follow-up Measured on one git build only (the VFS fork). I have not checked which upstream git versions reject the empty value; CI's git accepts it, so CI cannot reproduce the failure. No new fixture. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. (No new fixture; the old file fails on this git.) - [x] I updated README/docs when a capability or build requirement changed. (None changed.) - [x] I did not include game files, dumps, distribution links or secrets. This change was AI-assisted: written with Claude Code, and the checks above were run locally.
upstream-sync closed this pull request 2026-11-25 14:05:02 +00:00
tedin7 commented 2026-11-25 14:05:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:45:05Z.

Review: COMMENTED


Review of head dfda9f53b5cfa06d6369438308175fb73331613d (one file: tests/startup_build_rev_check.py, +4/-1).

Result: 0 P1, 0 P2.

Logic: core.hooksPath= is replaced by a path to an empty no-hooks folder inside the test's temp dir. Git then finds no hooks in it, so contributor hooks stay disabled, and no git build sees an empty-string path. The folder is created before any git call, and as_posix() keeps the value valid on Windows. No other hooksPath use or sibling check needs the same change. No competing PR touches this file.

Commands run locally (Linux, git 2.47.3), in a worktree at the head above:

  • python3 tests/startup_build_rev_check.py -> startup_build_rev_check: 10 cases ok
  • python3 tests/docs_links_check.py -> Checked 18 Markdown files and 451 links.
  • python3 tests/bidi_controls_check.py -> no bidirectional controls.
  • git diff --check origin/main...HEAD -> clean

Mutation check:

  • Put a failing pre-commit hook into the new no-hooks folder -> FAIL git commit -q -m first ..., exit 1. This shows the new hooksPath value is really honored by every git call in the test.
  • Reverting to core.hooksPath= still passes here. That is expected: this git accepts the empty value. The PR body says the same, so only some git builds reproduce the old failure.

CI at this head: Build and test on Windows pass, Run platform-independent Python checks on Linux pass, Assemble and translate gfx1013 fixtures pass.

Only a .py test changed, so the pure-Python fast path applies.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6058735605 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2363#pullrequestreview-6058735605). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:45:05Z. **Review:** COMMENTED --- Review of head `dfda9f53b5cfa06d6369438308175fb73331613d` (one file: `tests/startup_build_rev_check.py`, +4/-1). Result: 0 P1, 0 P2. Logic: `core.hooksPath=` is replaced by a path to an empty `no-hooks` folder inside the test's temp dir. Git then finds no hooks in it, so contributor hooks stay disabled, and no git build sees an empty-string path. The folder is created before any git call, and `as_posix()` keeps the value valid on Windows. No other `hooksPath` use or sibling check needs the same change. No competing PR touches this file. Commands run locally (Linux, git 2.47.3), in a worktree at the head above: - `python3 tests/startup_build_rev_check.py` -> `startup_build_rev_check: 10 cases ok` - `python3 tests/docs_links_check.py` -> `Checked 18 Markdown files and 451 links.` - `python3 tests/bidi_controls_check.py` -> `no bidirectional controls.` - `git diff --check origin/main...HEAD` -> clean Mutation check: - Put a failing `pre-commit` hook into the new `no-hooks` folder -> `FAIL git commit -q -m first ...`, exit 1. This shows the new `hooksPath` value is really honored by every git call in the test. - Reverting to `core.hooksPath=` still passes here. That is expected: this git accepts the empty value. The PR body says the same, so only some git builds reproduce the old failure. CI at this head: `Build and test on Windows` pass, `Run platform-independent Python checks on Linux` pass, `Assemble and translate gfx1013 fixtures` pass. Only a `.py` test changed, so the pure-Python fast path applies. AI-assisted; commands listed were executed locally.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
R0Y00/Xbox2Windows!2355
No description provided.