mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:55:52 +01:00
[PR #1378] make_game: a run without the LEONIDA board still writes <work>/logs/<stage>.log (MAKE-GAME-PLAIN-LOG) #1408
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1408
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1378
Author: @Diegobecker07
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:make-game-plain-log📝 Commits (1)
16f3831make_game: a run without the LEONIDA board still writes /logs/.log (MAKE-GAME-PLAIN-LOG)📊 Changes
3 files changed (+287 additions, -8 deletions)
View changed files
📝
README.md(+2 -2)📝
make_game.py(+120 -6)➕
tests/test_make_game_plain_logs.py(+165 -0)📄 Description
Claimed in the coordination issue as: MAKE-GAME-PLAIN-LOG (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7146425751)
What and why
Only the LEONIDA board wrote the stage logs (
make_game.py, theLeonidaBoard(build_stages, log_dir)branch ofmain()), so a build with--no-tui, or with stdout redirected, left nothing in<work>/logsto read afterwards. With a multi-hour build that is the run you most want a log of.PlainStageLogs(inmake_game.py) is active while the build stages run without the board:log()andfail()lines go to the console as before, and to the running stage's<work>/logs/<stage>.log, the files the board writes (opened in append mode, as there).run()starts for a build stage has its stdout and stderr through one pipe. Every byte goes on to the console as it arrives (read1, so a\rprogress line still redraws in place), and every\r- or\n-ended piece to the stage's log, with the same split asleonida_tui.pump_process.CREATE_NO_WINDOW), so Ctrl+C reaches it as before. On Ctrl+C it gets 0.25 s to stop and is then killed, assubprocess.rundoes.check, preflight), keepsubprocess.rununchanged.tests/test_make_game_paths.pybuilds into a work folder on a volume that does not exist).tools/leonida_tui.pyis not touched: the class reuses itsStageConsole, so this does not overlap #1305.What changes on the console in plain mode: a child now writes to a pipe instead of the console, as it already does under the board. Ninja, for example, prints its status one line per step instead of redrawing one line. A tool that writes straight to the console handle (
WriteConsole) still shows there but is not in the log.The module docstring, the
--no-tuihelp and the README say where the logs are in both modes.Tested
tests/test_make_game_plain_logs.py(new, 9 tests, real child processes, 4 runs):log()/fail()lines per stage, bytes mirrored unchanged (a\rprogress line, a\r\n, stderr after stdout, an unended last piece) and the pieces logged, a failing command's exit code and itsERROR:line, caller pipes and unlogged stages kept onsubprocess.run,cwd/envreaching the child, Ctrl+C stopping the child, an unwritable log folder, append across two runs, nothing written without a build stage.tests/test_make_game_*.py,tests/test_leonida_tui.py,tests/test_text_write_line_endings.py: OK.test_make_game_paths.pycaught the first version, which created the folder up front.python -m compileall -q make_game.py tools tests,python -I make_game.py --help,scripts/check_no_game_data.pyon the changed files: OK.make_game.py --stages runtime --runtime-build <a built runtime> --no-tuiinto a scratch--out/--work: exit 0, the console unchanged, andwork/logs/runtime.logholds the stage's lines.GPUs tested: n/a (no GPU code)
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)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.