Stop a build that Cancel was pressed for before it started.

Cancel while the tools were checked (before make_game.py started) set the flag but found no process to stop, and
the 10 to 25 minute build then ran anyway until Cancel was pressed again. The job now stops before starting the
build, and stops one Cancel caught as it started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-08 08:54:29 -05:00
parent 4ab121d67e
commit 1196448719

View File

@@ -239,7 +239,13 @@ class Job:
elif kind == 'error':
self.error = ev.get('message', '')
# Cancel pressed before the build started (while the tools were checked) found no process to stop: it stops
# here, and one pressed while the process starts stops it at once
if self.cancelled():
raise net.Cancelled()
self.proc = build.Run(build.command(self.ctx.layout, args), on_event, self.log)
if self.cancelled():
self.proc.cancel()
code = self.proc.wait()
err = self.proc.error
self.proc = None