fix(builder): the Linux builder gives this build's reason for stopping, not the last one's #2159

Merged
jarynclouatre merged 1 commit from fix/linux-builder-stop-reason into main 2026-11-11 20:37:08 +00:00
jarynclouatre commented 2026-11-11 05:19:35 +00:00 (Migrated from github.com)

After a build that was cancelled or stopped with a reason, a later build that ends without a reason of its own shows the earlier one. For example: cancel a build, go Back, build again, and have make_game.py killed from outside (the system's low-memory killer does this). The page then says "The build stopped: Build cancelled. You can start again from the same folder." for a build nobody cancelled.

The reason is self.error, set by make_game.py's @@error line or by Cancel, and nothing cleared it between builds. self.built (the folder from @@done) was kept the same way. show_progress now clears both with the rest of a run's state, and a build with no reason says "see the lines above", as a first build already did.

Testing (Linux, Tk 8.6)

  • The real window on Xvfb with a stand-in make_game.py: build, Cancel, Back, build, SIGKILL. Before: "Build cancelled…". After: "see the lines above".
  • tests/test_linux_builder_stop_reason.py (new) runs the builder's own on_line, cancel and on_exit, and what show_progress sets before it draws, on a stand-in window without Tk. 3 of its 4 tests fail on main.
After a build that was cancelled or stopped with a reason, a later build that ends without a reason of its own shows the earlier one. For example: cancel a build, go Back, build again, and have make_game.py killed from outside (the system's low-memory killer does this). The page then says "The build stopped: Build cancelled. You can start again from the same folder." for a build nobody cancelled. The reason is `self.error`, set by make_game.py's `@@error` line or by Cancel, and nothing cleared it between builds. `self.built` (the folder from `@@done`) was kept the same way. `show_progress` now clears both with the rest of a run's state, and a build with no reason says "see the lines above", as a first build already did. **Testing (Linux, Tk 8.6)** - The real window on Xvfb with a stand-in make_game.py: build, Cancel, Back, build, SIGKILL. Before: "Build cancelled…". After: "see the lines above". - `tests/test_linux_builder_stop_reason.py` (new) runs the builder's own `on_line`, `cancel` and `on_exit`, and what `show_progress` sets before it draws, on a stand-in window without Tk. 3 of its 4 tests fail on main.
Joey-Magnus (Migrated from github.com) approved these changes 2026-11-11 20:07:00 +00:00
Joey-Magnus (Migrated from github.com) left a comment

Looks good to me. show_progress is the one place both a build (build, builder/linux/hookshot_builder.py:1049) and an update (begin_update, :944) go through before make_game.py starts, so clearing self.built and self.error there (:1069) resets them for every run, and nothing sets either of them before that point. on_exit keeps the "see the lines above" fallback now that error can be None (:1237). The stale built was harmless in practice because on_exit also needs exit code 0 and game_ready(folder), but it's right to clear it with the rest.

The new test runs the real on_line, cancel and on_exit rather than copies of them, and it cuts show_progress at px = . If someone later moves the reset below that line, the test fails instead of passing on a stub, which is the behaviour we want. It merges cleanly with main, and CI passes on Ubuntu and Windows.

Looks good to me. `show_progress` is the one place both a build (`build`, `builder/linux/hookshot_builder.py:1049`) and an update (`begin_update`, `:944`) go through before `make_game.py` starts, so clearing `self.built` and `self.error` there (`:1069`) resets them for every run, and nothing sets either of them before that point. `on_exit` keeps the "see the lines above" fallback now that `error` can be `None` (`:1237`). The stale `built` was harmless in practice because `on_exit` also needs exit code 0 and `game_ready(folder)`, but it's right to clear it with the rest. The new test runs the real `on_line`, `cancel` and `on_exit` rather than copies of them, and it cuts `show_progress` at `px = `. If someone later moves the reset below that line, the test fails instead of passing on a stub, which is the behaviour we want. It merges cleanly with main, and CI passes on Ubuntu and Windows.
Commenting is not possible because the repository is archived.
No description provided.