From a7c1a8256e51e558a2b6b169a5fceefb53079d91 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Tue, 11 Aug 2026 06:33:51 -0700 Subject: [PATCH] [eric] build: a cancelled build reaps its whole process tree, so a killed run no longer orphans a 7za holding a 300MB archive for hours (ENG-247) --- scripts/build-app.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/build-app.sh b/scripts/build-app.sh index c8f6e2e3..9ea4aa4f 100755 --- a/scripts/build-app.sh +++ b/scripts/build-app.sh @@ -1,6 +1,12 @@ #!/bin/bash set -euo pipefail +# Killing this build (Ctrl-C, or a parent that gets killed) used to orphan electron-builder's 7za +# child, which then sat for HOURS holding a ~300MB archive open (found one aged 20h). Run in our own +# process group and sweep it on any exit so a cancelled build takes its whole tree with it (ENG-247). +set -m +trap 'pkill -P $$ 2>/dev/null; kill -- -$$ 2>/dev/null' EXIT INT TERM + # Master build script for the OpenSwarm desktop app. # # Usage: