fix(builder): the Linux builder shows its clock and countdown during a build #2150

Merged
jarynclouatre merged 1 commit from fix/linux-builder-clock into main 2026-11-11 20:38:06 +00:00
jarynclouatre commented 2026-11-11 05:05:08 +00:00 (Migrated from github.com)

During a build, the line under the progress bar in the Linux builder stays empty: no elapsed time, no compile clock, no "about N minutes left". Only an update shows it.

tick writes that line and calls itself again a second later only while make_game.py runs. build reached it through show_progress, which runs before make_game.py is started, so the first call found no process and the clock never started. start_make_update calls tick again once make_game.py runs, which is why updates were fine. It has been this way since the Linux builder was added, so the countdown added later has never shown in a Linux build.

build now starts the clock after starting make_game.py, as start_make_update does, and show_progress no longer calls tick, since nothing runs yet at either of its callers. on_exit clears the line: with the clock running, a build cancelled or stopped while compiling would otherwise keep "about 20 minutes left" under "The build stopped". A finished build already says how long it took in the line above.

Testing (Linux, Tk 8.6)

  • The real window on Xvfb, with make_game.py replaced by a stand-in that prints @@stage compile and @@eta 600 and then sleeps. Before, the line is empty for the whole run. After, it reads Elapsed 0:00:01 · compiling 0:00 · about 10 minutes left and counts each second, and it's empty again after Cancel. An update counts as before.
  • tests/test_linux_builder_clock.py (new) runs the builder's own tick and on_exit on a stand-in window, without Tk or a display. tests/test_linux_builder_jobs.py now expects the clock to start after the process. On main, 1 and 7 of them fail.
  • Not tested: a full build from the AppImage.
During a build, the line under the progress bar in the Linux builder stays empty: no elapsed time, no compile clock, no "about N minutes left". Only an update shows it. `tick` writes that line and calls itself again a second later only while make_game.py runs. `build` reached it through `show_progress`, which runs before make_game.py is started, so the first call found no process and the clock never started. `start_make_update` calls `tick` again once make_game.py runs, which is why updates were fine. It has been this way since the Linux builder was added, so the countdown added later has never shown in a Linux build. `build` now starts the clock after starting make_game.py, as `start_make_update` does, and `show_progress` no longer calls `tick`, since nothing runs yet at either of its callers. `on_exit` clears the line: with the clock running, a build cancelled or stopped while compiling would otherwise keep "about 20 minutes left" under "The build stopped". A finished build already says how long it took in the line above. **Testing (Linux, Tk 8.6)** - The real window on Xvfb, with make_game.py replaced by a stand-in that prints `@@stage compile` and `@@eta 600` and then sleeps. Before, the line is empty for the whole run. After, it reads `Elapsed 0:00:01 · compiling 0:00 · about 10 minutes left` and counts each second, and it's empty again after Cancel. An update counts as before. - `tests/test_linux_builder_clock.py` (new) runs the builder's own `tick` and `on_exit` on a stand-in window, without Tk or a display. `tests/test_linux_builder_jobs.py` now expects the clock to start after the process. On main, 1 and 7 of them fail. - Not tested: a full build from the AppImage.
Joey-Magnus (Migrated from github.com) approved these changes 2026-11-11 20:06:54 +00:00
Joey-Magnus (Migrated from github.com) left a comment

Nice catch, and a clean fix. tick only reschedules itself while self.proc is running, so calling it from show_progress before the Popen could never start the clock. Moving the call to after the process starts matches start_make_update. The show_progress call in begin_update loses nothing either, since no process runs there yet. Clearing time_text in on_exit is also needed now that the clock really runs. The pending after(1000) tick then finds proc as None and stops, which your test_it_ends_with_the_build covers. show_progress already resets eta and compile_started, so a second build after a stopped one doesn't show the first build's countdown.

I ran the new test_linux_builder_clock.py, the updated test_linux_builder_jobs.py and the other checks that read builder/linux/hookshot_builder.py (test_builder_*, test_desktop_exec, test_disk_warning, test_prepare_at_build, test_make_game_ngx, test_linux_play_diagnostics) at the PR's head on Linux: all pass, except two .NET-only checks that skip here. CI is green, and the branch still merges cleanly onto current main.

Nothing to change from my side.

Nice catch, and a clean fix. `tick` only reschedules itself while `self.proc` is running, so calling it from `show_progress` before the `Popen` could never start the clock. Moving the call to after the process starts matches `start_make_update`. The `show_progress` call in `begin_update` loses nothing either, since no process runs there yet. Clearing `time_text` in `on_exit` is also needed now that the clock really runs. The pending `after(1000)` tick then finds `proc` as `None` and stops, which your `test_it_ends_with_the_build` covers. `show_progress` already resets `eta` and `compile_started`, so a second build after a stopped one doesn't show the first build's countdown. I ran the new `test_linux_builder_clock.py`, the updated `test_linux_builder_jobs.py` and the other checks that read `builder/linux/hookshot_builder.py` (`test_builder_*`, `test_desktop_exec`, `test_disk_warning`, `test_prepare_at_build`, `test_make_game_ngx`, `test_linux_play_diagnostics`) at the PR's head on Linux: all pass, except two .NET-only checks that skip here. CI is green, and the branch still merges cleanly onto current main. Nothing to change from my side.
Commenting is not possible because the repository is archived.
No description provided.