From patchwork Mon Mar 16 15:47:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2000 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773676127; bh=/grLavhjKTYsmt+ZtxKBonIDc0/9uKhYlFa84hIdN5U=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=rzVVMPCJMczRDQm3mG4WQmO4CQoNDydn4OwXYhdOkZDuqVy7sevp0RXPU2xcEzqJZ L7fsOQq0k3xgpQG8rQ4fD0/GtqojygRvfRLGtJ5JNJQ33GvHPGLPYCM4sTbscaJEQp a9dSoeJyjljjD0ottWLJjsX2d1/dFAmoeBUftb1TLeYm2zV1sNuT5wxeR4zh7hnyGl 984kSgq+PgaGpqzZieFvZH9nxOl2fh0z8r2nfQgUp6i4la9yf9aLOYhiTe8XsOIqMF Tf8Q6TvFSPWPwNgGTaAl8f1b11cBYYukN6J/VdR/d2FslGj72rg37FUA053eEYXdga y2H5O+J6yhMyA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C30AA6A061 for ; Mon, 16 Mar 2026 09:48:47 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id O8Tc75Ij2bJY for ; Mon, 16 Mar 2026 09:48:47 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773676127; bh=/grLavhjKTYsmt+ZtxKBonIDc0/9uKhYlFa84hIdN5U=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=rzVVMPCJMczRDQm3mG4WQmO4CQoNDydn4OwXYhdOkZDuqVy7sevp0RXPU2xcEzqJZ L7fsOQq0k3xgpQG8rQ4fD0/GtqojygRvfRLGtJ5JNJQ33GvHPGLPYCM4sTbscaJEQp a9dSoeJyjljjD0ottWLJjsX2d1/dFAmoeBUftb1TLeYm2zV1sNuT5wxeR4zh7hnyGl 984kSgq+PgaGpqzZieFvZH9nxOl2fh0z8r2nfQgUp6i4la9yf9aLOYhiTe8XsOIqMF Tf8Q6TvFSPWPwNgGTaAl8f1b11cBYYukN6J/VdR/d2FslGj72rg37FUA053eEYXdga y2H5O+J6yhMyA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B2F8D6A081 for ; Mon, 16 Mar 2026 09:48:47 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773676126; bh=eFva4daHltDP4HuXCy/QFP9LPWZG1G1Jf6670c4rAFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vWN9GRMQWjVFEhkVXewxW7ITRQDHZ2o3fHAo3vADbxI7cS/G4ejPVqre31+W6TSoW 5/LVhZG7TYMVlosQSoM0/j8B2UwQ1XY59mDZKQ2k43EKg9VdTde5e6iiD3d0jUWbk6 UxLuQ/ZJ2nIqou34WJ41Bfig/xnexmKry1/G8xSwkeXlhx1OwxRDmdT19haVycJKhq tQiUbUHWPZax454RMA83kb/3+X1vBvDRPZGkk2wYJz1uwX/2o5+iz0pnylSoAyzVCG SNMVhPo7qohFx9mhjRfp9qY/rP2n+jg/iordNqqex1B5xDbcz3uNWaXX1F8R+cTDY4 CPLTt+kYP/o9Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 92BB96A061; Mon, 16 Mar 2026 09:48:46 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id WecqWcwhvtp1; Mon, 16 Mar 2026 09:48:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773676120; bh=RVOCrvKJm3qriICtJ2mX7K1MrtU5+qp2jpu4nELMvAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OyfzFu60lillY1cwwbSJXNkaG2/4/9fj27X4EfmPGCH3buKNRYfTig4mDgjF8F+1A nPdgyXlHIrAXOsLYdRk7fA0Ei9H89mhmnm3qaurOociJqhBiRxh+67Jf6AcfIICaRU uxnC2WGsGqBgRL4I8wNwJaxGasUsJPqbfN02oKVG/+J7WKmGZGpZekIfDMFDHhoCIy WXsmQsWbRZ+QEffy4Rgq4U3qjNtWD7AabLQ/DcilM1F1jPvLbr6kIQmbmkbE8DKyqB TZQtaenAuCSY2JAddIqs03d7wFiA3kIUoJkCfKnK9raA9tjcUePQFZSNRHOKZfbazI 7Rjh6jplzgOiQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C19916A07C; Mon, 16 Mar 2026 09:48:39 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 16 Mar 2026 09:47:13 -0600 Message-ID: <20260316154733.1587261-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260316154733.1587261-1-sjg@u-boot.org> References: <20260316154733.1587261-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QWQMYTOZJIZ7RWAHXHULEC5VLO3PYJ74 X-Message-ID-Hash: QWQMYTOZJIZ7RWAHXHULEC5VLO3PYJ74 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/20] buildman: Add handle_signals param to Builder List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The distributed-build worker manages its own signal handling (SIGTERM, SIGINT, SIGHUP) to clean up child processes on exit. Add a handle_signals parameter (default True) so the worker can skip Builder's built-in SIGINT handler and avoid conflicting with its own. Signed-off-by: Simon Glass --- tools/buildman/builder.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index f64331d0fb1..53ec604f654 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -231,7 +231,8 @@ class Builder: force_reconfig=False, in_tree=False, force_config_on_failure=False, make_func=None, dtc_skip=False, build_target=None, - thread_class=builderthread.BuilderThread): + thread_class=builderthread.BuilderThread, + handle_signals=True): """Create a new Builder object Args: @@ -289,6 +290,9 @@ class Builder: builderthread.BuilderThread). This allows the caller to override how results are processed, e.g. sending over SSH instead of writing to disk. + handle_signals (bool): True to register SIGINT handler (default + True). Set to False when running inside a worker that has + its own signal handling. """ self.toolchains = toolchains self.base_dir = base_dir @@ -380,7 +384,8 @@ class Builder: self._re_make_err = re.compile('|'.join(ignore_lines)) # Handle existing graceful with SIGINT / Ctrl-C - signal.signal(signal.SIGINT, self._signal_handler) + if handle_signals: + signal.signal(signal.SIGINT, self._signal_handler) def _setup_threads(self, mrproper, per_board_out_dir, test_thread_exceptions):