fix(launcher): keep PowerShell 5.1 stderr redirection from aborting on native warnings (#233) #236
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!236
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/236/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Lewandox on GitHub · 2026-11-25 20:41 UTC · original
Lewandox:fix/launcher-ps51-stderr→main· +95 −4 · 2 files · 1 commits · merged 2026-11-25 21:45 UTCSummary
Fixes #233.
Under Windows PowerShell 5.1, redirecting stderr (
.\tools\lancer_victory.ps1 -GameDir ... 2> victory.log) wraps every stderr line from native executables in aNativeCommandErrorErrorRecord. Becausetools/lancer_victory.ps1sets$ErrorActionPreference = 'Stop', any benign stderr output (such as acargodeprecation warning) terminates the launcher beforevictory.exeever starts.This wraps the three native invocations (
cargo build,$exe translate, and$exe run) in atry/finallyblock that temporarily sets$ErrorActionPreference = 'Continue'while keeping$ErrorActionPreference = 'Stop'for all PowerShell cmdlets/validation, preserving stderr redirection (2> victory.log), and still failing fast on any non-zero$LASTEXITCODE.Tests
test_launcher_survives_stderr_redirection_in_windows_powershell_51intests/test_lanceur_victory.py:powershell.exe -Command "& '...lancer_victory.ps1' -GameDir '...' 2> '...victory.log'") — failed onNativeCommandErroratcargo buildand never ranvictory.exe.cargoandvictoryboth run to completion, exit code is preserved (7), and both stderr lines land invictory.log..venv\Scripts\python.exe -m pytest tests/test_lanceur_victory.py -vv: 15 passed, 0 failed.test_launcher_stops_when_the_build_failsstill fails cleanly whencargoexits non-zero (101).Overlap note
Open PR #234 also touches
tools/lancer_victory.ps1andtests/test_lanceur_victory.py(adding-Fastswitches), in separate regions from the native invocations touched here.@LooperSalty on GitHub · 2026-11-25 21:03 UTC · original
Thanks, the fix is right for the launcher as it was. Note that #243 (just merged) rewrote
tools/lancer_victory.ps1on the Neptune base: it still sets$ErrorActionPreference = 'Stop'and calls cargo build,victory warm(twice) andvictory runwithout your wrapper, so this PR now conflicts and the stderr problem is back on those calls. Could you re-port the wrapper onto those native calls of the new launcher and add your stderr test to the currenttests/test_lanceur_victory.py?@Lewandox on GitHub · 2026-11-25 21:08 UTC · original
Re-ported onto the new Neptune launcher (
93e0b79) across all four native invocations (cargo build, bothvictory warmcalls in-Warmand-Precompile, andvictory run), and updatedtest_launcher_survives_stderr_redirection_in_windows_powershell_51intests/test_lanceur_victory.pyto exercise both the default run path and-Warm -Precompileunder Windows PowerShell 5.12>redirection.Verified locally:
pytest tests/test_lanceur_victory.py -vv-> 19 passed, 0 failed.