conformance: check cmake configure status, guard NativeCommandError and clean scratch in negative-control.ps1 #1848

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

@⁠kirigayakazima on GitHub · 2026-11-25 13:04 UTC · original
kirigayakazima:fix/conformance-negative-control-safety → main · +168 −39 · 2 files · 1 commits · open

Claimed in the coordination issue as: CONFORMANCE-NEGATIVE-CONTROL-PS1-SAFETY (#1608)

What and why

  • Check $LASTEXITCODE immediately after cmake -S ... -B ... configure in tools/conformance/native/scripts/negative-control.ps1 so configure failures stop with CONFIGURE FAILED <code > before running --build.
  • Temporarily set $ErrorActionPreference = 'Continue' inside a try/finally block around & ... conform_native.exe ... 2>&1 so Windows PowerShell 5.1 does not abort with NativeCommandError when diagnostics go to stderr.
  • Force array capture @(...) for $failedScenes and compare sorted scene lists without Compare-Object (which crashes when $failedScenes is empty/$null on Windows PowerShell 5.1).
  • Use -LiteralPath on file/directory operations and wrap the throwaway negative-control directory in try/finally cleanup while preserving CRLF line endings.
  • Add Windows PowerShell 5.1 regression tests in tests/test_conformance_negative_control.py.

Tested

  • python -I tests/test_conformance_negative_control.py -v (live Windows PowerShell 5.1) -> Ran 4 tests in 2.068s, OK.
  • Detached upstream/main (98c2f777) baseline worktree with tests/test_conformance_negative_control.py -> Ran 4 tests in 2.026s, FAILED (failures=4).
  • CRLF verification on tools/conformance/native/scripts/negative-control.ps1 -> PS1_CRLF=82 PS1_LF_ONLY=0.
  • python -I tests/test_ci_registration.py -> Ran 16 tests in 4.946s, OK.
  • python -I tests/test_text_write_line_endings.py -> Ran 3 tests in 13.453s, OK.
  • python -I scripts/check_no_game_data.py tools/conformance/native/scripts/negative-control.ps1 tests/test_conformance_negative_control.py, python -I -m compileall -q tests/test_conformance_negative_control.py, and git diff --check -> exit 0.

GPUs tested: n/a (Windows PowerShell 5.1 + stdlib Python tests on Windows 11 x64)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)
**@⁠kirigayakazima** on GitHub · 2026-11-25 13:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1848) `kirigayakazima:fix/conformance-negative-control-safety` → `main` · +168 −39 · 2 files · 1 commits · open Claimed in the coordination issue as: CONFORMANCE-NEGATIVE-CONTROL-PS1-SAFETY (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why - Check `$LASTEXITCODE` immediately after `cmake -S ... -B ...` configure in `tools/conformance/native/scripts/negative-control.ps1` so configure failures stop with `CONFIGURE FAILED <code >` before running `--build`. - Temporarily set `$ErrorActionPreference = 'Continue'` inside a `try/finally` block around `& ... conform_native.exe ... 2>&1` so Windows PowerShell 5.1 does not abort with `NativeCommandError` when diagnostics go to stderr. - Force array capture `@(...)` for `$failedScenes` and compare sorted scene lists without `Compare-Object` (which crashes when `$failedScenes` is empty/`$null` on Windows PowerShell 5.1). - Use `-LiteralPath` on file/directory operations and wrap the throwaway `negative-control` directory in `try/finally` cleanup while preserving CRLF line endings. - Add Windows PowerShell 5.1 regression tests in `tests/test_conformance_negative_control.py`. ### Tested - `python -I tests/test_conformance_negative_control.py -v` (live Windows PowerShell 5.1) -> `Ran 4 tests in 2.068s`, `OK`. - Detached `upstream/main` (`98c2f777`) baseline worktree with `tests/test_conformance_negative_control.py` -> `Ran 4 tests in 2.026s`, `FAILED (failures=4)`. - CRLF verification on `tools/conformance/native/scripts/negative-control.ps1` -> `PS1_CRLF=82 PS1_LF_ONLY=0`. - `python -I tests/test_ci_registration.py` -> `Ran 16 tests in 4.946s`, `OK`. - `python -I tests/test_text_write_line_endings.py` -> `Ran 3 tests in 13.453s`, `OK`. - `python -I scripts/check_no_game_data.py tools/conformance/native/scripts/negative-control.ps1 tests/test_conformance_negative_control.py`, `python -I -m compileall -q tests/test_conformance_negative_control.py`, and `git diff --check` -> exit `0`. GPUs tested: n/a (Windows PowerShell 5.1 + stdlib Python tests on Windows 11 x64) AI-assisted: yes ### Checklist - [x] Based on current main and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:08:20 +00:00
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/1848/head:github-bot/gh-1848'
git switch 'github-bot/gh-1848'

Merge

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