Repository navigation
gate: game-gate.ps1 says it needs PowerShell 7 (D3D12-GATE-PWSH7) - #2805
Conversation
Under Windows PowerShell 5.1 the gate failed in about 2 s without starting the game and without saying why (reported by a tester). A #Requires -Version 7.0 line makes 5.1 refuse it with a message before anything runs; docs/game_gate.md says so, and a test keeps the line.
|
Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12, head MEASURED
READ IN CODE
ASSUMED
AI-assisted: Claude Code |
|
Verified on Windows, with the control that matters: the tests fail when the change is reverted. Cherry-picked onto
So the new tests are tied to the change and not to each other's fixtures. No part of this needed a GPU, a display or game data, which is what the gate tests are built for. What I could not test: the script against a real run folder - AI-assisted: yes - DeepSeek v4.1 (flash), applied and ran both arms on the machine above. Written with an AI assistant. |
KelboLive
left a comment
There was a problem hiding this comment.
Verified on this machine, and the guard is reachable — which was the question worth asking: #Requires is a parser directive, not a statement, so 5.1 refuses the script before any line runs.
powershell.exe 5.1.26100.9711 exit 1: The script 'game-gate.ps1' cannot be run because it contained a
"#requires" statement for Windows PowerShell 7.0 … currently running 5.1.26100.9711
pwsh 7.7.0 stop -> "asked … to stop", STOP written, exit 0
line 1 deleted, 5.1 ran (exit 0) — the file is otherwise 5.1-parseable
line 2 made 7-only, 5.1 the #requires error still wins
So it is not the "guard inside a 7-only script, unreachable after the parse error" anti-pattern. 22/22 tests, check_no_game_data clean, and deleting the line fails Script.test_it_needs_powershell_7.
Two notes:
- The test is textual: it catches removal, movement or a changed version string, but not a wrong or missing message at run time. The repo already runs PowerShell in
tests/test_win_launchers.py, so a one-case execution test (skip whenpowershell.exeis absent) assertingScriptRequiresUnmatchedPSVersionand exit 1 would pin the behaviour rather than the text. - Since the file is 5.1-parseable and
stopworks under 5.1, the docs' "it needs PowerShell 7" would be clearer saying what inrunneeds 7 — today it states the support boundary without the reason.
|
Merging. Head AI-assisted (Claude Code). |
Claimed in the coordination issue as: D3D12-GATE-PWSH7 (#2570 (comment))
What and why
A tester ran
scripts/game-gate.ps1(#2782) under Windows PowerShell 5.1. It failed in about 2 s without starting the game and without saying why. The script needs PowerShell 7.scripts/game-gate.ps1now starts with#Requires -Version 7.0. Windows PowerShell 5.1 refuses the script with its own message before anything runs.docs/game_gate.md("Running it") says it needspwsh.tests/test_game_gate.pykeeps the line (test_it_needs_powershell_7).scripts/game-abba.ps1(#2804) carries the same line from the start.Tested
On Windows 11 Pro 10.0.26300, at
mainb7a1be2:tests/test_game_gate.py: 22 tests OK. Withmain'sscripts/game-gate.ps1put back, the new test fails and the other 21 pass.scripts/check_no_game_data.pyon the changed files are clean.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)