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

Open
opened 2026-11-26 21:19:12 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1848
Author: @kirigayakazima
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/conformance-negative-control-safety


📝 Commits (1)

  • 914e7f5 conformance: check cmake configure status, guard NativeCommandError and clean scratch in negative-control.ps1

📊 Changes

2 files changed (+168 additions, -39 deletions)

View changed files

➕ tests/test_conformance_negative_control.py (+112 -0)
📝 tools/conformance/native/scripts/negative-control.ps1 (+56 -39)

📄 Description

Claimed in the coordination issue as: CONFORMANCE-NEGATIVE-CONTROL-PS1-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163205423)

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)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1848 **Author:** [@kirigayakazima](https://github.com/kirigayakazima) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/conformance-negative-control-safety` --- ### 📝 Commits (1) - [`914e7f5`](https://github.com/ubiquitarianism/leonida/commit/914e7f51daad08971ecc15232d0dfe3275e85f0a) conformance: check cmake configure status, guard NativeCommandError and clean scratch in negative-control.ps1 ### 📊 Changes **2 files changed** (+168 additions, -39 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_conformance_negative_control.py` (+112 -0) 📝 `tools/conformance/native/scripts/negative-control.ps1` (+56 -39) </details> ### 📄 Description Claimed in the coordination issue as: CONFORMANCE-NEGATIVE-CONTROL-PS1-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163205423) ### 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1859
No description provided.