Repository navigation
startup: preserve debugger stderr and exit status - #2867
Conversation
R0Y00
left a comment
There was a problem hiding this comment.
The integration trial for a4d2114e after #2870 conflicts in tests/startup_run_ps1_check.py; tools/startup/run.ps1 merges cleanly. Please update against current main (3b6c38a8) and keep both the stderr/exit-status cases and #2870's three manifest controls, including the stub's title ID and storage quota fields. I’ll rerun the full fixture under Windows PowerShell 5.1 and PowerShell 7 on the updated head.
# Conflicts: # tests/startup_run_ps1_check.py
Resolved conflicts: - tools/startup/run.ps1: kept the branch's Windows PowerShell 5.1 wrapper around the debugger call and passed main's --capture-every arguments (@captureArgs) inside it. - tests/startup_run_ps1_check.py: run_case takes both sides' parameters (emit_stderr, missing_python, real_log_error, native, cache_files); the branch's .out summary comparison is followed by main's stale shader cache check. Also: the real debugger log case copies hook_window.py and window_capture.py, which main's debug_launch.py now imports.
|
I merged Conflicts and how I resolved them.
One change outside the conflict hunks.
I added the two modules to that case's copy list. With that, What I ran. I built the whole tree in ctest --test-dir out/build/<preset> --no-tests=error -j 4 --output-on-failure -R '^(startup_debug.*|startup_hook.*|startup_run_ps1.*|startup_run_sh.*|startup_host_cpu_debug.*|startup_window_capture.*|startup_launch.*|startup_runtime_target.*|startup_shader_cache_revision.*)$'14 of 15 pass in Debug and in Release
R0Y00's request on Environment: Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10, Windows PowerShell 5.1 and PowerShell 7. This reply was AI-assisted. |
R0Y00
left a comment
There was a problem hiding this comment.
Reviewed 3dc2341 integrated on main f9286e7 (tree 65eb01655e0e91089c30235488d624a0b5aef757). The rebased fixture retains the three manifest controls from #2870. ErrorActionPreference is scoped to the debugger invocation, its exit code is captured before cleanup, and the launcher reports it after the finally block.
On Windows 11 26200.9974, tests/startup_run_ps1_check.py passed on Windows PowerShell 5.1 and PowerShell 7. The stderr-with-exit-0 and stderr-with-exit-7 cases preserved the summary and status, the source-built debugger log-open error reached the summary, and the watcher-cleanup and missing-build controls passed. The text-only and bidi checks also passed:
python -B tests/startup_run_ps1_check.py
python -B tests/startup_run_ps1_check.py --text-only
python -B tests/bidi_controls_check.py
Hosted Windows, Linux Python and gfx1013 checks passed. These were source-built launcher checks.
Change
On Windows PowerShell 5.1, a debugger that writes to stderr can trigger
NativeCommandErrorunder the launcher's stop-on-error preference. The launcher then exits 1 before printing its summary, even when the debugger returned 0 or another exit code. ScopeContinueto the debugger invocation and capture its exit code before returning to the launcher's normal error handling.#2822 edits the same invocation to add capture arguments, and #2820 also changes this script and its check. These are separate behaviors; whichever lands later may need to carry both changes.
Verification
Windows, base
b505c32b, patch heada4d2114e:out\pe-env\Scripts\python.exe -B tests\startup_run_ps1_check.py— passed with Windows PowerShell 5.1 and PowerShell 7. Synthetic debugger cases cover stderr with exit 0 and 7, the watcher cleanup path, and missing Python. A source-built debugger log-open failure checks that itsPermissionErrorreaches the summary; the no-stderr path is a control.out\pe-env\Scripts\python.exe -B tests\startup_run_ps1_check.py --text-only— passed.out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py— passed.. .\tools\dev.ps1; cmake --build --preset pr; ctest --preset pr --no-tests=error— build passed; 36 tests passed and four min-LOD WARP tests skipped.dev.ps1reported thatvswhere.exewas not on PATH; the configured build completed.git diff --check upstream/main— passed.The first sandboxed launcher check failed to remove a still-open synthetic watcher log; the host rerun above passed. No title executable or hardware behavior was tested.
Evidence and follow-up
The debugger stub and failure input are generated by the test; the real debugger case uses repository source and a synthetic directory at the log-file path. On the unpatched script, the PowerShell 5.1 stderr cases returned 1 and missed the summary; PowerShell 7 served as a control.
AI-assisted.
Checklist