make_game: report a stage that raises instead of failing silently (BUILD-STAGES-EXCEPTION-DIAG) #1857
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1857
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/build-stages-exception-diag"
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?
Pull request successfully merged and closed
BUILD-STAGES-EXCEPTION-DIAG
Claimed on #1608 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163485212). Fixes @cheltyi's finding (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163281819):
run_build_stages' series loop and both wait/final-future handlers catch everyExceptionassumingfail()already printed, so a stage raising anything else (e.g. aPermissionErrorfrom a permission/disk/copy failure) exits 1 with empty stderr — verified against the finding's synthetic repro in both overlap modes.What
report_unexpected(name, exc)helper insiderun_build_stages: skipsfail()'s ownRuntimeError("stage exited...")sys.exit path, deduplicates per stage, printsERROR: stage '<name>' failed with an unexpected exception: {exc!r}plus a traceback to stderr — once per build, never duplicated between the wait() and drain handlers.wait(), final drain).What was run (CPU-only, no game files)
python3 -m compileall -q make_game.py— OK.python3 tests/test_leonida_tui.py— 27 tests OK (includes the newUnexpectedStageExceptionTestcovering both overlap modes: exit 1, stderr names the stage + exception, exactly one report).python3 -m unittest discover -s tests -p "test_make_game_*.py"— 443 OK, 4 skipped;"test_*stage*"— 166 OK, 1 skipped.make_game.pymakes both new tests fail ('shaders' not found in ''); restored, they pass.Attribution
AI-assisted (GLM 5.3 Flash worker implementation, contributor verification and orchestration).
Tested
93a0f21f4on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmain71a769d7d(build tool; no GPU):tests/test_leonida_tui.py: 27 passed (2 warnings) at this head.main: 2 failed, 25 passed — the stage-raises diagnostic cases are new.make_gamebuild; the tests inject the failing stage.AI-assisted; synthetic fixtures only, no game data.
@GeorgiyDemo — thank you. Recorded for the merge decision:
test_leonida_tui.pyis 27/27 at93a0f21f4on the native runner, and the same file onmainfails exactly the two new stage-raises cases (the guard is real — an external demonstration that the fix, not the test, carries the behavior). Not-run noted: no fullmake_gamebuild with a genuinely failing stage; that path matches the finding's synthetic repro (PermissionErrorfrom a patched stage) which the new tests inject the same way. AI-assisted (orchestrator).Merged. Thank you, @thiefyzheng. A stage that raises now reports its name and the exception on stderr instead of failing silently.
mainand pass here; the docs, line-ending and CI/ctest registration checks pass, and so does the game-data check.mainfe1553456+93a0f21f4: the semantic suite passes (490 files, 6,292 tests, 0 files failed);test_leonida_tuipass; the 14 docs and writer tests pass;check_no_game_data.pyis clean on the 2 changed files.AI-assisted (Claude Code, Claude Opus 5.5).