From patchwork Tue Jan 6 22:03:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1332 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=1767737192; bh=dYV14zgvJ1/vpMAF7R2zJf09I1F6Qu5hdSkRDh4s54Y=; 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=tvHpzR/EED2J8/KD9jqk+Bfym6bQivd24I9Sz41BT2tdso+yeTZmb8Jq0rzCfT0Bt 6j6Q1VdtH/jSdHllvY7hKAF7cMhiR1ZFIB9an5P80SsLd8cM9041dNRmdypXf/PTUF R3/kEmvia2XQTygX1iK4dwvXKKclwVBtto1UgkjHz1YMWR/01tjScPFtMdp89a2bc0 pyeeaGFPiweouosLT2Z6pNnxCZ8EqbduRx/BhdEyN/Yf1BPvfS5aXwezvurb8LA0uX kR+yPAf8Z5bDXVsySCzSIHbwhyCdh8KEHyo7xUquFoqAOPGKLVqnUVCS4UL9AiqLpf hPKjq59KYLr+Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 41C8369162 for ; Tue, 6 Jan 2026 15:06:32 -0700 (MST) 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 0ZUYpSVgVVh9 for ; Tue, 6 Jan 2026 15:06:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737192; bh=dYV14zgvJ1/vpMAF7R2zJf09I1F6Qu5hdSkRDh4s54Y=; 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=tvHpzR/EED2J8/KD9jqk+Bfym6bQivd24I9Sz41BT2tdso+yeTZmb8Jq0rzCfT0Bt 6j6Q1VdtH/jSdHllvY7hKAF7cMhiR1ZFIB9an5P80SsLd8cM9041dNRmdypXf/PTUF R3/kEmvia2XQTygX1iK4dwvXKKclwVBtto1UgkjHz1YMWR/01tjScPFtMdp89a2bc0 pyeeaGFPiweouosLT2Z6pNnxCZ8EqbduRx/BhdEyN/Yf1BPvfS5aXwezvurb8LA0uX kR+yPAf8Z5bDXVsySCzSIHbwhyCdh8KEHyo7xUquFoqAOPGKLVqnUVCS4UL9AiqLpf hPKjq59KYLr+Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2D7BC690CB for ; Tue, 6 Jan 2026 15:06:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737189; bh=+5q4PSC9eeqhxxHISB0UR53Tpv1YZyolmyxlNSSa1ak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tBEnh1LzhR46NmDocJPV8/+xlZC5TP0wMAm6gCq7Vt0T7NGIlPoAvgRJDlg3tg+Gb 0fCCBz5iEYwlKwqg1THnEDq0YVegFPFQKwGd/LInP4DuIgWF2Tg1PGVcIksjMlf1oX pUNvtYWXNUPXmolQNT6rOspyKmzOWGTulYrByDwJwHDqKLa12ZyK9lP4qehBQ8NRFL kAUxz5u8JUwSdvFyKv7WsAHgva0Y4+9bqefK4Vj/D9hi878+lTzG/xGdey7h1MtZT+ 4424hf155I/ccNwF4wfK9ptNQc1XhYVAPU1xnufJjSx9IpKAys2yCPTDMlij2W43WT NnAy/WDe8HBrQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE436690CB; Tue, 6 Jan 2026 15:06:29 -0700 (MST) 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 gc5fNWnghHKR; Tue, 6 Jan 2026 15:06:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737185; bh=D5CG+JSLn9HIOYOGmso52mLgk8FZ6nyjthcdLdV8f5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ejwn49y+VIUq5NppfoCzpWtrTPK4k+SjGLaBPSezdsTbGQC6hTJ0JjRF62sRghSYi B+uN23HvZtqi6VsMwCvE+SB1BdD0cpCHQSRtdejrM0TzOYtSgNu1LQZBJTWvvCHpmb x8MEj3bq6WaBJGLoJqUXh7QAUATdq8MLYVyWg34S/D8HXY+Uo2vwESd6d6i8T+PF5U EtUQukiWfL1t+ykkjkracrhjqAC0gZxqQfn9jMtYiWy9dM3wo/pMkBEyzaeP7Pd9xy Zu7gTbeBuLF1qHUmrVpqOCUk8qnt++GGzpW8vADsgsjuPDrhdrB4wpARfmhdLanfHE EdTuozI2YU25w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7F6835FF82; Tue, 6 Jan 2026 15:06:25 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:47 -0700 Message-ID: <20260106220403.2915630-30-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260106220403.2915630-1-sjg@u-boot.org> References: <20260106220403.2915630-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CQBMJJ6K5RF5JN3TVR3YMZ2OQVWZ4OAM X-Message-ID-Hash: CQBMJJ6K5RF5JN3TVR3YMZ2OQVWZ4OAM 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 , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 29/29] buildman: Extract thread setup from __init__() in builder.py 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 Move the thread setup code into _setup_threads() to improve readability and reduce the complexity of __init__(). Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 0d6e7d1732c..d92748b01e9 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -445,6 +445,26 @@ class Builder: self._base_config = None self._base_environment = None + self._setup_threads(mrproper, per_board_out_dir, test_thread_exceptions) + + ignore_lines = ['(make.*Waiting for unfinished)', + '(Segmentation fault)'] + self.re_make_err = re.compile('|'.join(ignore_lines)) + + # Handle existing graceful with SIGINT / Ctrl-C + signal.signal(signal.SIGINT, self.signal_handler) + + def _setup_threads(self, mrproper, per_board_out_dir, + test_thread_exceptions): + """Set up builder threads + + Args: + mrproper (bool): True to run 'make mrproper' before building + per_board_out_dir (bool): True to use a separate output directory + per board + test_thread_exceptions (bool): True to make threads raise an + exception instead of reporting their result (for tests) + """ if self.num_threads: self._single_builder = None self.queue = queue.Queue() @@ -465,9 +485,6 @@ class Builder: self._single_builder = builderthread.BuilderThread( self, -1, mrproper, per_board_out_dir) - # Handle existing graceful with SIGINT / Ctrl-C - signal.signal(signal.SIGINT, self.signal_handler) - def __del__(self): """Get rid of all threads created by the builder""" self.threads.clear()