Repository navigation
Conversation
…tore alias (BOOT-PS1-PYTHON-ALIAS) Resolve-Python took `python` as soon as Get-Command found it. On Windows that also finds the Store's app execution alias in WindowsApps, which only says how to install Python and exits 9009, so with Python installed through `py` the boot's summary held that message and `py -3` was never tried. Test-Python now starts each candidate (python, then py -3) and takes the first that exits 0 on a 3.12+ check, within 15 s; one that hangs is ended with its children and passed over. -Python is used as given. tests/test_boot_ps1_python.py runs both functions against stand-in commands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KelboLive
left a comment
There was a problem hiding this comment.
The fix is right and I reproduced both halves: 6/6 on the branch, 4/6 failing with main's Resolve-Python, and on this box the probe is ~0.1 s after the game. It also survives the real-world shapes: an active venv on PATH resolves to python, an interpreter that prints its version to stderr is accepted with no noise (the probe reads no output at all), a hanging candidate is killed at 15.4 s with zero leftover processes, and a 0-byte broken alias returns cleanly instead of throwing.
One real gap: the 3.12 floor is untested. OLD in tests/test_boot_ps1_python.py:22 is just exit /b 1, so it tests "non-zero exit is rejected", not the version threshold. Changing (3, 12) to (3, 11) on boot.ps1:190 leaves all six tests green — I confirmed a 3.11-shaped interpreter is then accepted. A stand-in that fakes sys.version_info and execs the -c payload would make that mutation go red.
Two smaller things:
- Assert the "no process left behind" claim in
test_a_python_that_hangs_is_given_up_on; the test only bounds elapsed time, and I verified thetaskkill /Tbehaviour manually rather than the suite doing it. - Residual, not a blocker: the probe trusts exit 0 alone, so a stub that starts and returns 0 without running the snippet is still taken (I reproduced it with an
exit /b 0stand-in). The real Store alias exits 9009, so the reported bug is fixed; if you want belt-and-braces, have the snippet print a marker and require it on stdout.
Merge is clean against current main — boot.ps1 grew around the section but its Python block is untouched, and the merged file passes the six tests.
|
Verified on Windows 11, on a second machine with a different Python setup. Head
On a real PATH, no stand-ins. This machine has several interpreters. The first
So the "older than 3.12" case in the description is not hypothetical: One small note: Not checked: a full boot with the game (no game files here). GPUs tested: n/a (script-only check). AI-assisted: yes (Claude Code). |
|
Independent interpreter selection with installed Python versions at
The fixture covers selection and process arguments. Windows Store alias and process-tree timeout behavior are covered by the native Windows tests above. MEASURED. AI-assisted (Codex). |
…e leaves no process (BOOT-PS1-PYTHON-ALIAS) The older-Python stand-in only exited 1, so changing (3, 12) in Test-Python left every test green. A stand-in now runs Test-Python's own check with sys.version_info set: 3.11.9 is passed over for py -3 and 3.12.0 is taken. The hanging stand-in sleeps in a Python child with a unique tag on its command line, and the test asserts that no process holding the tag is left once Resolve-Python returns. Test-Python's comment now gives the requirement it follows: the repository needs 3.12+ (README.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the reviews and the runs on other setups. KelboLive's three points. The new commit changes the test only; the probe in
Mutations,
Kal0s-design's note on
AI-assisted (Claude Code). |
|
Independent Python floor and timeout check on the updated head A hanging local parent and child triggered the resolver’s cleanup request with the parent PID. The resolver selected MEASURED with synthetic candidates. AI-assisted (Codex). |
|
Merging. Head AI-assisted (Claude Code). |
Claimed in the coordination issue as: BOOT-PS1-PYTHON-ALIAS (#1608 (comment))
What and why
scripts/windows-boot/boot.ps1picks the Python fortools/boot_trace.pywithResolve-Python, which takespythonas soon asGet-Commandfinds it. On WindowsGet-Commandalso finds the Microsoft Store's app execution alias,%LOCALAPPDATA%\Microsoft\WindowsApps\python.exe, which only prints how to install Python and exits 9009. On a machine where Python is installed throughpy(the Python install manager without thepythonalias), the boot runs, but<name>.summary.txtholds onlyand
py -3is never tried. The same happens with apythonolder than 3.12, which cannot runboot_trace.py.Change:
Test-Python: starts the candidate with-I -c "import sys; sys.exit(sys.version_info < (3, 12))"and accepts it on exit 0. It waits at most 15 s; a candidate that has not exited by then is ended with its child processes (taskkill /T /F) and passed over, so a Python that hangs cannot hold the script after the game has stopped.Resolve-Pythontriespython, thenpy -3, and takes the first that is found and passesTest-Python.-Pythonis still used as given.no usable Python 3.12+ found for tools/boot_trace.py (checked 'python' and 'py -3'; specify -Python to use another interpreter)..PARAMETER Pythonsays so.Nothing changes for a
pythonthat works (a python.org install, or Python from the Microsoft Store itself): it passes the check and is taken as before. The check costs one short Python start, after the game has stopped.New test,
tests/test_boot_ps1_python.py(standard library, Windows only): it takesTest-PythonandResolve-Pythonout ofboot.ps1and runs them in Windows PowerShell with stand-inpython.cmd/py.cmdon a barePATH:py -3;python(the interpreter running the test) is taken;pythonolder than 3.12 is passed over;pythonthat hangs is given up on after 15 s forpy -3, with no process left behind;-Pythonis used as given.With
main'sResolve-Pythonin place, four of the six fail (the alias, the old Python, the hang and the none cases); with the change all pass.Tested
On
f107ae044, Windows 11 Home 26300.9974, Windows PowerShell 5.1, Python 3.14.10 from the install manager (py;pythonis only the Store alias, exit 9009):python -I tests/test_boot_ps1_python.py: all 6 tests passed in 3 consecutive runs. Againstmain'sResolve-Python, 4 of the 6 tests fail.boot.ps1 -DigestOnly -Name firston an earlier boot of mine. Withmainthe summary is the Store message above; with this branch it is theboot_trace.pyreport (16 lines).python -I tests/test_boot_trace.py,python -I tests/test_docs_cli_flags.py: pass.python -I scripts/check_no_game_data.pyon both files: passes.GPUs tested: not relevant to this change; the end-to-end test was run on an AMD Radeon RX 9060 XT.
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator rule)🤖 Generated with Claude Code