From patchwork Tue Jan 6 22:03:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1304 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=1767737065; bh=KklfDkWcmewSH8okaKq5hHO5FGCicXhMrN5Ji6s4apU=; 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=Tl0+qUomzmJ4J100oq14d3V3FLDl143zOgyaZYff7hm5VVHlyrujqAMkoGE2FafZ/ H/1stjS+VXlF/7wyyqUb6QutxJwT07NVli0GsEK+aCf7nPj+aGIGJYf5Nq//4YY0Aw 12KvMLbwkT9nb90jmGdikcL5i1lzdAvi6ggVay17wsRzt8J5qsH6wvScFF5ugvrAtp 0s34vMFBBIjHEdY3BjWxJUxbDCF5Mgjy/NO4NkF56mVWrbrG7wDGFIPyBrdzZUM+1Q Be6vXo8DCa4fl8b0iLdjA/IpnrCjJJ+l+akSCXrHITKSiZ5Nh04q35KwODVdKhyYO+ 1tzNOh+LFKo7A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C28DF69158 for ; Tue, 6 Jan 2026 15:04:25 -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 bXfEl6DRG1B9 for ; Tue, 6 Jan 2026 15:04:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737065; bh=KklfDkWcmewSH8okaKq5hHO5FGCicXhMrN5Ji6s4apU=; 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=Tl0+qUomzmJ4J100oq14d3V3FLDl143zOgyaZYff7hm5VVHlyrujqAMkoGE2FafZ/ H/1stjS+VXlF/7wyyqUb6QutxJwT07NVli0GsEK+aCf7nPj+aGIGJYf5Nq//4YY0Aw 12KvMLbwkT9nb90jmGdikcL5i1lzdAvi6ggVay17wsRzt8J5qsH6wvScFF5ugvrAtp 0s34vMFBBIjHEdY3BjWxJUxbDCF5Mgjy/NO4NkF56mVWrbrG7wDGFIPyBrdzZUM+1Q Be6vXo8DCa4fl8b0iLdjA/IpnrCjJJ+l+akSCXrHITKSiZ5Nh04q35KwODVdKhyYO+ 1tzNOh+LFKo7A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AE18369146 for ; Tue, 6 Jan 2026 15:04:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737063; bh=o3N8Zg3nbWMbOlh6mJUmT3Qu9xu/kehYMkjkYHdpENQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pcGMbkdN9PnLPSUfAbSjtfBJWO1e/FEL8NQLgClvIGAIYUA9NR90/rnpKdNrUIzN/ 1ujtOIUEtnSaH5jjNbnWGkYEpGkN/WZtG7o9UILWeY++IACDqjlgyYvS6cmo7locuX uZDf4xdxp2NVIeWPBnn99zlxBsDnb0azNFBxKsqaaRHKc5YyhpnwL57FlYdjz4fM3z +3nZKI2KOEHdxLpBq8yDHcRCifM2ukTQ8/0WJQZaivfpPy7HJgkhzh1Uibw04kDoGi jwZy6NIDXY06LOzfNjJfGSlUq5TkDAGjW44V2CXesbe9Sn53VbcdsyWjGjkkBg2GBr 815BDewfkWTmg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1CA3E69145; Tue, 6 Jan 2026 15:04:23 -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 2pTgEx7xMd8Q; Tue, 6 Jan 2026 15:04:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737058; bh=ibGEV9k0bh3aOg03y8H38wZiF2OLRB+NVwKSyp8t0kM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gq7gV3pGRaPQj/cZ0GEvwjDu5WlZwxUDb/nACVq8XmPaOkhhPKn2QXgG30IwfWSQh IpO5R6H+PNrHwVV6SMpCEUwkvTksvYz99kLQLhJMeNXZJ97KdBBMSpup3Tc6Y/2Yk/ HpeNBdrRRv36nNnKm9VbvxZPiykM9j+0Keh3FsZvAULOrg/pwFOqI3/X6r0X32KbWJ 4ooJUurMt4HBgwvtFjByqsBRpDGTSGysdMJ7sYUFn8htg3KYWXofFGa2m6H+UMtFqb bsSEY2bCUQOdO6QrOCK8cFCRvanAxRyDWCW/PoYVOqkluAlFfCFdYZygIL33oD9cMP X65BxxgVIcoUg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A583B690CB; Tue, 6 Jan 2026 15:04:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:19 -0700 Message-ID: <20260106220403.2915630-2-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: KQYF2IFAVJW52OHNNXJLHZRX5E5GMPGV X-Message-ID-Hash: KQYF2IFAVJW52OHNNXJLHZRX5E5GMPGV 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 Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/29] buildman: Remove unused imports from 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 Remove unused imports of 'string', 'time' and 'toolchain' modules. The only reference to 'toolchain' uses a method parameter that shadows the import. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builder.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 28943a5a9b8..4d8a083ddd9 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -12,13 +12,10 @@ import re import queue import shutil import signal -import string import sys import threading -import time from buildman import builderthread -from buildman import toolchain from u_boot_pylib import command from u_boot_pylib import gitutil from u_boot_pylib import terminal From patchwork Tue Jan 6 22:03:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1305 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=1767737069; bh=nxHPc7UW2+W/vDILx/6E2ddeVlZJELWd8UHxq4bLloU=; 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=lpGEp770FXit++1I9t9C4P8wa6r4NEsq0WDJX3YQc4KIg0GlDwszIZEE+7L3ueCSN 169M8cojq7p7ZMewasiG/UYEHfeoaZ9SDvNdwwBZ/H+3v1i/xB+TNrSha2bA+TWMsE y9/Pzng1RQ7uf/YsT5Rerq/uh5BYVJ+W1eQHhUpVXs7JBRo206yL+SwQoT/D3f8y0g uQ4iZyaI5cjmaUqZcjovhpdmV6o5hYSG3vA3V3S+jQgTTkKfvaVsv9nU2JfLNPsvH0 4SFwDO2fYqJa6Jh4YxHwxSLx5jqCPMcD5IwKs42kTwGuc01GcR3LNT7tvtbnJ2qSgP uk3TLIbDJEfJQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4F04A690CB for ; Tue, 6 Jan 2026 15:04: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 10024) with ESMTP id WpW9onvnw3Z5 for ; Tue, 6 Jan 2026 15:04:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737069; bh=nxHPc7UW2+W/vDILx/6E2ddeVlZJELWd8UHxq4bLloU=; 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=lpGEp770FXit++1I9t9C4P8wa6r4NEsq0WDJX3YQc4KIg0GlDwszIZEE+7L3ueCSN 169M8cojq7p7ZMewasiG/UYEHfeoaZ9SDvNdwwBZ/H+3v1i/xB+TNrSha2bA+TWMsE y9/Pzng1RQ7uf/YsT5Rerq/uh5BYVJ+W1eQHhUpVXs7JBRo206yL+SwQoT/D3f8y0g uQ4iZyaI5cjmaUqZcjovhpdmV6o5hYSG3vA3V3S+jQgTTkKfvaVsv9nU2JfLNPsvH0 4SFwDO2fYqJa6Jh4YxHwxSLx5jqCPMcD5IwKs42kTwGuc01GcR3LNT7tvtbnJ2qSgP uk3TLIbDJEfJQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3E7FF69155 for ; Tue, 6 Jan 2026 15:04:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737068; bh=ZcCmH6kB8oOzQ24XVUGlUpAnN7lewM6SHLYG6BffBT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UNazfo0S57SytA5bEAHthsLGz6kam4MG08VmckF+msFdVz/2sHivpDFUHSvUsa8lM lW4SKD7xRxXgn5fftFZk6X6GiWOUJW6kA8cTvyNJXEC5w7Tequg+ncn2B5Q10E/ObD QxOVfP1oGDnXiXBfb15OCmAW8aIXBip0Oir6j8c3NKIehBphUpvdz0O6fYjdZqmQ0f WaKv1ebSSOp5Ug08gKqDLPgoGRdYn8Hgj4WvEuNgELjT4xuG+lo8e7Tp2VmFEOrYHb XZKu7D3VuRWasPvtnVQW03/mdKtwXP1B/jyn0In9fsEylKcJTKLtU0j2BtAVLsXvzm ah18A4368VAEw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3636169155; Tue, 6 Jan 2026 15:04:28 -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 4BdFO1826knZ; Tue, 6 Jan 2026 15:04:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737063; bh=qkql9+QYvbmeZcvhlR6iNor1hpRknsPFJwFk3mhjWwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JofUg6Mmvm/cUeozrpgiyBpV/6Q/pnEDqHZDGwmUk01Kc7nLvvrARZej4ImcUkACX jO7tzoa7UbUPevE3roS7VS3dclRcPian+kdK5mSFKdOxyDqrA3x8fZSBGcay1jSyUw 1qDBjih03Lu02Ri5K6vgRWW241tTNT/C/qrmZsfv7C7InTlSLfAG36eC3CBW1jbeKa 8mBZ/RBu6Hi+7ov5tzuX+DSQgepCUr+jv6PGkfyAYkFj8NtDW0aN4I1DZflHKj4XrW Ua9PesoM0+BTVqQDI21tFoOuS4PnB8dY9jHaRnxETgdlgy35IruQFMOnhnq5jYNTw0 rso01tnsVNpog== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5F7ED690CB; Tue, 6 Jan 2026 15:04:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:20 -0700 Message-ID: <20260106220403.2915630-3-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: O2A7EBWQL7S4KEZVXGWMWVZ3MXV3XYH3 X-Message-ID-Hash: O2A7EBWQL7S4KEZVXGWMWVZ3MXV3XYH3 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 02/29] buildman: Fix bad indentation 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 Fix three locations with incorrect indentation: - _get_func_sizes_for_elf(): Body of if statement was over-indented - print_func_size_detail(): Loop body was over-indented - produce_result_summary(): Entire function body was over-indented These issues were flagged by pylint W0311 (bad-indentation). Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 54 +++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 4d8a083ddd9..cb349120467 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -737,12 +737,12 @@ class Builder: line = line.strip() parts = line.split() if line and len(parts) == 3: - size, type, name = line.split() - if type in NM_SYMBOL_TYPES: - # function names begin with '.' on 64-bit powerpc - if '.' in name[1:]: - name = 'static.' + name.split('.')[0] - sym[name] = sym.get(name, 0) + int(size, 16) + size, type, name = line.split() + if type in NM_SYMBOL_TYPES: + # function names begin with '.' on 64-bit powerpc + if '.' in name[1:]: + name = 'static.' + name.split('.')[0] + sym[name] = sym.get(name, 0) + int(size, 16) return sym def _process_config(self, fname): @@ -1064,12 +1064,12 @@ class Builder: delta.append([new[name], name]) for name in common: - diff = new.get(name, 0) - old.get(name, 0) - if diff > 0: - grow, up = grow + 1, up + diff - elif diff < 0: - shrink, down = shrink + 1, down - diff - delta.append([diff, name]) + diff = new.get(name, 0) - old.get(name, 0) + if diff > 0: + grow, up = grow + 1, up + diff + elif diff < 0: + shrink, down = shrink + 1, down - diff + delta.append([diff, name]) delta.sort() delta.reverse() @@ -1621,21 +1621,21 @@ class Builder: ', '.join(not_built))) def produce_result_summary(self, commit_upto, commits, board_selected): - (board_dict, err_lines, err_line_boards, warn_lines, - warn_line_boards, config, environment) = self.get_result_summary( - board_selected, commit_upto, - read_func_sizes=self._show_bloat, - read_config=self._show_config, - read_environment=self._show_environment) - if commits: - msg = '%02d: %s' % (commit_upto + 1, - commits[commit_upto].subject) - tprint(msg, colour=self.col.BLUE) - self.print_result_summary(board_selected, board_dict, - err_lines if self._show_errors else [], err_line_boards, - warn_lines if self._show_errors else [], warn_line_boards, - config, environment, self._show_sizes, self._show_detail, - self._show_bloat, self._show_config, self._show_environment) + (board_dict, err_lines, err_line_boards, warn_lines, + warn_line_boards, config, environment) = self.get_result_summary( + board_selected, commit_upto, + read_func_sizes=self._show_bloat, + read_config=self._show_config, + read_environment=self._show_environment) + if commits: + msg = '%02d: %s' % (commit_upto + 1, + commits[commit_upto].subject) + tprint(msg, colour=self.col.BLUE) + self.print_result_summary(board_selected, board_dict, + err_lines if self._show_errors else [], err_line_boards, + warn_lines if self._show_errors else [], warn_line_boards, + config, environment, self._show_sizes, self._show_detail, + self._show_bloat, self._show_config, self._show_environment) def show_summary(self, commits, board_selected): """Show a build summary for U-Boot for a given board list. From patchwork Tue Jan 6 22:03:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1306 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=1767737073; bh=f3HOJFcQy6hHMlxOW6fcEcw9SYw3snye/evzVKMvb2E=; 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=ikWFqZkelgtkuAif3pCGoXK0oR0tIAsf/84077wySw4Mt6rfAprXLJrpY46+XnxRd TYbIhARvOEWor1IEHQ6Mvv5yNpLlmtwprTG/nVDtoBwb8W1o32wnO79bCb1hrfde1V E0mj6iK5oMLhUH2b9iCfeN/LEKGwm+YudGJ4Rz5z9IIYR78pi5Wf/3co2gGpQIkBkQ BtgZ0SjYGpd9scqg9buxOE6/4senO8s+eAM+VUKB0H5OX6cloWeRystDe1IlG8kbEm Ur0mbgodIuSDgOX1ABoOgHbEqBMUggR4zrvSdxikPv3Kf7Kmg9Odiflhf+LDtNhLmx HtfukixcfwSmw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C7AE269158 for ; Tue, 6 Jan 2026 15:04:33 -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 P0kzp66KNeUb for ; Tue, 6 Jan 2026 15:04:33 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737073; bh=f3HOJFcQy6hHMlxOW6fcEcw9SYw3snye/evzVKMvb2E=; 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=ikWFqZkelgtkuAif3pCGoXK0oR0tIAsf/84077wySw4Mt6rfAprXLJrpY46+XnxRd TYbIhARvOEWor1IEHQ6Mvv5yNpLlmtwprTG/nVDtoBwb8W1o32wnO79bCb1hrfde1V E0mj6iK5oMLhUH2b9iCfeN/LEKGwm+YudGJ4Rz5z9IIYR78pi5Wf/3co2gGpQIkBkQ BtgZ0SjYGpd9scqg9buxOE6/4senO8s+eAM+VUKB0H5OX6cloWeRystDe1IlG8kbEm Ur0mbgodIuSDgOX1ABoOgHbEqBMUggR4zrvSdxikPv3Kf7Kmg9Odiflhf+LDtNhLmx HtfukixcfwSmw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B5692690CB for ; Tue, 6 Jan 2026 15:04:33 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737072; bh=m1lBdLCuzs1l7ixbEwwsLCZ4uKpnpTfuuitovDGur5I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LF3xTwnZ1VWzByioNZ6rSSv03ZPUJmmBZOiFfv8nI9TBCVObDl0iSDtQ00W3+GP6o Ns0jqCXJAeisxth0ROKR7zgqgCZlgDPGwd12gnHWRnsnH+nJhgbN71I0zlY/MlRDcv SRP4S3Ibetu7cMefwzDIrcIvdMLNDCuU84rgxBp3lMcljgSRq3ouOu2sCDSBDj2Gn5 N7QUhR9iy68GJ8C4MnwUbYlsBk7/gcAax5+k3ItLJuyyFHWnWtdp3l4/e+OXiPY5gJ RpKsgUu8OaefY6JV9i092TP84G0YmioPhF/R18RICGi6NFjRd8P4w7DDWFhXjohkbN e7wnBcdAcFhnA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D44A690CB; Tue, 6 Jan 2026 15:04: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 10026) with ESMTP id UTdzwZ6uEpn2; Tue, 6 Jan 2026 15:04:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737068; bh=JahlyiqdrVKAZKuLc8NqbPrSWdbiIVNGwdOFVwFqoF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uX73X26kW8FKIVC+ehUayAlA3hY8h//2Xnf7C+PBO7kjLifOTjTwAvqW41Vqn7BhC EdSSjw1blAD2Gd8icp3WVl5FzM64HRWlHkqbcET0ZOtAMPRqVw+6l/O8SYlzvTDpGd 1bYsaO6TMQyjXikVdp/PKGXfJKi7BAh4zSfmyRpCvHdDPSgYQhH0a+Sp0gF/FnPEfU 57K1NnV4RJq2CY3ZhGKuCBWLSu5IYIwx773dYGcnTBvPCXZVYnbIMV3SDJ5cqwz4Us SApn7u63/Yw75fZ/J9H13+cyX/GxQ9Z8l3N1P18ZFgQTrMta27GutTj3NOlQ/jqhJO YLBMZYa1kS1Qw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CBE4269146; Tue, 6 Jan 2026 15:04:27 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:21 -0700 Message-ID: <20260106220403.2915630-4-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: 7THRUR7B7DHNH5B6H7LI75Q65DLUUIBM X-Message-ID-Hash: 7THRUR7B7DHNH5B6H7LI75Q65DLUUIBM 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 03/29] buildman: Replace setDaemon() with daemon property 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index cb349120467..63456542b54 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -395,12 +395,12 @@ class Builder: t = builderthread.BuilderThread( self, i, mrproper, per_board_out_dir, test_exception=test_thread_exceptions) - t.setDaemon(True) + t.daemon = True t.start() self.threads.append(t) t = builderthread.ResultThread(self) - t.setDaemon(True) + t.daemon = True t.start() self.threads.append(t) else: @@ -1849,7 +1849,7 @@ class Builder: if self.num_threads: term = threading.Thread(target=self.queue.join) - term.setDaemon(True) + term.daemon = True term.start() while term.is_alive(): term.join(100) From patchwork Tue Jan 6 22:03:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1307 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=1767737078; bh=6o6M2okFqb+/4FQ7Xdm+p52NrxBJ0r4i7571R0wtENM=; 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=l/iLbxwfdzmsguJzj5Lh4nXU/hgcNs28mNFgTckrN98zuiF2FTsytM8uDFMndWQH7 4Q7zooU/0Rt+7EkboOfquyzI2pz83vDIKw9iuwaQ2E6H8sWSn2KPiLYjNidTJXTZjE d5H/jeQsU7xRl3vwO+LMhYkVwbn8evP0steFGY8S9aU6bBoSFzJMTcYh3F20FqE7LD 87EV7dypTqqaztleOjNaFMcs3uttnj131uy54VnLN584aBom7oFZI5qla4iNzi70tL m7zgxLOFnjbGqh1uOldsyCxzoqCqdq7cI3Sy2/KaYA3bOtIR7C/Es1XVtql/9oP7nZ efDzcVNCADwLQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 418DF69158 for ; Tue, 6 Jan 2026 15:04:38 -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 ZzibADJXvty5 for ; Tue, 6 Jan 2026 15:04:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737078; bh=6o6M2okFqb+/4FQ7Xdm+p52NrxBJ0r4i7571R0wtENM=; 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=l/iLbxwfdzmsguJzj5Lh4nXU/hgcNs28mNFgTckrN98zuiF2FTsytM8uDFMndWQH7 4Q7zooU/0Rt+7EkboOfquyzI2pz83vDIKw9iuwaQ2E6H8sWSn2KPiLYjNidTJXTZjE d5H/jeQsU7xRl3vwO+LMhYkVwbn8evP0steFGY8S9aU6bBoSFzJMTcYh3F20FqE7LD 87EV7dypTqqaztleOjNaFMcs3uttnj131uy54VnLN584aBom7oFZI5qla4iNzi70tL m7zgxLOFnjbGqh1uOldsyCxzoqCqdq7cI3Sy2/KaYA3bOtIR7C/Es1XVtql/9oP7nZ efDzcVNCADwLQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 29A9569146 for ; Tue, 6 Jan 2026 15:04:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737077; bh=7fBMCGlND57NU/ZtTwiIRhB5uJESpbb6Qy0PpXGLsjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z/C0H2Ho7V06+cfZOco8rkpq+g7AkjOhtIDL+C1fmCxBgnwWZnX343I3JHx9sJ3TH /80FarOxCHsOzPPmUHAW4/APEJYn8dOSaNMpGLh0MTtKvAMDMTtT8bd2hXEaoAYYhR zvvuf1dAx7RKPmwOoX5GIRxPbUPXKBOmKe+FrMvgTHMVjjtxs7eLDKCw4bYPN++ptM L49fFn+nNpKF2gdMRCk+xCsmqpyckVOf6WdPh1sXol+2DKlC+eUvrpym4nQBoQNlw6 qkruiHkuE0t2zwr68aFX4cDj8DFpKe7uoHUl9eMWi8trQTMNBWwXsIGkU7IK5Dk+of Ml5542V4r7GFQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1243A5FF82; Tue, 6 Jan 2026 15:04:37 -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 61NL2pjcJ13L; Tue, 6 Jan 2026 15:04:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737072; bh=4OXC/J5dBnUVsQ2rt5GEF7JSAZpRHztF3XAlixjMfCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PxjQCNkiX09wSKTukOwCXk3dBQ1K3B8uW4YcwFimcriSGcr6DopFOUIz9zZ5xl//h fpPaKmIjETyq1l0in2WsluwHnMUGeio1oiL/Fk2b7fM0x8FDtU6GAofXvdHF+ghm0B x46k2Cx7U30L0uygnufgp/rD7ZZA4xngVqdHwMwMrdHOPQM7xRejqZrLlhqwIfCpp0 WkCfRiwEuFf2r4u01Nf8/Iv8cPv96RsXExk4nxMAbcts/+xSSYihVTUdBwoPLy6RqS dgTspCmyRousZrYE5rsd6qR4PjF/dqvytfAl3WNvYlV0b4ml30COX2gjRsdvmBnHw0 UDRxv4nuEShhQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8D19A69146; Tue, 6 Jan 2026 15:04:32 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:22 -0700 Message-ID: <20260106220403.2915630-5-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: HYLM65JPGV4WY52X4HO5UGIXRGMISWL2 X-Message-ID-Hash: HYLM65JPGV4WY52X4HO5UGIXRGMISWL2 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 04/29] buildman: Add explicit encoding to open() calls 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 Add encoding='utf-8' to all open() calls to avoid implicit encoding assumptions. This fixes pylint W1514 (unspecified-encoding) warnings. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 63456542b54..7582f178e8c 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -761,7 +761,7 @@ class Builder: """ config = {} if os.path.exists(fname): - with open(fname) as fd: + with open(fname, encoding='utf-8') as fd: for line in fd: line = line.strip() if line.startswith('#define'): @@ -797,7 +797,7 @@ class Builder: """ environment = {} if os.path.exists(fname): - with open(fname) as fd: + with open(fname, encoding='utf-8') as fd: for line in fd.read().split('\0'): try: key, value = line.split('=', 1) @@ -828,7 +828,7 @@ class Builder: config = {} environment = {} if os.path.exists(done_file): - with open(done_file, 'r') as fd: + with open(done_file, 'r', encoding='utf-8') as fd: try: return_code = int(fd.readline()) except ValueError: @@ -838,7 +838,7 @@ class Builder: err_lines = [] err_file = self.get_err_file(commit_upto, target) if os.path.exists(err_file): - with open(err_file, 'r') as fd: + with open(err_file, 'r', encoding='utf-8') as fd: err_lines = self.filter_errors(fd.readlines()) # Decide whether the build was ok, failed or created warnings @@ -851,7 +851,7 @@ class Builder: # Convert size information to our simple format if os.path.exists(sizes_file): - with open(sizes_file, 'r') as fd: + with open(sizes_file, 'r', encoding='utf-8') as fd: for line in fd.readlines(): values = line.split() rodata = 0 @@ -870,7 +870,7 @@ class Builder: if read_func_sizes: pattern = self.get_func_sizes_file(commit_upto, target, '*') for fname in glob.glob(pattern): - with open(fname, 'r') as fd: + with open(fname, 'r', encoding='utf-8') as fd: dict_name = os.path.basename(fname).replace('.sizes', '') func_sizes[dict_name] = self.read_func_sizes(fname, fd) From patchwork Tue Jan 6 22:03:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1308 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=1767737084; bh=aFq8I5M22rcZqd2zR6zU2Qa/fhg2LjHoQJJ2mPKTKFw=; 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=dE9MabWsB4u+inpYAR9DbfiLYFJojsi/Aa+ZwjpwYbP3HgB9e7IMy6ulYdkyqHDMQ fJTLBfhP/PyW0pyiNsTs30D4GsmHSiQRwlAqmicstQPiemkl1fAe9GgSzJ5Q2RT5Id AMWVvbNjes7kpOZFvRXnb7an6UaW0aYz+3k0Nd3wC9G+DK2tXqCjC3R9T/54SHtJpT 2IpvbfjuuOGBptCzpr84XKrnFXZMSs0OAnoT2bhaoAeRKRY2NFZYhkcQ3W18CW4RHj Ep7ba399x6uD7eyd5eNCz8Na6XY9rbYJC12Qn+/IoiNM48NHLeQ3V6QknBMBHEU9YB MWG4WX9Wio+9g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D7BDC5FF82 for ; Tue, 6 Jan 2026 15:04:44 -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 JV3l5FwStYut for ; Tue, 6 Jan 2026 15:04:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737083; bh=aFq8I5M22rcZqd2zR6zU2Qa/fhg2LjHoQJJ2mPKTKFw=; 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=m5e6LZzxJJZQ2/8Lr+0sSUrftWw1krogOPGhmD/nw8qyhufZxEKr0SE0c7k8ZcZHG Q8YGz1EDoPvjP+zdgzVkO8VvceHjkbhR+Q8jls3s4Yz8aNNZlBH5NItm5NFNN0PJm9 QGEoy684OXkuwimdA9RX70TQU1PFjnAo2FobSd/2JyPkx47iZXBeivKPEnxxBYuy3O VK+8ThY2Iy0E690FES5+xOK85llm4ry/JzbKCEjeCnMWKIMwaoEQRWxPFdtMtGflhD PIosVxcgNFdGiGckIh0TPPw7lpqdSWP3fSNkGuHzTMrh6CD6X0TwJYwpHa6HLVIOqW dbQ4VWiiOEKfQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EDA7B690CB for ; Tue, 6 Jan 2026 15:04:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737082; bh=4Wtsle4ZtY3xIaaVqWB7i+Y4YoeD1YRD2HSxxuAGIqs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CUpIQPDmbWCa2nDmc6yKSJzRfKKSV4ptTferNGNaGMfXLSlOXssAz7AC0pX+M+b3y qQ2XtFJ6NKKLchjp1JH5ztLIz7i3T2PjJRUKpVko0vD7BZbHDsaqT7nRdhOnQlgBa4 RRckSb2Miwl7a9I2ze9uY2MsBi41UGmAzmBdNp2YybhfOZOgWk7TqkGqIJUSrNitT0 OXBkOGmtGYZh0j50gnr1/OooMj59+OCgAQG2Bc/ZxhSMd9LaM9oT2Jy0iMXs8uuyKF T7mmyR4JXB10kUXntp3OXAdv9dnER0RH+5fx7BpivgdiWIa6MbNkOgyaMwLJZvpfzU Dgg/yEidvhCAg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A0C985FF82; Tue, 6 Jan 2026 15:04:42 -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 ZG-M9ETXkrbS; Tue, 6 Jan 2026 15:04:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737077; bh=xTb5rfGuurZLr72aRuz5Kd/HX7EHRkHGopqt7BI0EFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kz+zAebbr3FReU7qLwAbEDY2cJt9e4XUe8zoKVt9jbxk6gql4XriOcpPizAwWr6nh qec+n15t/FkCF6yso374HfHco2NxA43zxiVqdWOf6WbLxgvjjL537c5N1uFRHUaaI8 +sfhp/ufpdq5/B/IVFAQpCxxqZYcqAZJ+7MAuNkl/KYILIX5beDfROjn6mE88rcrF7 B/90QZzWQ6vi0rLtdQfsBWKy4FcMc7zRrBS1bBIjcBewFAoiHRepdklD5K7Rjqewa4 K7+zw6dpVg1vIu9sypI6bAcdJDciVVVMrUaK1tn693DBjIs3Rl7K9BnE+DcWQ6+SFw 9zdTXyUdCH+aw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 507C6690CB; Tue, 6 Jan 2026 15:04:37 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:23 -0700 Message-ID: <20260106220403.2915630-6-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: VIAQ4IBKNUM3B6FNXAQHC4V3OZUHECEI X-Message-ID-Hash: VIAQ4IBKNUM3B6FNXAQHC4V3OZUHECEI 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 05/29] buildman: Remove unused variables from 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 Remove two unused 'col' variables: - In process_result(): col was created but self.col was used instead - In get_result_summary(): col was set to None but never used Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 7582f178e8c..5a31f9aba19 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -559,7 +559,6 @@ class Builder: result: A CommandResult object, which indicates the result for a single build """ - col = terminal.Color() if result: target = result.brd.target @@ -1173,7 +1172,6 @@ class Builder: # Loop through the text, data, bss parts for part in sorted(sizes[image]): diff = sizes[image][part] - base_image[part] - col = None if diff: if image == 'u-boot': name = part From patchwork Tue Jan 6 22:03:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1309 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=1767737088; bh=iIO4xiVrVGAE+5c2moYN/40xJwWGSa0dSwDlFSvkxK0=; 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=K7mQuVK1wPWKUbPW4QtoSUcYjinAPEHvtQMwmqpkzDCqVKJwc8JISXIPhaw8r90yX 2/S1/i9XnF4K0NSQQopgUrdIJFy95reQQEZeT34N6X/WvPbzQ70K7eaKrF7+U/EM5I HyWEZV3vjAf/hFViraei36KUMNek8zGDZ3VOQwkCER+1JBtbPyMwHYIN+r3s6i6qa0 XG0xYxSow1j0/vR7UcU1AATEPSUvQiKqGxiMgAZMne4A/C/kT58zV5h/Ox7oMKJQ4W jJftYE4BgFGdffjnDZY0laUyR2iyBfsWWDFS+M8cL1lW19N2SXqlB4/tmWpmNHjlZD OP6pn06hrmXow== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 750F26915C for ; Tue, 6 Jan 2026 15:04:48 -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 1E_vh3AoZa2X for ; Tue, 6 Jan 2026 15:04:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737088; bh=iIO4xiVrVGAE+5c2moYN/40xJwWGSa0dSwDlFSvkxK0=; 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=K7mQuVK1wPWKUbPW4QtoSUcYjinAPEHvtQMwmqpkzDCqVKJwc8JISXIPhaw8r90yX 2/S1/i9XnF4K0NSQQopgUrdIJFy95reQQEZeT34N6X/WvPbzQ70K7eaKrF7+U/EM5I HyWEZV3vjAf/hFViraei36KUMNek8zGDZ3VOQwkCER+1JBtbPyMwHYIN+r3s6i6qa0 XG0xYxSow1j0/vR7UcU1AATEPSUvQiKqGxiMgAZMne4A/C/kT58zV5h/Ox7oMKJQ4W jJftYE4BgFGdffjnDZY0laUyR2iyBfsWWDFS+M8cL1lW19N2SXqlB4/tmWpmNHjlZD OP6pn06hrmXow== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6513F69146 for ; Tue, 6 Jan 2026 15:04:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737087; bh=0uqGgZEwXH8fuKKpXpG+rHE1OJtHiaZdcaL+qxVXHik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jg5lJ2+WdZa4aWXNWiMTGDmw4oPY+NcP2FuPXrtFC7X7Ui/kxC02LH23l8kSOY3XK osmeYh8e6XGrNJaHREEMBWTjsY9abE+r3lcMc3wr8Zcq/Z3dy/DejGIoTZc8hhicWP XniIMVoGptdTVkgx5L6isv2Wsm/82TYI4rmVf+jLdOlK8JDtdJ9Xmmq5BfyqsZZpRh 9JfWzL+sillcfzG6M+Eu8uQjWUo7GH/cCFH2YeZkdOPBkloKuMzZvlJxX2Unz3zS6E q1NfVndSd2lLDMMIvF3untHe+SDJu7vGTiih67NL8VgDv7taquVGp+QNWTK4cnCTSg OWpxgDeeyPACA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 46C8F69158; Tue, 6 Jan 2026 15:04:47 -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 K62xx5vadEnY; Tue, 6 Jan 2026 15:04:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737082; bh=3ZBp/DcuIh0911k2VewsFCZAKjsTjUDBsJtpOyW5TdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jLWG3f7l6ujhHsvX9qF2ZeStrq9g7VU/PKd0YMjRbT6nhnIsxz8NPRUyEC62ELxtV qHccY325zuepHdPYIZKHfc9AFWCJ+HQGnhd+55SkJRnaSrPtqzKMo8FOtEWFBnkAOf I8cEJMPKRPm7wYtz7qbX6gQC7QGGPXm2OA9pW5bH1mQgb1aFh2MDzYQBf/8+el9PVR T5XkcjgdctaQKGiR9JADWIp2W2bDppIyHtUkRnAUywVo7t95SRbCcKOXeRZjz0fK17 coLfxxPTpPS5bjm/pwUhWTLx4lhZ41ihqGC7rw+oM8oIxDB8S4kew6t89hHwXlPgRc DH6etGY1EydvQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 12EE969146; Tue, 6 Jan 2026 15:04:42 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:24 -0700 Message-ID: <20260106220403.2915630-7-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: T5J4YDVWYSJL766OTTKEEKEPWI5EEFJ6 X-Message-ID-Hash: T5J4YDVWYSJL766OTTKEEKEPWI5EEFJ6 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 06/29] buildman: Rename variables that shadow builtins 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 Rename 'type' to 'sym_type' in _get_func_sizes_for_elf() and 'str' to 'text' in add_target_list() to avoid shadowing Python built-in names. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 5a31f9aba19..1c6a38b232e 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -736,8 +736,8 @@ class Builder: line = line.strip() parts = line.split() if line and len(parts) == 3: - size, type, name = line.split() - if type in NM_SYMBOL_TYPES: + size, sym_type, name = line.split() + if sym_type in NM_SYMBOL_TYPES: # function names begin with '.' on 64-bit powerpc if '.' in name[1:]: name = 'static.' + name.split('.')[0] @@ -1003,14 +1003,14 @@ class Builder: arch = board_dict[target].arch else: arch = 'unknown' - str = self.col.build(color, ' ' + target) + text = self.col.build(color, ' ' + target) if not arch in done_arch: - str = ' %s %s' % (self.col.build(color, char), str) + text = ' %s %s' % (self.col.build(color, char), text) done_arch[arch] = True if not arch in arch_list: - arch_list[arch] = str + arch_list[arch] = text else: - arch_list[arch] += str + arch_list[arch] += text def colour_num(self, num): From patchwork Tue Jan 6 22:03:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1310 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=1767737092; bh=Qc0IDINb2K1dXhiTguwP0ca1qRyCRDBBmRl/8DBR8VM=; 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=pCnUd4ZUKuTlUhLLod+iPs8GkwGv0OJ28CMSdYYaQ7nyf4zzJI1IdgDNRhV4lOmXL pNn+5ESNeBPMgyUKgVDM979JGzWt9QzpirVKwpijziGAaBR0jDftzuCbBFjEWnU58n GRgcF6fkeBK93T0mRS5Qg/sO+R6Hz/qPACgJ5Z9PAo4MtIdn6wnKkEC9apc2AWFa+1 xLQVDfIJ/wAWAfrfgJwvc1aoK+eauFCM2PEFw40eJqIclTc/MurNpcGT9ADEOcAi9E /RTG8QcnptTg+b6iXOXdWrhjP86ceGMTqdMIKxKKWlDa0GxtVkTkTe9kqlSiGtx+ZB MZDprYU+VfWmw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E482169158 for ; Tue, 6 Jan 2026 15:04:52 -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 G4_IaJW1FSED for ; Tue, 6 Jan 2026 15:04:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737092; bh=Qc0IDINb2K1dXhiTguwP0ca1qRyCRDBBmRl/8DBR8VM=; 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=pCnUd4ZUKuTlUhLLod+iPs8GkwGv0OJ28CMSdYYaQ7nyf4zzJI1IdgDNRhV4lOmXL pNn+5ESNeBPMgyUKgVDM979JGzWt9QzpirVKwpijziGAaBR0jDftzuCbBFjEWnU58n GRgcF6fkeBK93T0mRS5Qg/sO+R6Hz/qPACgJ5Z9PAo4MtIdn6wnKkEC9apc2AWFa+1 xLQVDfIJ/wAWAfrfgJwvc1aoK+eauFCM2PEFw40eJqIclTc/MurNpcGT9ADEOcAi9E /RTG8QcnptTg+b6iXOXdWrhjP86ceGMTqdMIKxKKWlDa0GxtVkTkTe9kqlSiGtx+ZB MZDprYU+VfWmw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D4B4A69146 for ; Tue, 6 Jan 2026 15:04:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737091; bh=y53idpP4PUXY7UeIaWzV46rxarcaJ5sTeQ1Uxzeo44U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KGHERnkxNLxqhiwpXvT/14Oxy2eUvbORxcw8V/xj/xzqALsVI68fI+HIrEFT0loCD sv+39RF6GSDpTxF+/KG0Ks9M96A07z+Mn0Jzyq5SwU4ahyG3bSEFfsN7Zl/FuYp/o6 v8x0uI/w2Xdl9YPE9CLKqXamjImZGnMkcxc/zZn62SK7/viEOJjWijDQweWf7eyyRS Mt9sJMESge+8dbg2H00VMFa8rxO7fyyXOggHO6TwQuxzhQNeyAAsKyki0sg3cmeJxg 9mrrN9u9TJuHRWY2Ju8eNfhQ9LkjlnPIx6VeAa8s+cqXelTTWAkv039qy0LcyBszzT e7Fojrg6wUTxA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3D2D25FF82; Tue, 6 Jan 2026 15:04:51 -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 5E_wADCKYZAm; Tue, 6 Jan 2026 15:04:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737087; bh=wDUaw/fjt9wTiCXP0W0maY7agbYTks/fXXZeHmsWVyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H+LYCHT/HvRVXSfR/4K+w6C3yub5S8Sax4fGYoacfPErFQ3PMKCKYXZo0ql7QJGYd qWgRkVSU8N+giXFh8ko+NVMg9e+2a3PZi9LWzPT4Xl7BUwwBAdcY8HYc1hxqlQS5rN bAw4V+3QPuPhVIX/bNxiNPRxXuGif/sh0/OLzZUhIEJBesewZwktkhwsJ/k+avykS6 /rB/NFcylgoePCcvC/q9Ls4r8Zez3lXNJPXvYCrAQrQte0UqV/AOdZIDdOG7JOKNY5 6WASzoeks/ogIMds2nMsEo93sLENJvMx0U4zLZC6HuYihuSgGXJPCB5mptYll6HW4y 7AfW+KB/WKzLg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C1E2E690CB; Tue, 6 Jan 2026 15:04:46 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:25 -0700 Message-ID: <20260106220403.2915630-8-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: XQQLMS6JETT4QHWDL7ML23AATNL6GRLK X-Message-ID-Hash: XQQLMS6JETT4QHWDL7ML23AATNL6GRLK 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 07/29] buildman: Fix minor pylint warnings 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 - Use .items() when iterating over dict in Config.__hash__() - Use clear() instead of iterating over a list in __del__() Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 1c6a38b232e..46ef4bca33f 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -141,8 +141,8 @@ class Config: def __hash__(self): val = 0 - for fname in self.config: - for key, value in self.config[fname].items(): + for fname, config in self.config.items(): + for key, value in config.items(): print(key, value) val = val ^ hash(key) & hash(value) return val @@ -415,8 +415,7 @@ class Builder: def __del__(self): """Get rid of all threads created by the builder""" - for t in self.threads: - del t + self.threads.clear() def signal_handler(self, signal, frame): sys.exit(1) From patchwork Tue Jan 6 22:03:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1311 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=1767737098; bh=VZO1Gs6qIopqt67PvcXRGlJF8/RoADrM1VATYn/UL1E=; 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=oT/IR3JvkeiBXfj+a45kZPPPOsFYXEfBsmYK6/Hn5V0lUfH2DfAxqsaiB/ZGmcXz1 rEvZB0pfvud77PLtD0YapU8G5AmxxRGLrbfnQefYnzAr8zMsMfgPXD6ruL20BilphK wwL8/Qvxe0DStA7kZ+QTd36PTTaMYiTS+FACVeY1DwWST/kvpeufBN5zMCyYiDDiym B2MrniZJ/5q66VnoS4751TXgvkYWKhVLc9nEzGnRPHh6Ck8POap9lS6JDbjDSCs16c hzSzQNeW0anyJbwsb1uu7GgJwrMVifaw5gKSVW4G5xbr+YWkiY2Ck4h06Y+SIXJS1J X3mtMKqc1h8Dg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5882069158 for ; Tue, 6 Jan 2026 15:04:58 -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 XQOW3rpfLY2H for ; Tue, 6 Jan 2026 15:04:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737098; bh=VZO1Gs6qIopqt67PvcXRGlJF8/RoADrM1VATYn/UL1E=; 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=oT/IR3JvkeiBXfj+a45kZPPPOsFYXEfBsmYK6/Hn5V0lUfH2DfAxqsaiB/ZGmcXz1 rEvZB0pfvud77PLtD0YapU8G5AmxxRGLrbfnQefYnzAr8zMsMfgPXD6ruL20BilphK wwL8/Qvxe0DStA7kZ+QTd36PTTaMYiTS+FACVeY1DwWST/kvpeufBN5zMCyYiDDiym B2MrniZJ/5q66VnoS4751TXgvkYWKhVLc9nEzGnRPHh6Ck8POap9lS6JDbjDSCs16c hzSzQNeW0anyJbwsb1uu7GgJwrMVifaw5gKSVW4G5xbr+YWkiY2Ck4h06Y+SIXJS1J X3mtMKqc1h8Dg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 47D3F69146 for ; Tue, 6 Jan 2026 15:04:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737096; bh=jLjc6ffpeYanBL5xMahSmCgeZvrv8hLhCmWQyM5jjpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hoRnlBiiHlYdBMcdc6t4p1gbNeqm1cdFc+o6nY4Qn8i+Qdn799MNlikiIh0mflb61 kracyJCxmEzXUcoS/YsgI9j6T1HN4XP7ydpzuZhUXv8yziXnFhrRM1FwbRuzmzhC1m oyAgL18cL4TRogu8aBTyZk9rVEAVaR5YV/UWN5vGAJQ8Uip4eTQsS3Sgjsqr3mYUZd t4wRjDmNsZXf/Ls/XpxFIY8Isko5txXkISsDZ+byIJvMWRjIVjc2lHuJYqDttFO2dH FSZhMg1QhpVAxlGO+u/AAuERTG17wcBhZkDAtKadqqiyCHUWx2t9J5eXG9M0fx4SAu 1Vsl8eF9zMFIQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 12DC35FF82; Tue, 6 Jan 2026 15:04:56 -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 i7SkYmRoydqP; Tue, 6 Jan 2026 15:04:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737091; bh=jFayDSU6v7elTKzKgx9dX3LjOsCkcZFtVo5+F6qyDu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VlWR6rut3+grhlTmTPxpFfkrabcF+BSmSQRD3QXqd6DjzGfiRi0rswZ/7pkXcIDXt 9hxAS++mZtwLwuFrhLWh6KrgGLjEW/8EQsFu+o1ByHM2okuRig+1MKcOAnj3vaJm+F k9nUyueLRe528L4cSX/fd7laPK7EZqmG26CrsZJABIng9SKF3fV5oYs1lXJ/4cH3Lz 2hxRJIatFawhdcVQQeQIhcKYLisbk4dpulwE9lxLdY3LN5QT8FT8VVg0LWqj1yeJnA Z5nHkFW8vIUmb/J9pQCgTxgL5BCMKOCAe71HbDCuixsAubBlsHVEt2CSNSsjJ/E5+g qeCEU/kG5lesA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 81390690CB; Tue, 6 Jan 2026 15:04:51 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:26 -0700 Message-ID: <20260106220403.2915630-9-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: AGJK7ZTEDMJDSZA6HNMOBQGVEEEWUSDT X-Message-ID-Hash: AGJK7ZTEDMJDSZA6HNMOBQGVEEEWUSDT 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 08/29] buildman: Convert to f-strings 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 Convert all % string formatting to f-strings for improved readability and consistency. This addresses pylint C0209 (consider-using-f-string) warnings. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 99 +++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 46ef4bca33f..f0ad4dd1f79 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -547,8 +547,8 @@ class Builder: result.stderr += '(** did you define an int/hex Kconfig with no default? **)' if self.verbose_build: - result.stdout = '%s\n' % (' '.join(cmd)) + result.stdout - result.combined = '%s\n' % (' '.join(cmd)) + result.combined + result.stdout = f"{' '.join(cmd)}\n" + result.stdout + result.combined = f"{' '.join(cmd)}\n" + result.combined return result def process_result(self, result): @@ -584,21 +584,21 @@ class Builder: # Display separate counts for ok, warned and fail ok = self.upto - self.warned - self.fail - line = '\r' + self.col.build(self.col.GREEN, '%5d' % ok) - line += self.col.build(self.col.YELLOW, '%5d' % self.warned) - line += self.col.build(self.col.RED, '%5d' % self.fail) + line = '\r' + self.col.build(self.col.GREEN, f'{ok:5d}') + line += self.col.build(self.col.YELLOW, f'{self.warned:5d}') + line += self.col.build(self.col.RED, f'{self.fail:5d}') - line += ' /%-5d ' % self.count + line += f' /{self.count:<5d} ' remaining = self.count - self.upto if remaining: - line += self.col.build(self.col.MAGENTA, ' -%-5d ' % remaining) + line += self.col.build(self.col.MAGENTA, f' -{remaining:<5d} ') else: line += ' ' * 8 # Add our current completion time estimate self._add_timestamp() if self._complete_delay: - line += '%s : ' % self._complete_delay + line += f'{self._complete_delay} : ' line += target if not self._ide: @@ -621,8 +621,7 @@ class Builder: commit = self.commits[commit_upto] subject = commit.subject.translate(trans_valid_chars) # See _get_output_space_removals() which parses this name - commit_dir = ('%02d_g%s_%s' % (commit_upto + 1, - commit.hash, subject[:20])) + commit_dir = f'{commit_upto + 1:02d}_g{commit.hash}_{subject[:20]}' elif not self.no_subdirs: commit_dir = 'current' if not commit_dir: @@ -673,7 +672,7 @@ class Builder: elf_fname: Filename of elf image """ return os.path.join(self.get_build_dir(commit_upto, target), - '%s.sizes' % elf_fname.replace('/', '-')) + f"{elf_fname.replace('/', '-')}.sizes") def get_objdump_file(self, commit_upto, target, elf_fname): """Get the name of the objdump file for a commit number and ELF file @@ -684,7 +683,7 @@ class Builder: elf_fname: Filename of elf image """ return os.path.join(self.get_build_dir(commit_upto, target), - '%s.objdump' % elf_fname.replace('/', '-')) + f"{elf_fname.replace('/', '-')}.objdump") def get_err_file(self, commit_upto, target): """Get the name of the err file for a commit number @@ -1004,7 +1003,7 @@ class Builder: arch = 'unknown' text = self.col.build(color, ' ' + target) if not arch in done_arch: - text = ' %s %s' % (self.col.build(color, char), text) + text = f' {self.col.build(color, char)} {text}' done_arch[arch] = True if not arch in arch_list: arch_list[arch] = text @@ -1077,15 +1076,16 @@ class Builder: return args = [self.colour_num(x) for x in args] indent = ' ' * 15 - tprint('%s%s: add: %s/%s, grow: %s/%s bytes: %s/%s (%s)' % - tuple([indent, self.col.build(self.col.YELLOW, fname)] + args)) - tprint('%s %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new', - 'delta')) + tprint(f'{indent}{self.col.build(self.col.YELLOW, fname)}: add: ' + f'{args[0]}/{args[1]}, grow: {args[2]}/{args[3]} bytes: ' + f'{args[4]}/{args[5]} ({args[6]})') + tprint(f'{indent} {"function":<38s} {"old":>7s} {"new":>7s} ' + f'{"delta":>+7s}') for diff, name in delta: if diff: color = self.col.RED if diff > 0 else self.col.GREEN - msg = '%s %-38s %7s %7s %+7d' % (indent, name, - old.get(name, '-'), new.get(name,'-'), diff) + msg = (f'{indent} {name:<38s} {old.get(name, "-"):>7} ' + f'{new.get(name, "-"):>7} {diff:+7d}') tprint(msg, colour=color) @@ -1108,9 +1108,9 @@ class Builder: if name.startswith('_'): continue colour = self.col.RED if diff > 0 else self.col.GREEN - msg = ' %s %+d' % (name, diff) + msg = f' {name} {diff:+d}' if not printed_target: - tprint('%10s %-15s:' % ('', result['_target']), + tprint(f'{"":10s} {result["_target"]:<15s}:', newline=False) printed_target = True tprint(msg, colour=colour, newline=False) @@ -1216,10 +1216,10 @@ class Builder: # architecture avg_diff = float(diff) / count color = self.col.RED if avg_diff > 0 else self.col.GREEN - msg = ' %s %+1.1f' % (name, avg_diff) + msg = f' {name} {avg_diff:+1.1f}' if not printed_arch: - tprint('%10s: (for %d/%d boards)' % (arch, count, - arch_count[arch]), newline=False) + tprint(f'{arch:>10s}: (for {count}/{arch_count[arch]} ' + 'boards)', newline=False) printed_arch = True tprint(msg, colour=color, newline=False) @@ -1333,8 +1333,8 @@ class Builder: """ out = '' for key in sorted(config.keys()): - out += '%s=%s ' % (key, config[key]) - return '%s %s: %s' % (delta, name, out) + out += f'{key}={config[key]} ' + return f'{delta} {name}: {out}' def _add_config(lines, name, config_plus, config_minus, config_change): """Add changes in configuration to a list @@ -1392,7 +1392,7 @@ class Builder: out = self.col.build(colour, line.char + '(') out += self.col.build(self.col.MAGENTA, board_str, bright=False) - out += self.col.build(colour, ') %s' % line.errline) + out += self.col.build(colour, f') {line.errline}') else: out = self.col.build(colour, line.char + line.errline) out_list.append(out) @@ -1459,7 +1459,7 @@ class Builder: self.add_outcome(board_selected, arch_list, unknown_boards, '?', self.col.MAGENTA) for arch, target_list in arch_list.items(): - tprint('%10s: %s' % (arch, target_list)) + tprint(f'{arch:>10s}: {target_list}') self._error_lines += 1 _output_err_lines(better_err, colour=self.col.GREEN) _output_err_lines(worse_err, colour=self.col.RED) @@ -1492,7 +1492,7 @@ class Builder: for key, value in base.items(): new_value = tenvironment.environment.get(key) if new_value and value != new_value: - desc = '%s -> %s' % (value, new_value) + desc = f'{value} -> {new_value}' environment_change[key] = desc _add_config(lines, target, environment_plus, environment_minus, @@ -1553,7 +1553,7 @@ class Builder: for key, value in base.items(): new_value = tconfig.config.get(key) if new_value and value != new_value: - desc = '%s -> %s' % (value, new_value) + desc = f'{value} -> {new_value}' config_change[key] = desc all_config_change[key] = desc @@ -1589,13 +1589,13 @@ class Builder: _add_config(lines, 'all', all_plus, all_minus, all_change) #arch_summary[target] = '\n'.join(lines) if lines: - tprint('%s:' % arch) + tprint(f'{arch}:') _output_config_info(lines) for lines, targets in lines_by_target.items(): if not lines: continue - tprint('%s :' % ' '.join(sorted(targets))) + tprint(f"{' '.join(sorted(targets))} :") _output_config_info(lines.split('\n')) @@ -1614,8 +1614,8 @@ class Builder: if not brd in board_dict: not_built.append(brd) if not_built: - tprint("Boards not built (%d): %s" % (len(not_built), - ', '.join(not_built))) + tprint(f"Boards not built ({len(not_built)}): " + f"{', '.join(not_built)}") def produce_result_summary(self, commit_upto, commits, board_selected): (board_dict, err_lines, err_line_boards, warn_lines, @@ -1625,8 +1625,7 @@ class Builder: read_config=self._show_config, read_environment=self._show_environment) if commits: - msg = '%02d: %s' % (commit_upto + 1, - commits[commit_upto].subject) + msg = f'{commit_upto + 1:02d}: {commits[commit_upto].subject}' tprint(msg, colour=self.col.BLUE) self.print_result_summary(board_selected, board_dict, err_lines if self._show_errors else [], err_line_boards, @@ -1677,7 +1676,7 @@ class Builder: """ if self.work_in_output: return self._working_dir - return os.path.join(self._working_dir, '%02d' % max(thread_num, 0)) + return os.path.join(self._working_dir, f'{max(thread_num, 0):02d}') def _prepare_thread(self, thread_num, setup_git): """Prepare the working directory for a thread. @@ -1703,7 +1702,7 @@ class Builder: if os.path.isdir(git_dir): # This is a clone of the src_dir repo, we can keep using # it but need to fetch from src_dir. - tprint('\rFetching repo for thread %d' % thread_num, + tprint(f'\rFetching repo for thread {thread_num}', newline=False) gitutil.fetch(git_dir, thread_dir) terminal.print_clear() @@ -1714,20 +1713,20 @@ class Builder: elif os.path.exists(git_dir): # Don't know what could trigger this, but we probably # can't create a git worktree/clone here. - raise ValueError('Git dir %s exists, but is not a file ' - 'or a directory.' % git_dir) + raise ValueError(f'Git dir {git_dir} exists, but is not a ' + 'file or a directory.') elif setup_git == 'worktree': - tprint('\rChecking out worktree for thread %d' % thread_num, + tprint(f'\rChecking out worktree for thread {thread_num}', newline=False) gitutil.add_worktree(src_dir, thread_dir) terminal.print_clear() elif setup_git == 'clone' or setup_git == True: - tprint('\rCloning repo for thread %d' % thread_num, + tprint(f'\rCloning repo for thread {thread_num}', newline=False) gitutil.clone(src_dir, thread_dir) terminal.print_clear() else: - raise ValueError("Can't setup git repo with %s." % setup_git) + raise ValueError(f"Can't setup git repo with {setup_git}.") def _prepare_working_space(self, max_threads, setup_git): """Prepare the working directory for use. @@ -1791,7 +1790,7 @@ class Builder: """ to_remove = self._get_output_space_removals() if to_remove: - tprint('Removing %d old build directories...' % len(to_remove), + tprint(f'Removing {len(to_remove)} old build directories...', newline=False) for dirname in to_remove: shutil.rmtree(dirname) @@ -1856,15 +1855,15 @@ class Builder: if not self._ide: tprint() - msg = 'Completed: %d total built' % self.count + msg = f'Completed: {self.count} total built' if self.already_done or self.kconfig_reconfig: parts = [] if self.already_done: - parts.append('%d previously' % self.already_done) + parts.append(f'{self.already_done} previously') if self.already_done != self.count: - parts.append('%d newly' % (self.count - self.already_done)) + parts.append(f'{self.count - self.already_done} newly') if self.kconfig_reconfig: - parts.append('%d reconfig' % self.kconfig_reconfig) + parts.append(f'{self.kconfig_reconfig} reconfig') msg += ' (' + ', '.join(parts) + ')' duration = datetime.now() - self._start_time if duration > timedelta(microseconds=1000000): @@ -1872,10 +1871,10 @@ class Builder: duration = duration + timedelta(seconds=1) duration = duration - timedelta(microseconds=duration.microseconds) rate = float(self.count) / duration.total_seconds() - msg += ', duration %s, rate %1.2f' % (duration, rate) + msg += f', duration {duration}, rate {rate:1.2f}' tprint(msg) if self.thread_exceptions: - tprint('Failed: %d thread exceptions' % len(self.thread_exceptions), + tprint(f'Failed: {len(self.thread_exceptions)} thread exceptions', colour=self.col.RED) return (self.fail, self.warned, self.thread_exceptions) From patchwork Tue Jan 6 22:03:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1312 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=1767737103; bh=DwYJar9NlnMb2uc6OGsZo3ygl4phHxbDfUROZI2tE/4=; 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=hWYo+/sljq6uz3dOBr0zFOcpXx27kcbZ+7eaJZb1K9mQALlBCwcpzKI/PaH2xSmgC Rp6vG7t3NY8oTeBsqwe9f2aJ+vVHEcixjtW1YYT9dZACbCDoWefepsofEBl0fRFmdV sXabiQ2XhXjv1W9lqkw5GLqnkGaIHwlR6Y9+dOWi47qhntMI9E+d1XzC6hkM9twzxu +OhDk7rROK6Yme08fSwiBrNR5zD+Y01qRbafQ0hNdjPl9ymaNT68u1HVaANbZL94te Qi4GXzikEbi2iXC2P1Opz+kb7KlUibxJ8deLfn2phj0LrhZ8aR82TtXDvwy61CZi8s QDzglX+V61agQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 02B6869158 for ; Tue, 6 Jan 2026 15:05:03 -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 ZgE1fJtpOvqq for ; Tue, 6 Jan 2026 15:05:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737102; bh=DwYJar9NlnMb2uc6OGsZo3ygl4phHxbDfUROZI2tE/4=; 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=twjs7sMIQGUTWfEzhSzjtvtUn9+vkj0mdqPiRAdt+IYLZ/7g9NtAaq/sf1UeKvdpA sVudlnk4rA7hioAkW/SlP+kMlIM4sikHi1EtMMCsZggq8wYmsyxFTv67P0OpOTezrn R22MER+HOCXrQb3hLSeM+tvZsiMD6I0B1kayafnfqkwGrzyNAIGN90mBP+0bOHYiY1 JBifKuTWgq13xnQCdR1XQlD1XWmV58QpmV1S166WlgLNydRWt13MZGgCSM0oo/Urdk j/JR2O+l6XGzPyoZU56YsgQTKre3dqcOIrpvaZ3CPN/dzHm2JWMoQdNrhcP4P0/38P brzPcsHyfN8GQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E50D25FF82 for ; Tue, 6 Jan 2026 15:05:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737100; bh=BkxawzzjUBb30JiLADEti/d6hJrdQ6z7X/OUIZBOHWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AzXCLlLKo0Xd0WNvGWtLz7Apsz9UID/5TRU0VmZangiLBws/2r532BcWzLBaaFDPv r0T4ew1aDPscuEYuTyqHCqWC3jcr/50uIk4C2Ohh2bOtMSrvJnM8nt1qcST8/unP8q ei9AZ++IUodyHSkScIKXRWA46apHoCdgNWw+RP2NlFGw46yyEaeL3DeWP53ZEPJFf/ ja7YIpMtA1NkizC2FFgb2YvG/bjrgN3WjiyWuCq1CieGs+zegFSaqVrZnk/0A7Nqky RfbU5BaVTPaTpuwpMv/zAQLbibLxfuSOaDsydMHd7bno+ygd0iNPf23UQz0DuC1zj+ sujUd6l5Zd8hg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DB39E5FF82; Tue, 6 Jan 2026 15:05:00 -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 7vUUSklyBM5O; Tue, 6 Jan 2026 15:05:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737096; bh=uQs+cwNgxJcEhhpoDsJy3i3X8WdjQjqWw8IhSrEfIB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T0ru8mKxzaKacpKbU4dom5h3i0x+mKw+0h9As7+wmzPdRiNJU67qs7mQYXJhl+F4S gHKMqqjnJWelFyju9C2BanbUUOSfpx2qCZiJWVNEa7mFJgPnDWuSd0sgtIr3hRPp5a pB51fUNnTZLIlUJvs0hi+jZgLsbsEpzLQ6TffzsvsbLIbKmt1Bce1pvUCsSQed9C6J tN2oac1FTaXHKetIx/bpv70Wezm/Dp2O8XLg5ELVzMnXSCrckbSqYPVGnkkpCufhBI CLpU+lhTTdNq5MqgSFO99id0iuxSjVHOF7YbJVLbXk7M/F1M8xKzv/QfaV9ULhcktN Z3HGAvhBYYobw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 53FEF690CB; Tue, 6 Jan 2026 15:04:56 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:27 -0700 Message-ID: <20260106220403.2915630-10-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: 43GW2XYORNKLZZCOK3VGR2PRSBN2QXYT X-Message-ID-Hash: 43GW2XYORNKLZZCOK3VGR2PRSBN2QXYT 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 09/29] buildman: Add module docstring and parameter types 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 Tidy up various missing docstrings and add a module docstring. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 245 +++++++++++++++++++++++--------------- 1 file changed, 150 insertions(+), 95 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index f0ad4dd1f79..25e802a104c 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -4,6 +4,8 @@ # Bloat-o-meter code used here Copyright 2004 Matt Mackall # +"""Build manager for U-Boot builds across multiple boards and commits""" + import collections from datetime import datetime, timedelta import glob @@ -137,6 +139,13 @@ class Config: self.config[fname] = {} def add(self, fname, key, value): + """Add a configuration value + + Args: + fname (str): Filename to add to (e.g. '.config') + key (str): Config key (e.g. 'CONFIG_DM') + value (str): Config value (e.g. 'y') + """ self.config[fname][key] = value def __hash__(self): @@ -154,6 +163,12 @@ class Environment: self.environment = {} def add(self, key, value): + """Add an environment variable + + Args: + key (str): Environment variable name + value (str): Environment variable value + """ self.environment[key] = value class Builder: @@ -418,6 +433,12 @@ class Builder: self.threads.clear() def signal_handler(self, signal, frame): + """Handle a signal by exiting + + Args: + signal (int): Signal number + frame (frame): Stack frame at point of signal + """ sys.exit(1) def make_environment(self, toolchain): @@ -444,19 +465,22 @@ class Builder: """Setup display options for the builder. Args: - show_errors: True to show summarised error/warning info - show_sizes: Show size deltas - show_detail: Show size delta detail for each board if show_sizes - show_bloat: Show detail for each function - list_error_boards: Show the boards which caused each error/warning - show_config: Show config deltas - show_environment: Show environment deltas - filter_dtb_warnings: Filter out any warnings from the device-tree - compiler - filter_migration_warnings: Filter out any warnings about migrating - a board to driver model - ide: Create output that can be parsed by an IDE. There is no '+' prefix on - error lines and output on stderr stays on stderr. + show_errors (bool): True to show summarised error/warning info + show_sizes (bool): Show size deltas + show_detail (bool): Show size delta detail for each board if + show_sizes + show_bloat (bool): Show detail for each function + list_error_boards (bool): Show the boards which caused each + error/warning + show_config (bool): Show config deltas + show_environment (bool): Show environment deltas + filter_dtb_warnings (bool): Filter out any warnings from the + device-tree compiler + filter_migration_warnings (bool): Filter out any warnings about + migrating a board to driver model + ide (bool): Create output that can be parsed by an IDE. There is + no '+' prefix on error lines and output on stderr stays on + stderr. """ self._show_errors = show_errors self._show_sizes = show_sizes @@ -500,6 +524,10 @@ class Builder: def select_commit(self, commit, checkout=True): """Checkout the selected commit for this build + + Args: + commit (Commit): Commit object that is being built + checkout (bool): True to checkout the commit """ self.commit = commit if checkout and self.checkout: @@ -509,10 +537,11 @@ class Builder: """Run make Args: - commit: Commit object that is being built - brd: Board object that is being built - stage: Stage that we are at (mrproper, config, oldconfig, build) - cwd: Directory where make should be run + commit (Commit): Commit object that is being built + brd (Board): Board object that is being built + stage (str): Stage that we are at (mrproper, config, oldconfig, + build) + cwd (str): Directory where make should be run args: Arguments to pass to make kwargs: Arguments to pass to command.run_one() """ @@ -555,8 +584,8 @@ class Builder: """Process the result of a build, showing progress information Args: - result: A CommandResult object, which indicates the result for - a single build + result (CommandResult): Result object, which indicates the result + for a single build """ if result: target = result.brd.target @@ -611,7 +640,7 @@ class Builder: The output directory is typically ...//. Args: - commit_upto: Commit number to use (0..self.count-1) + commit_upto (int): Commit number to use (0..self.count-1) """ if self.work_in_output: return self._working_dir @@ -634,8 +663,8 @@ class Builder: The build directory is typically ...///. Args: - commit_upto: Commit number to use (0..self.count-1) - target: Target name + commit_upto (int): Commit number to use (0..self.count-1) + target (str): Target name Return: str: Output directory to use, or '' if None @@ -649,8 +678,8 @@ class Builder: """Get the name of the done file for a commit number Args: - commit_upto: Commit number to use (0..self.count-1) - target: Target name + commit_upto (int): Commit number to use (0..self.count-1) + target (str): Target name """ return os.path.join(self.get_build_dir(commit_upto, target), 'done') @@ -658,8 +687,8 @@ class Builder: """Get the name of the sizes file for a commit number Args: - commit_upto: Commit number to use (0..self.count-1) - target: Target name + commit_upto (int): Commit number to use (0..self.count-1) + target (str): Target name """ return os.path.join(self.get_build_dir(commit_upto, target), 'sizes') @@ -667,9 +696,9 @@ class Builder: """Get the name of the funcsizes file for a commit number and ELF file Args: - commit_upto: Commit number to use (0..self.count-1) - target: Target name - elf_fname: Filename of elf image + commit_upto (int): Commit number to use (0..self.count-1) + target (str): Target name + elf_fname (str): Filename of elf image """ return os.path.join(self.get_build_dir(commit_upto, target), f"{elf_fname.replace('/', '-')}.sizes") @@ -678,9 +707,9 @@ class Builder: """Get the name of the objdump file for a commit number and ELF file Args: - commit_upto: Commit number to use (0..self.count-1) - target: Target name - elf_fname: Filename of elf image + commit_upto (int): Commit number to use (0..self.count-1) + target (str): Target name + elf_fname (str): Filename of elf image """ return os.path.join(self.get_build_dir(commit_upto, target), f"{elf_fname.replace('/', '-')}.objdump") @@ -689,8 +718,8 @@ class Builder: """Get the name of the err file for a commit number Args: - commit_upto: Commit number to use (0..self.count-1) - target: Target name + commit_upto (int): Commit number to use (0..self.count-1) + target (str): Target name """ output_dir = self.get_build_dir(commit_upto, target) return os.path.join(output_dir, 'err') @@ -701,9 +730,10 @@ class Builder: We should probably use map(). Args: - lines: List of error lines, each a string + lines (list of str): List of error lines, each a string + Returns: - New list with only interesting lines included + list of str: New list with only interesting lines included """ out_lines = [] if self._filter_migration_warnings: @@ -722,12 +752,12 @@ class Builder: """Read function sizes from the output of 'nm' Args: - fd: File containing data to read - fname: Filename we are reading from (just for errors) + fname (str): Filename we are reading from (just for errors) + fd (file): File containing data to read Returns: - Dictionary containing size of each function in bytes, indexed by - function name. + dict: Dictionary containing size of each function in bytes, indexed + by function name. """ sym = {} for line in fd.readlines(): @@ -809,14 +839,14 @@ class Builder: """Work out the outcome of a build. Args: - commit_upto: Commit number to check (0..n-1) - target: Target board to check - read_func_sizes: True to read function size information - read_config: True to read .config and autoconf.h files - read_environment: True to read uboot.env files + commit_upto (int): Commit number to check (0..n-1) + target (str): Target board to check + read_func_sizes (bool): True to read function size information + read_config (bool): True to read .config and autoconf.h files + read_environment (bool): True to read uboot.env files Returns: - Outcome object + Outcome: Outcome object """ done_file = self.get_done_file(commit_upto, target) sizes_file = self.get_sizes_file(commit_upto, target) @@ -893,14 +923,14 @@ class Builder: """Calculate a summary of the results of building a commit. Args: - board_selected: Dict containing boards to summarise - commit_upto: Commit number to summarize (0..self.count-1) - read_func_sizes: True to read function size information - read_config: True to read .config and autoconf.h files - read_environment: True to read uboot.env files + boards_selected (dict): Dict containing boards to summarise + commit_upto (int): Commit number to summarize (0..self.count-1) + read_func_sizes (bool): True to read function size information + read_config (bool): True to read .config and autoconf.h files + read_environment (bool): True to read uboot.env files Returns: - Tuple: + tuple: Tuple containing: Dict containing boards which built this commit: key: board.target value: Builder.Outcome object @@ -989,11 +1019,12 @@ class Builder: sorted by architecture. Args: - board_dict: Dict containing all boards - arch_list: Dict keyed by arch name. Value is a string containing - a list of board names which failed for that arch. - changes: List of boards to add to arch_list - color: terminal.Colour object + board_dict (dict): Dict containing all boards + arch_list (dict): Dict keyed by arch name. Value is a string + containing a list of board names which failed for that arch. + changes (list): List of boards to add to arch_list + char (str): Character to display for this board + color (int): terminal.Colour object """ done_arch = {} for target in changes: @@ -1012,6 +1043,14 @@ class Builder: def colour_num(self, num): + """Format a number with colour depending on its value + + Args: + num (int): Number to format + + Returns: + str: Formatted string (red if positive, green if negative/zero) + """ color = self.col.RED if num > 0 else self.col.GREEN if num == 0: return '0' @@ -1027,8 +1066,8 @@ class Builder: information to work out what has changed. Args: - board_selected: Dict containing boards to summarise, keyed by - board.target + board_selected (dict): Dict containing boards to summarise, keyed + by board.target """ self._base_board_dict = {} for brd in board_selected: @@ -1041,6 +1080,13 @@ class Builder: self._base_environment = None def print_func_size_detail(self, fname, old, new): + """Print detailed size information for each function + + Args: + fname (str): Filename to print (e.g. 'u-boot') + old (dict): Dictionary of old function sizes, keyed by function name + new (dict): Dictionary of new function sizes, keyed by function name + """ grow, shrink, add, remove, up, down = 0, 0, 0, 0, 0, 0 delta, common = [], {} @@ -1093,11 +1139,11 @@ class Builder: """Show details size information for each board Args: - target_list: List of targets, each a dict containing: + target_list (list): List of targets, each a dict containing: 'target': Target name 'total_diff': Total difference in bytes across all areas : Difference for that part - show_bloat: Show detail for each function + show_bloat (bool): Show detail for each function """ targets_by_diff = sorted(target_list, reverse=True, key=lambda x: x['_total_diff']) @@ -1140,12 +1186,12 @@ class Builder: arm: (285 boards) text -0.0 Args: - board_selected: Dict containing boards to summarise, keyed by - board.target - board_dict: Dict containing boards for which we built this + board_selected (dict): Dict containing boards to summarise, keyed + by board.target + board_dict (dict): Dict containing boards for which we built this commit, keyed by board.target. The value is an Outcome object. - show_detail: Show size delta detail for each board - show_bloat: Show detail for each function + show_detail (bool): Show size delta detail for each board + show_bloat (bool): Show detail for each function """ arch_list = {} arch_count = {} @@ -1241,29 +1287,30 @@ class Builder: the last call and what it sees now. Args: - board_selected: Dict containing boards to summarise, keyed by - board.target - board_dict: Dict containing boards for which we built this + board_selected (dict): Dict containing boards to summarise, keyed + by board.target + board_dict (dict): Dict containing boards for which we built this commit, keyed by board.target. The value is an Outcome object. - err_lines: A list of errors for this commit, or [] if there is - none, or we don't want to print errors - err_line_boards: Dict keyed by error line, containing a list of - the Board objects with that error - warn_lines: A list of warnings for this commit, or [] if there is - none, or we don't want to print errors - warn_line_boards: Dict keyed by warning line, containing a list of - the Board objects with that warning - config: Dictionary keyed by filename - e.g. '.config'. Each + err_lines (list): A list of errors for this commit, or [] if there + is none, or we don't want to print errors + err_line_boards (dict): Dict keyed by error line, containing a list + of the Board objects with that error + warn_lines (list): A list of warnings for this commit, or [] if + there is none, or we don't want to print errors + warn_line_boards (dict): Dict keyed by warning line, containing a + list of the Board objects with that warning + config (dict): Dictionary keyed by filename - e.g. '.config'. Each value is itself a dictionary: key: config name value: config value - environment: Dictionary keyed by environment variable, Each + environment (dict): Dictionary keyed by environment variable, Each value is the value of environment variable. - show_sizes: Show image size deltas - show_detail: Show size delta detail for each board if show_sizes - show_bloat: Show detail for each function - show_config: Show config changes - show_environment: Show environment changes + show_sizes (bool): Show image size deltas + show_detail (bool): Show size delta detail for each board if + show_sizes + show_bloat (bool): Show detail for each function + show_config (bool): Show config changes + show_environment (bool): Show environment changes """ def _board_list(line, line_boards): """Helper function to get a line of boards containing a line @@ -1618,6 +1665,13 @@ class Builder: f"{', '.join(not_built)}") def produce_result_summary(self, commit_upto, commits, board_selected): + """Produce a summary of the results for a single commit + + Args: + commit_upto (int): Commit number to summarise (0..self.count-1) + commits (list): List of commits being built + board_selected (dict): Dict containing boards to summarise + """ (board_dict, err_lines, err_line_boards, warn_lines, warn_line_boards, config, environment) = self.get_result_summary( board_selected, commit_upto, @@ -1640,8 +1694,8 @@ class Builder: each commit's results, then display the differences we see. Args: - commit: Commit objects to summarise - board_selected: Dict containing boards to summarise + commits (list): Commit objects to summarise + board_selected (dict): Dict containing boards to summarise """ self.commit_count = len(commits) if commits else 1 self.commits = commits @@ -1658,8 +1712,8 @@ class Builder: """Set up ready to start a build. Args: - board_selected: Selected boards to build - commits: Selected commits to build + board_selected (dict): Selected boards to build + commits (list): Selected commits to build """ # First work out how many commits we will build count = (self.commit_count + self._step - 1) // self._step @@ -1671,8 +1725,8 @@ class Builder: """Get the directory path to the working dir for a thread. Args: - thread_num: Number of thread to check (-1 for main process, which - is treated as 0) + thread_num (int): Number of thread to check (-1 for main process, + which is treated as 0) """ if self.work_in_output: return self._working_dir @@ -1801,14 +1855,15 @@ class Builder: """Build all commits for a list of boards Args: - commits: List of commits to be build, each a Commit object - boards_selected: Dict of selected boards, key is target name, + commits (list): List of commits to be build, each a Commit object + board_selected (dict): Dict of selected boards, key is target name, value is Board object - keep_outputs: True to save build output files - verbose: Display build results as they are completed + keep_outputs (bool): True to save build output files + verbose (bool): Display build results as they are completed fragments (str): config fragments added to defconfig + Returns: - Tuple containing: + tuple: Tuple containing: - number of boards that failed to build - number of boards that issued warnings - list of thread exceptions raised From patchwork Tue Jan 6 22:03:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1313 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=1767737107; bh=fKtyDfoFNpsie52G9LJ3+YWEMR4oAQiP3nNQS4T+YO0=; 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=mD2sL3wqPAHhAn68mPn/5dEYOr0A/isJlNGzKgV51Gy5GDjNn4UkBeAfEXR8dMjDa fCy1rcXdV+SJ/E1v6tuwARK6t/2mTNCD+khOjzGOO6IqPHf/zLW9p9EOJRL4unnpLV QW3PzFqAoYyqOSRg3bteusBmz4WcK+jSbW7Ak/xYz97xgtOi26EmTsK17ghCeeytci dbUNhM9/0EpLobtw7rw96BkTRcMwIHwK4W9MNBH0Iq6anRiAcvCCqATjBYNOeqdAER kB9kJ64gALbDkaa4ofCeSgjPBAe1D5mjEkQ7zZY4/frWNbZiVBFEf0gYYbzWXRUsjW nsglIWPBN2RDw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8CEAB5FF82 for ; Tue, 6 Jan 2026 15:05:07 -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 1moacIY8AZ3o for ; Tue, 6 Jan 2026 15:05:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737107; bh=fKtyDfoFNpsie52G9LJ3+YWEMR4oAQiP3nNQS4T+YO0=; 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=mD2sL3wqPAHhAn68mPn/5dEYOr0A/isJlNGzKgV51Gy5GDjNn4UkBeAfEXR8dMjDa fCy1rcXdV+SJ/E1v6tuwARK6t/2mTNCD+khOjzGOO6IqPHf/zLW9p9EOJRL4unnpLV QW3PzFqAoYyqOSRg3bteusBmz4WcK+jSbW7Ak/xYz97xgtOi26EmTsK17ghCeeytci dbUNhM9/0EpLobtw7rw96BkTRcMwIHwK4W9MNBH0Iq6anRiAcvCCqATjBYNOeqdAER kB9kJ64gALbDkaa4ofCeSgjPBAe1D5mjEkQ7zZY4/frWNbZiVBFEf0gYYbzWXRUsjW nsglIWPBN2RDw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7C04969146 for ; Tue, 6 Jan 2026 15:05:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737105; bh=LHO7IjWb8UjOg5Ewb2E4cMiwvrRrGSfOT1Z0L33Xvg8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QAs128qF0/fy9s6vrACGdbu2Xx2CxcjqtpIPhs3LE8f29gfFIcenERgHKYnTpWGhG w9ON+u0csx+2HezE8VNIJjsZFq2PHeiIY87HMmfyYDymX5lfdZgctJQaSO/f7WWh7T TvMbnqsZqijKGPfY0+I4KDiXgiUc1shg5JBoXYQ0DeWcYBBK5VLCxMjg8nTwz/6hCv heuX39pzsSrSzlnkjklX6+5uuuXSqRUdct4iz+shfblelUYdbSQQff/DvAAkYAz3lh aSrc32CeWekw+wnWjwscGteKSbrBf0yoi8kGxFKt4u3xRZwblWa+v7yzpsBAfQqRhz L67JPVL4TNSOQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9934C5FF82; Tue, 6 Jan 2026 15:05:05 -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 epKerl2wq3Q3; Tue, 6 Jan 2026 15:05:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737101; bh=GWSRP6HcVq5/jp0wzW8kO65dc3BL1QI0SPSUe4ZAcM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sQWa7TrSxkdbNym3cHkFSQz96G3Zfz2RbehoP0u2YGTP3Zk9RuRbw68cFPSItH6Q1 jrtdtXkC0THHUyJzWKd9v4A2Fqp4/2Eif7ZDPBIHlXvtRii/3FDlYRXPzECdw8Elvn 35F1UgLSXYlEXaIbLfq2ZyCMP1ohUHHctbYqxHjlvpeuw68Tu9UgtfHHHdxTW6gseK sIDBuMXSXTJMRWRcNHd7zxNHcsM8XJuIpjoGMxyzLpYgq72xgjBxfGq//FYkUlKl4O KlinEglI9jXk/6LJdoczqfcHs6WHD4DFcWxu/TKH0QBcZG/4lIB9FgdauHmdHVuvsu a3aCYlorGBdQA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2A0C9690CB; Tue, 6 Jan 2026 15:05:01 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:28 -0700 Message-ID: <20260106220403.2915630-11-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: FBE6FX5RBS4Y4AJIP42FPOZOBSRS6JG7 X-Message-ID-Hash: FBE6FX5RBS4Y4AJIP42FPOZOBSRS6JG7 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 10/29] buildman: Initialise all attributes in Builder.__init__() 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 Add initialisation for all instance attributes in __init__() to fix pylint W0201 (attribute-defined-outside-init) warnings. These attributes were previously only set in other methods like set_display_options(), reset_result_summary(), setup_build() and build_boards(). Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 25e802a104c..b3f979e91dd 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -402,6 +402,39 @@ class Builder: self.thread_exceptions = [] self.test_thread_exceptions = test_thread_exceptions + + # Attributes used by set_display_options() + self._show_errors = False + self._show_sizes = False + self._show_detail = False + self._show_bloat = False + self._list_error_boards = False + self._show_config = False + self._show_environment = False + self._filter_dtb_warnings = False + self._filter_migration_warnings = False + + # Attributes set by other methods + self._build_period = None + self.commit = None + self.upto = 0 + self.warned = 0 + self.fail = 0 + self.commit_count = 0 + self.commits = None + self.count = 0 + self._timestamps = None + self._verbose = False + + # Attributes for result summaries + self._base_board_dict = {} + self._base_err_lines = [] + self._base_warn_lines = [] + self._base_err_line_boards = {} + self._base_warn_line_boards = {} + self._base_config = None + self._base_environment = None + if self.num_threads: self._single_builder = None self.queue = queue.Queue() From patchwork Tue Jan 6 22:03:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1314 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=1767737112; bh=hqWZF8PSUIzORcsGf9Lirim/yFnK9Jc9xBhJh4zq7FY=; 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=dL0hCtvBDb7HMt5f8pRb/DYTOTM77JSQBMTj+sUrjdk71vJRy8ws+YR3s24ZQqIgq cYhADRpexJv3Rf6q0o4pX+CdVT5KOsIUydiKip+hBVO9X5Lx5aNLwJnbus2pnq/RPS Fzn+gF5NQcZSMajUGLG5DHkBEFL3zvDyvsApNlrw56Sl9/7KuprctwWLhCyLaQoTMw 31Bf0Xc4zy8Jl46qx344gLzCVMboUG/7kDfePMPA0V06v3YJ2fcZZS5JoreHEnJn2g llxwHSs7VY1/wJiUtZ6QnLf+XseKWvtF+llxysIQCRl0ylZXMCmLu1+Plzh2vlvlGn Bjgwfl9AD4fjA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0AE7469158 for ; Tue, 6 Jan 2026 15:05:12 -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 tlM_xDHBeAbI for ; Tue, 6 Jan 2026 15:05:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737111; bh=hqWZF8PSUIzORcsGf9Lirim/yFnK9Jc9xBhJh4zq7FY=; 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=dDl5g/4IHplIW/4v57M3zJXqo27SKa03QzvB77cuIZgvgZ74pbJaijOqNIi4nUzxy oYMKv0lEpBmryG+9s+1Gm9NuAeFzyYbVEzzTBRtLGH3GDB///SDM/KosQQ2jT7TITl S5QIp6n6Bntfc741QrjfTA6F43DGkP+aaGyzGbcipda+VWRmvPUKzb7zVuZm9LwPgx zgddLCeWoC5qJ7GOb9rlkcce5UKNj5O/QI4fih8pv+cNQ+mwwNVI4IO6FG4F/t0f0b iwBr3zh8Ej252veGDYMMX6OJ9GeCIO90V+QiGA5V1uZ7QympSnv518ScTQMv3rp996 n91O+3uYbT8Lg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ECB1B69146 for ; Tue, 6 Jan 2026 15:05:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737110; bh=xCZfqqewFH9WYwbHBHj+o9WeB4rotW7i2WH2SJCmrLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g4ZjKj5cOw5Kt9pFqcXGAiOySRTDf7O4ugu7IQi0I2pQwRwa3M9G6I2oBCQDfFJZO ZpQ4x5JhY2w3qw/otCqZOrOPY0JTpGxLLrZv5f4pNbHL2m1x2KC5j57hqtkXlITnZA /LqT1p/Yc6B6oEZ80+KuHdQDktgSr+Nu67bR6+vZUzSzsvFE+GVUEUrZkhRi9ytFGR xUU9kM13JK4wypQdyQNdmEDha8runfe5dQpD+dX1po4azY4HteDaHEYkCr+Tt7aqjM JCOFmXN2NwvO+fHepFvtyIFR+tdo1GJhQgltspEji5b8hBWXE4hUABYyfhQhXRdPjv Z6qRmlAHkasuA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5CF1C5FF82; Tue, 6 Jan 2026 15:05:10 -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 cmwxecX89BXV; Tue, 6 Jan 2026 15:05:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737106; bh=TwdcFCVSXW/363NBybXQQI+P19U+6WZkF1EKxr9MvTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nenDwbXiT7Izobswaxa2uwlRkrPLv3yseKq9mPMfKOOkDP4eMkUGOxUFuMpyrxehh cwU053kJCd1flJyJiGiEDzdslQKQU5URdrpedZgp4O6b+9VXuShUD3qTrDhpAVSmHE nw9PCfyBIRkTBhshuRY6ln74yHZrCQO0wdUe6ARMxSlquS3KkuK6wQXJGADISvFEkG 7vowVvAryUJkqmvV9qRu6asEKg5jt7pWhV0xfu2koeQGVv3hFFRjT/uyrwiyJ59xVU afmqRG53vO1y+m1KS9q9yd/xs196+kTjBDlqDqKtSjSskep8RdC3zenNpwdqVwDc/a 1T2aZI9wO+bGQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DE915690CB; Tue, 6 Jan 2026 15:05:05 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:29 -0700 Message-ID: <20260106220403.2915630-12-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: FWPVC3GGQUOUD2XJIDFZEFZPF43I74H2 X-Message-ID-Hash: FWPVC3GGQUOUD2XJIDFZEFZPF43I74H2 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 11/29] buildman: Fix miscellaneous pylint warnings 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 Fix several pylint warnings: - W0105: Convert standalone docstring for ErrLine to comments - W0612: Use _ for unused loop variable in Config.__hash__() - W0621: Rename signal parameter to signum to avoid shadowing import - C1802: Use implicit boolean test instead of len() - C0117: Use 'arch not in' instead of 'not arch in' - C0121: Use 'is True' instead of '== True' Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index b3f979e91dd..195fbe40324 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -105,13 +105,11 @@ u-boot/ source directory .git/ repository """ -"""Holds information about a particular error line we are outputing - - char: Character representation: '+': error, '-': fixed error, 'w+': warning, - 'w-' = fixed warning - boards: List of Board objects which have line in the error/warning output - errline: The text of the error line -""" +# Holds information about a particular error line we are outputting +# char: Character representation: '+': error, '-': fixed error, 'w+': warning, +# 'w-' = fixed warning +# boards: List of Board objects which have line in the error/warning output +# errline: The text of the error line ErrLine = collections.namedtuple('ErrLine', 'char,brds,errline') # Possible build outcomes @@ -150,7 +148,7 @@ class Config: def __hash__(self): val = 0 - for fname, config in self.config.items(): + for _, config in self.config.items(): for key, value in config.items(): print(key, value) val = val ^ hash(key) & hash(value) @@ -465,11 +463,11 @@ class Builder: """Get rid of all threads created by the builder""" self.threads.clear() - def signal_handler(self, signal, frame): + def signal_handler(self, signum, frame): """Handle a signal by exiting Args: - signal (int): Signal number + signum (int): Signal number frame (frame): Stack frame at point of signal """ sys.exit(1) @@ -904,7 +902,7 @@ class Builder: # Decide whether the build was ok, failed or created warnings if return_code: rc = OUTCOME_ERROR - elif len(err_lines): + elif err_lines: rc = OUTCOME_WARNING else: rc = OUTCOME_OK @@ -1066,10 +1064,10 @@ class Builder: else: arch = 'unknown' text = self.col.build(color, ' ' + target) - if not arch in done_arch: + if arch not in done_arch: text = f' {self.col.build(color, char)} {text}' done_arch[arch] = True - if not arch in arch_list: + if arch not in arch_list: arch_list[arch] = text else: arch_list[arch] += text @@ -1807,7 +1805,7 @@ class Builder: newline=False) gitutil.add_worktree(src_dir, thread_dir) terminal.print_clear() - elif setup_git == 'clone' or setup_git == True: + elif setup_git == 'clone' or setup_git is True: tprint(f'\rCloning repo for thread {thread_num}', newline=False) gitutil.clone(src_dir, thread_dir) From patchwork Tue Jan 6 22:03:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1315 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=1767737116; bh=aHgXSULMWa8jVQLpCbzPvDkYtx83U7cb5I9k6s7Y8gE=; 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=hgfNX+sDXhBQP2FEB9WvSuNGa4Os3qs3eBOq63WLEFyaIRt+QasdXvNbofrJqmoum 3GeE71A8YxLhchHyymnK6beig0T1eytADKL2VLHS39+qyRPW97NZ808U2tAWJDkDsK UMe4D0oBpDHza06lKPouCOM8xS9MTJ3khP4UEqcMPXKzfSPULabfV3QvWQhJY5JO5J lwE8NXlN+KsWBQ2iuOkg7rFhbo8webfrDRIyANADGgRgWJlsCbj3jLbqzKscm4tujn P1ZdcuhatUTJgwbQyOoL/h7yY4JAcB9X48DLzOecJMqNn4xCN+wcKSHLxHBPykFZp8 rRDM9RDMC8OxQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E115B69161 for ; Tue, 6 Jan 2026 15:05:16 -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 kcg-YQVCMdsQ for ; Tue, 6 Jan 2026 15:05:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737116; bh=aHgXSULMWa8jVQLpCbzPvDkYtx83U7cb5I9k6s7Y8gE=; 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=hgfNX+sDXhBQP2FEB9WvSuNGa4Os3qs3eBOq63WLEFyaIRt+QasdXvNbofrJqmoum 3GeE71A8YxLhchHyymnK6beig0T1eytADKL2VLHS39+qyRPW97NZ808U2tAWJDkDsK UMe4D0oBpDHza06lKPouCOM8xS9MTJ3khP4UEqcMPXKzfSPULabfV3QvWQhJY5JO5J lwE8NXlN+KsWBQ2iuOkg7rFhbo8webfrDRIyANADGgRgWJlsCbj3jLbqzKscm4tujn P1ZdcuhatUTJgwbQyOoL/h7yY4JAcB9X48DLzOecJMqNn4xCN+wcKSHLxHBPykFZp8 rRDM9RDMC8OxQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CFEC669146 for ; Tue, 6 Jan 2026 15:05:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737114; bh=nmxVn32gNhx1a/aKiUxQjMI3fLDJYpi42JMz4j1dvW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KSB8ykkvPEmCrBMdtkqrimSRl0iNR2+7QNx/IpErmnEHiju00blYs1fDMmQC6V+R9 uedaqDnUnkByAn3w7en1WcFGvnup9xBQNdbbfsE6uegUaZBWCUsvmRxU2rjhJqqWtx /tyeFpAorASkIMljHJN5z9CERIRjj3Nlkh0g+6rYeu4fd5OGuOejVihc816CbA9AdI 4Rr6/5FoPyzUkFp55wMQT5uhReew6glFtm3nuHQUNgzhJAV5c0eiYfjXzMMqSCxF0h 8hUl0kHCvjGaxxq3nov9YWhD22+d+DWhnIY6N3Y4uH6dPSB3POm4C4RioIoI+HnK46 4WRocSVgT+MqA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D20005FF82; Tue, 6 Jan 2026 15:05:14 -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 OwWIH3rYyJuj; Tue, 6 Jan 2026 15:05:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737110; bh=wX1rXMsedXCF6gsVKgy/siFqIQZNgcDkwSKgDoJpY/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I1Cd/ZQ9vICg1C43YofwEKknCDEqW8YW58JuwHz74xtEKCtfRY8hSYQ+kPiTl/OrK SAK+uG8aGvcNvfd9hvyr9gMdkxLSqprbidsypF2T7XFKPJyYWqeN65A38r02Wtnc3b GRpuqtq4KfkF2Niv9UJ58Ol+3eWQH8UfX8Do2ISzr4W/iGGc+HSMOoN9aPHW/4vc4b 6BaivCddTbCompSDx3yvZnE+IUxq+OR4QylHmuL0imrD+0WiR2969gVcQu3RHa4Sv0 2DbiWsLgLJrOk6Jjy/n7MGjhndTZp+lQEzmU64uW6ypVRWKz8HshDZFiTFHtmHwLMV cQM4qf/Ui9rGg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A1E11690CB; Tue, 6 Jan 2026 15:05:10 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:30 -0700 Message-ID: <20260106220403.2915630-13-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: ZSSYTJV2GWUCHXQ6PDDFS33WROCRGWUK X-Message-ID-Hash: ZSSYTJV2GWUCHXQ6PDDFS33WROCRGWUK 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 12/29] buildman: Mark unused function arguments 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 Prefix unused function arguments with underscore to indicate they are intentionally unused. These are typically required by interfaces (signal handlers, callbacks) but not used in the implementation. This fixes pylint W0613 (unused-argument) warnings. Remove parameter documentation for these underscore-prefixed unused arguments as pylint considers documenting them useless (W9019/W9020). Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 195fbe40324..3fd7182cbb6 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -463,13 +463,8 @@ class Builder: """Get rid of all threads created by the builder""" self.threads.clear() - def signal_handler(self, signum, frame): - """Handle a signal by exiting - - Args: - signum (int): Signal number - frame (frame): Stack frame at point of signal - """ + def signal_handler(self, _signum, _frame): + """Handle a signal by exiting""" sys.exit(1) def make_environment(self, toolchain): @@ -564,20 +559,16 @@ class Builder: if checkout and self.checkout: gitutil.checkout(commit.hash) - def make(self, commit, brd, stage, cwd, *args, **kwargs): + def make(self, _commit, _brd, _stage, cwd, *args, **kwargs): """Run make Args: - commit (Commit): Commit object that is being built - brd (Board): Board object that is being built - stage (str): Stage that we are at (mrproper, config, oldconfig, - build) cwd (str): Directory where make should be run args: Arguments to pass to make kwargs: Arguments to pass to command.run_one() """ - def check_output(stream, data): + def check_output(_stream, data): if b'Restart config' in data: self._restarting_config = True @@ -779,11 +770,10 @@ class Builder: out_lines.append(line) return out_lines - def read_func_sizes(self, fname, fd): + def read_func_sizes(self, _fname, fd): """Read function sizes from the output of 'nm' Args: - fname (str): Filename we are reading from (just for errors) fd (file): File containing data to read Returns: @@ -1739,12 +1729,11 @@ class Builder: tprint('(no errors to report)', colour=self.col.GREEN) - def setup_build(self, board_selected, commits): + def setup_build(self, board_selected, _commits): """Set up ready to start a build. Args: board_selected (dict): Selected boards to build - commits (list): Selected commits to build """ # First work out how many commits we will build count = (self.commit_count + self._step - 1) // self._step From patchwork Tue Jan 6 22:03:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1316 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=1767737121; bh=0DzimnQA9JoEOUvUdSIRgdBXZmcVBRSZtv7cTwxf2wo=; 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=exed+z51ujzx9oMAa5jt/1xvMlU440wqQ9Vi7CS9mAnDCOFFCBrqDngfhXUd5nMCF gCgpKmu6gl6zeJ8LIjmWhWrfBwopzPQ987wFrMjIcdZIsaH4AppReoe5q3lOUWo286 S7tRMX74L7n7I19owUEjq0zjKSfaYU5M/MXep+YcvW9eNcei0ClNsXVyNx5RgPiKZ5 kF695dLTk1jokGNGmhQX+/UaPdCYCWO0XvdQTrcXzk1+5RQ3OzwrILylBQkD3yrSDx 4QiAFTbT/FZHrQaF5L5ULLs7oYj4KM56vf+2AVhZPRBfLlOmNrDOa+uN4QJX9n2fhx X/O3wOWzR4Fiw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 69D7469161 for ; Tue, 6 Jan 2026 15:05:21 -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 2ANTHqzhsYll for ; Tue, 6 Jan 2026 15:05:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737121; bh=0DzimnQA9JoEOUvUdSIRgdBXZmcVBRSZtv7cTwxf2wo=; 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=exed+z51ujzx9oMAa5jt/1xvMlU440wqQ9Vi7CS9mAnDCOFFCBrqDngfhXUd5nMCF gCgpKmu6gl6zeJ8LIjmWhWrfBwopzPQ987wFrMjIcdZIsaH4AppReoe5q3lOUWo286 S7tRMX74L7n7I19owUEjq0zjKSfaYU5M/MXep+YcvW9eNcei0ClNsXVyNx5RgPiKZ5 kF695dLTk1jokGNGmhQX+/UaPdCYCWO0XvdQTrcXzk1+5RQ3OzwrILylBQkD3yrSDx 4QiAFTbT/FZHrQaF5L5ULLs7oYj4KM56vf+2AVhZPRBfLlOmNrDOa+uN4QJX9n2fhx X/O3wOWzR4Fiw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 533AB69146 for ; Tue, 6 Jan 2026 15:05:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737119; bh=ZXWj4f57TPmEntEoHXT3VhKD61JzQx3Ia4yugrBD7i0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TMPGMkYY9kaki2EZgrcf7OR7CwwXg8i4MAvbV4EA9iNLYizS4e5EwHLAh0FHbbUTr imARs1XlO3sUC3ok6SALhEWAiHviwA9DuD8qnFKP0Dp7b+xeno/7DBhFcLNITy/OhV QmQ/cI031hspEVG96jeasHwVH98xsPXFpKR7hpKQ9sj14mqdSpXGwaZhUSNrjJauVE 8wqJFMfIOzO7tx4xstpMKflUd1zyfaoCQ0C2h0b1JGHW7ZlX4SbNzTd0GRxdZj2kP2 coTCGEnqXYbfIr95jacAwJhkRSRy+05/2k4LJlJbaiW2WVxe3duysAy/IcvlHgQHcv yrgxrqe3IOKLw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5342B5FF82; Tue, 6 Jan 2026 15:05:19 -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 Px-fTdtAeCDn; Tue, 6 Jan 2026 15:05:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737115; bh=FmAgnt7yiOJIVkFFHOL++4mn4n0QrYyIPEuZkOWqDg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pHMCMlaHNBxZv2DvHdzpfl1ToGH6a04i13eskUVJ2CfX1G662iI7H2ptcZ0l6jWgQ GR3/qHFMDowLQiVti0yzWA9aaiC+4gOMLh2PSnLMVrrZ2e0R2vBmfaNSm+hWCv3U2G 4WU+kg8B0iwLQuopsOMncWIkDzhdeLpIWdWk4rAESiLiijJUk41olkkxLy3+wRRdX8 xTemYpnxJYHCWkQUDcceNehsC1cfRx7OEU0bZTw1lU/5OiBx9PrWh3S7kGBtKSvei/ Fwqcs11fHb4MpzYTMe3tBAn9JFo5SC+31PC/tVN2dUFOSoa8aOzTgqY3cIbpMVwAoa KfqrGyHkTQQ/A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1D774690CB; Tue, 6 Jan 2026 15:05:15 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:31 -0700 Message-ID: <20260106220403.2915630-14-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: B3YBUIEV7Y5CPBMHVZEUC5PSFZUYMZZL X-Message-ID-Hash: B3YBUIEV7Y5CPBMHVZEUC5PSFZUYMZZL 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 13/29] buildman: Fix line length and return-value pylint warnings 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 Wrap lines that exceed 80 columns and fix the inconsistent return statement in _get_output_space_removals() which returns a list on one path but None on another. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 3fd7182cbb6..4526c476a97 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -232,8 +232,8 @@ class Builder: threading is not being used _terminated: Thread was terminated due to an error _restarting_config: True if 'Restart config' is detected in output - _ide: Produce output suitable for an Integrated Development Environment, - i.e. dont emit progress information and put errors/warnings on stderr + _ide: Produce output suitable for an Integrated Development Environment + i.e. don't emit progress information and put errors on stderr """ class Outcome: """Records a build outcome for a single make invocation @@ -394,9 +394,10 @@ class Builder: self._re_files = re.compile('In file included from.*') self._re_warning = re.compile(r'(.*):(\d*):(\d*): warning: .*') self._re_dtb_warning = re.compile('(.*): Warning .*') - self._re_note = re.compile(r'(.*):(\d*):(\d*): note: this is the location of the previous.*') - self._re_migration_warning = re.compile(r'^={21} WARNING ={22}\n.*\n=+\n', - re.MULTILINE | re.DOTALL) + self._re_note = re.compile( + r'(.*):(\d*):(\d*): note: this is the location of the previous.*') + self._re_migration_warning = re.compile( + r'^={21} WARNING ={22}\n.*\n=+\n', re.MULTILINE | re.DOTALL) self.thread_exceptions = [] self.test_thread_exceptions = test_thread_exceptions @@ -453,7 +454,8 @@ class Builder: self._single_builder = builderthread.BuilderThread( self, -1, mrproper, per_board_out_dir) - ignore_lines = ['(make.*Waiting for unfinished)', '(Segmentation fault)'] + ignore_lines = ['(make.*Waiting for unfinished)', + '(Segmentation fault)'] self.re_make_err = re.compile('|'.join(ignore_lines)) # Handle existing graceful with SIGINT / Ctrl-C @@ -595,7 +597,8 @@ class Builder: if self._terminated: # Try to be helpful - result.stderr += '(** did you define an int/hex Kconfig with no default? **)' + result.stderr += \ + '(** did you define an int/hex Kconfig with no default? **)' if self.verbose_build: result.stdout = f"{' '.join(cmd)}\n" + result.stdout @@ -1376,8 +1379,8 @@ class Builder: worse_lines = [] for line in lines: if line not in base_lines: - errline = ErrLine(char + '+', _board_list(line, line_boards), - line) + errline = ErrLine( + char + '+', _board_list(line, line_boards), line) worse_lines.append(errline) for line in base_lines: if line not in lines: @@ -1513,8 +1516,8 @@ class Builder: sys.stderr.write(line) # Display results by arch - elif any((ok_boards, warn_boards, err_boards, unknown_boards, new_boards, - worse_err, better_err, worse_warn, better_warn)): + elif any((ok_boards, warn_boards, err_boards, unknown_boards, + new_boards, worse_err, better_err, worse_warn, better_warn)): arch_list = {} self.add_outcome(board_selected, arch_list, ok_boards, '', self.col.GREEN) @@ -1522,7 +1525,8 @@ class Builder: self.col.YELLOW) self.add_outcome(board_selected, arch_list, err_boards, '+', self.col.RED) - self.add_outcome(board_selected, arch_list, new_boards, '*', self.col.BLUE) + self.add_outcome(board_selected, arch_list, new_boards, '*', + self.col.BLUE) if self._show_unknown: self.add_outcome(board_selected, arch_list, unknown_boards, '?', self.col.MAGENTA) @@ -1841,7 +1845,7 @@ class Builder: List of full paths of directories to remove """ if not self.commits: - return + return [] dir_list = [] for commit_upto in range(self.commit_count): dir_list.append(self.get_output_dir(commit_upto)) @@ -1944,12 +1948,13 @@ class Builder: if duration > timedelta(microseconds=1000000): if duration.microseconds >= 500000: duration = duration + timedelta(seconds=1) - duration = duration - timedelta(microseconds=duration.microseconds) + duration -= timedelta(microseconds=duration.microseconds) rate = float(self.count) / duration.total_seconds() msg += f', duration {duration}, rate {rate:1.2f}' tprint(msg) if self.thread_exceptions: - tprint(f'Failed: {len(self.thread_exceptions)} thread exceptions', + tprint( + f'Failed: {len(self.thread_exceptions)} thread exceptions', colour=self.col.RED) return (self.fail, self.warned, self.thread_exceptions) From patchwork Tue Jan 6 22:03:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1317 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=1767737125; bh=sbAfajm7kgKScdymp2dyIiNBiqXMWWbJxMOza0LrYy0=; 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=cBlqAg8UVy0DbMSlRuC/RdDBAFqA80OOBoyu5c/jpclHzi8uAugyfr5pEpSc6s30v JGxatzjUzFFxAvnLYKOQjY79ksNF1CcwZMNfJ8MnokReqoKFicdOyWIac9VdCegJFD /psUEW2dVt8Xkks7SBRxB4+gVhbCaPRZWIWqJIBWKKbsrKSYdc5FduUXa3in/VGHzS bo3JAFvEKtFkFnwzxvjcY5QY0QtMOvYcNwfro0btPlhH65yHnUiLhpIuEc55xu8oNf N49W1yKQBwvyiH3Er2DQexcSrLOcJ6YXkFFQAeKKDz9up0ILic/gJSaIkWmtNgHO72 TAlhpfZG3Q5NA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F3B935FF82 for ; Tue, 6 Jan 2026 15:05:25 -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 RaLD_X4n5QgQ for ; Tue, 6 Jan 2026 15:05:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737125; bh=sbAfajm7kgKScdymp2dyIiNBiqXMWWbJxMOza0LrYy0=; 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=cBlqAg8UVy0DbMSlRuC/RdDBAFqA80OOBoyu5c/jpclHzi8uAugyfr5pEpSc6s30v JGxatzjUzFFxAvnLYKOQjY79ksNF1CcwZMNfJ8MnokReqoKFicdOyWIac9VdCegJFD /psUEW2dVt8Xkks7SBRxB4+gVhbCaPRZWIWqJIBWKKbsrKSYdc5FduUXa3in/VGHzS bo3JAFvEKtFkFnwzxvjcY5QY0QtMOvYcNwfro0btPlhH65yHnUiLhpIuEc55xu8oNf N49W1yKQBwvyiH3Er2DQexcSrLOcJ6YXkFFQAeKKDz9up0ILic/gJSaIkWmtNgHO72 TAlhpfZG3Q5NA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E424569146 for ; Tue, 6 Jan 2026 15:05:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737124; bh=R8JY9L72dZ7yFnq+FWBqW1+L4LMflFtDgFei4uL9Q/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s/+g824JEkExmMiANlqMUDl850qw2Ve6iVrbY6cW3v01A4jL98fnRxtbvvgrWhQsK f+lqsEPobkmDC1o738zjuP8ZomymsfR2jqQbKx9rt83QrONj81hU4NSxKo5nXcBJ3E vdA7BosbMEOSZhfCxllfwPLOaKcWZJ1ZuIWrZCms0iuhIPbd7Cu4yf+aD7CJKbh/91 1HPMOqU8kcDczp/Nitai9Jckny5y877wfYutNOm5fZ9E9gHyrlp/WqJpD4gU8nTMsL wQMaZ2EpgLPYbbMYPOQ+o9wRwyANdFo78JATBHctmKXEcd8fbzopvi6MnU6BlH29Bh 7mCBDNZXPHM8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 143E95FF82; Tue, 6 Jan 2026 15:05:24 -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 NoWJy0bugRgV; Tue, 6 Jan 2026 15:05:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737119; bh=EN/Pg1LLb+7yIqcmGoytXWjTQTvkddb19MBOczz0Ncc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F/snhKLT9kbL8oxH+m6dJHQ196soxwcYpn8qvdKiLh95qszUdJm7We+JkOvdviljc Me+h5vSIc1LuSiRrs8VxtNaOoCS5WbdNDPwSVvKXwfTcSFTxiJ5a8XJ3Mtd2i1H/Ts 3bBSLLYHEYD8di472YtWSE29zcBuLhLt6LRianb2CsCtCxudp0OovZaFKOhdfpNS4a fICxs3J7g//dGyXb1FtY2a1MWmcYkhUZ6dENiyzfe88Yab4M5kzXwpzu2PH9QAJllj ZK3s5Gd7Qbt6xga8nMl10+2PvalrPF2XsrL6b7K6IsMnyItLMrPWYTeTqBH7Z10o9c rsHROO54+npmQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 89726690CB; Tue, 6 Jan 2026 15:05:19 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:32 -0700 Message-ID: <20260106220403.2915630-15-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: EPLY6PLRUSE7RUSNJOLMTI7TJB6735BJ X-Message-ID-Hash: EPLY6PLRUSE7RUSNJOLMTI7TJB6735BJ 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 14/29] buildman: Refactor get_build_outcome() 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 'with open' block into a separate _read_done_file() function to improve readability and reduce local variables in get_build_outcome(). Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 97 +++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 39 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 4526c476a97..38b076138b0 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -858,6 +858,62 @@ class Builder: pass return environment + def _read_done_file(self, commit_upto, target, done_file, sizes_file): + """Read the done file and collect build results + + Args: + commit_upto (int): Commit number to check (0..n-1) + target (str): Target board to check + done_file (str): Filename of done file + sizes_file (str): Filename of sizes file + + Returns: + tuple: (rc, err_lines, sizes) where: + rc: OUTCOME_OK, OUTCOME_WARNING or OUTCOME_ERROR + err_lines: list of error lines + sizes: dict of sizes + """ + with open(done_file, 'r', encoding='utf-8') as fd: + try: + return_code = int(fd.readline()) + except ValueError: + # The file may be empty due to running out of disk space. + # Try a rebuild + return_code = 1 + err_lines = [] + err_file = self.get_err_file(commit_upto, target) + if os.path.exists(err_file): + with open(err_file, 'r', encoding='utf-8') as fd: + err_lines = self.filter_errors(fd.readlines()) + + # Decide whether the build was ok, failed or created warnings + if return_code: + rc = OUTCOME_ERROR + elif err_lines: + rc = OUTCOME_WARNING + else: + rc = OUTCOME_OK + + # Convert size information to our simple format + sizes = {} + if os.path.exists(sizes_file): + with open(sizes_file, 'r', encoding='utf-8') as fd: + for line in fd.readlines(): + values = line.split() + rodata = 0 + if len(values) > 6: + rodata = int(values[6], 16) + size_dict = { + 'all' : int(values[0]) + int(values[1]) + + int(values[2]), + 'text' : int(values[0]) - rodata, + 'data' : int(values[1]), + 'bss' : int(values[2]), + 'rodata' : rodata, + } + sizes[values[5]] = size_dict + return rc, err_lines, sizes + def get_build_outcome(self, commit_upto, target, read_func_sizes, read_config, read_environment): """Work out the outcome of a build. @@ -874,49 +930,12 @@ class Builder: """ done_file = self.get_done_file(commit_upto, target) sizes_file = self.get_sizes_file(commit_upto, target) - sizes = {} func_sizes = {} config = {} environment = {} if os.path.exists(done_file): - with open(done_file, 'r', encoding='utf-8') as fd: - try: - return_code = int(fd.readline()) - except ValueError: - # The file may be empty due to running out of disk space. - # Try a rebuild - return_code = 1 - err_lines = [] - err_file = self.get_err_file(commit_upto, target) - if os.path.exists(err_file): - with open(err_file, 'r', encoding='utf-8') as fd: - err_lines = self.filter_errors(fd.readlines()) - - # Decide whether the build was ok, failed or created warnings - if return_code: - rc = OUTCOME_ERROR - elif err_lines: - rc = OUTCOME_WARNING - else: - rc = OUTCOME_OK - - # Convert size information to our simple format - if os.path.exists(sizes_file): - with open(sizes_file, 'r', encoding='utf-8') as fd: - for line in fd.readlines(): - values = line.split() - rodata = 0 - if len(values) > 6: - rodata = int(values[6], 16) - size_dict = { - 'all' : int(values[0]) + int(values[1]) + - int(values[2]), - 'text' : int(values[0]) - rodata, - 'data' : int(values[1]), - 'bss' : int(values[2]), - 'rodata' : rodata, - } - sizes[values[5]] = size_dict + rc, err_lines, sizes = self._read_done_file( + commit_upto, target, done_file, sizes_file) if read_func_sizes: pattern = self.get_func_sizes_file(commit_upto, target, '*') From patchwork Tue Jan 6 22:03:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1318 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=1767737130; bh=jNQrQxcBcUdxRp5ucM4JfK6h9MHL/FIhC85Exd9PpMo=; 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=J840v23lt7+LCfipBFaQAm4eBjDAnnD68dMTS1SXb7r6UA+/q+7H/z+mSAEvraVAy /z9gCtwrubGr52rnNx9NV6Kx2NXPAQP/pAihc1J6F4VD8gYb6Xs861pv5XTX8xKSB7 r+sI/+IEHyMKRFRcC8sbKJcgtSoVcdBhLg/FNeO/Bq808JscMuoReG2i9pUu/lQ2fS U+ovo42bFLyvYrfaUzeQVZ6khu40PjLCiYYP1hEbdU8yXR/eoZhoasaTlxOp39uY3T dxxfp10MW0m6Bm6Am3mGOKkK+cSU10gMQ5UpyWZp9ykMP1js/97zHKsP4wZvXHZ+fv 3ZOcCRon3ZKcw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6357C6915C for ; Tue, 6 Jan 2026 15:05:30 -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 e4ZBt8M6eL-r for ; Tue, 6 Jan 2026 15:05:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737130; bh=jNQrQxcBcUdxRp5ucM4JfK6h9MHL/FIhC85Exd9PpMo=; 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=J840v23lt7+LCfipBFaQAm4eBjDAnnD68dMTS1SXb7r6UA+/q+7H/z+mSAEvraVAy /z9gCtwrubGr52rnNx9NV6Kx2NXPAQP/pAihc1J6F4VD8gYb6Xs861pv5XTX8xKSB7 r+sI/+IEHyMKRFRcC8sbKJcgtSoVcdBhLg/FNeO/Bq808JscMuoReG2i9pUu/lQ2fS U+ovo42bFLyvYrfaUzeQVZ6khu40PjLCiYYP1hEbdU8yXR/eoZhoasaTlxOp39uY3T dxxfp10MW0m6Bm6Am3mGOKkK+cSU10gMQ5UpyWZp9ykMP1js/97zHKsP4wZvXHZ+fv 3ZOcCRon3ZKcw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5366569146 for ; Tue, 6 Jan 2026 15:05:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737128; bh=Wvf7uj7VIGl6uToSvKiQ1FYOQtA+H1zk3qrzdOl/imc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p3nkG+7sHJnugOtEISBHh+FADcXUWe0syVUJaTeHoBqWxPN3T/xGIb/HRGCqpHLG0 9GUBUrQU6RQlvjO1YboG/A+CZY/xiVOeVJX2O0QiyFb0M9fCVyN3uVMI1sA7tK+Tpd eIsuV37hzyMzYn85QZm6Lo0mCaZroTFTwq9vpF6Hrd4qYr001EcURgYIQaJu6fyWRo wAcDXrxnh588nKUUMYarMJxhC5dtxTj9TkIaEVLP5hKYznvdLEUkJJQdifqhm/s25q 2pIkM8sibH+mRUgmxbCITBWmxJtCco90N1WWsNLnYl2P1QI/ObZ3YgpLRECTDzWY0U XMqlbBvR4+H2w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C2C7B5FF82; Tue, 6 Jan 2026 15:05:28 -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 do5ZgosQ-d17; Tue, 6 Jan 2026 15:05:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737124; bh=x5Cv+qnm4aNxjej2W0s9HUesB2qIHkyDuydIY8Qfo+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NBQeSp6SzgR1Z5OKhTSkqncCCEi72+FkjxO2klk6V/+AC8+uFk1iylR9H1JGTnuS8 j3Il51YmrYxLzVfAKkq0F4JJkuUSEd5rMsH7RMIFTI+96p+NdicuMSu2zpCZm22o6V E6tqlRCnla4LE20KFkvspgY1uR/bhaTu18qCgYeWfhlrqyvQVGEQ42pr5uCKDeaDuN 2R6h8RO7/tT5Er0AO49YUKv92qMfUvX1bPkjZIIozd7t/cFEVeiOk7QsYSoP1OQlIV 3/ga+5HZYKiy5wZy6fImjwoi5yxrAyzuG3KnEp5TXNy/xVqKT05EON3qIN8V9yRQzv bId4iys7Nyi1A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 55E66690CB; Tue, 6 Jan 2026 15:05:24 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:33 -0700 Message-ID: <20260106220403.2915630-16-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: 4RLSJTMBSLHP5T7WJDLFQUWRZGTPDLY5 X-Message-ID-Hash: 4RLSJTMBSLHP5T7WJDLFQUWRZGTPDLY5 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 15/29] buildman: Refactor get_result_summary() 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 Extract the error-line processing loop into _categorise_err_lines() and move the nested add_line() function to _add_line() as a static method. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 92 +++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 33 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 38b076138b0..172a8970ec9 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -961,6 +961,62 @@ class Builder: return Builder.Outcome(OUTCOME_UNKNOWN, [], {}, {}, {}, {}) + @staticmethod + def _add_line(lines_summary, lines_boards, line, brd): + """Add a line to the summary and boards list + + Args: + lines_summary (list): List of line strings + lines_boards (dict): Dict of line strings to list of boards + line (str): Line to add + brd (Board): Board that produced this line + """ + line = line.rstrip() + if line in lines_boards: + lines_boards[line].append(brd) + else: + lines_boards[line] = [brd] + lines_summary.append(line) + + def _categorise_err_lines(self, err_lines, brd, err_lines_summary, + err_lines_boards, warn_lines_summary, + warn_lines_boards): + """Categorise error lines into errors and warnings + + Args: + err_lines (list): List of error-line strings + brd (Board): Board that produced these lines + err_lines_summary (list): List of error-line strings + err_lines_boards (dict): Dict of error-line strings to boards + warn_lines_summary (list): List of warning-line strings + warn_lines_boards (dict): Dict of warning-line strings to boards + """ + last_func = None + last_was_warning = False + for line in err_lines: + if line: + if (self._re_function.match(line) or + self._re_files.match(line)): + last_func = line + else: + is_warning = (self._re_warning.match(line) or + self._re_dtb_warning.match(line)) + is_note = self._re_note.match(line) + if is_warning or (last_was_warning and is_note): + if last_func: + self._add_line(warn_lines_summary, + warn_lines_boards, last_func, brd) + self._add_line(warn_lines_summary, warn_lines_boards, + line, brd) + else: + if last_func: + self._add_line(err_lines_summary, err_lines_boards, + last_func, brd) + self._add_line(err_lines_summary, err_lines_boards, + line, brd) + last_was_warning = is_warning + last_func = None + def get_result_summary(self, boards_selected, commit_upto, read_func_sizes, read_config, read_environment): """Calculate a summary of the results of building a commit. @@ -992,14 +1048,6 @@ class Builder: key: environment variable value: value of environment variable """ - def add_line(lines_summary, lines_boards, line, board): - line = line.rstrip() - if line in lines_boards: - lines_boards[line].append(board) - else: - lines_boards[line] = [board] - lines_summary.append(line) - board_dict = {} err_lines_summary = [] err_lines_boards = {} @@ -1013,31 +1061,9 @@ class Builder: read_func_sizes, read_config, read_environment) board_dict[brd.target] = outcome - last_func = None - last_was_warning = False - for line in outcome.err_lines: - if line: - if (self._re_function.match(line) or - self._re_files.match(line)): - last_func = line - else: - is_warning = (self._re_warning.match(line) or - self._re_dtb_warning.match(line)) - is_note = self._re_note.match(line) - if is_warning or (last_was_warning and is_note): - if last_func: - add_line(warn_lines_summary, warn_lines_boards, - last_func, brd) - add_line(warn_lines_summary, warn_lines_boards, - line, brd) - else: - if last_func: - add_line(err_lines_summary, err_lines_boards, - last_func, brd) - add_line(err_lines_summary, err_lines_boards, - line, brd) - last_was_warning = is_warning - last_func = None + self._categorise_err_lines(outcome.err_lines, brd, + err_lines_summary, err_lines_boards, + warn_lines_summary, warn_lines_boards) tconfig = Config(self.config_filenames, brd.target) for fname in self.config_filenames: if outcome.config: From patchwork Tue Jan 6 22:03:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1319 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=1767737136; bh=FlQfEodLXWRDFJ9PPqJmDC/vIF/QLQJjxU6aKKhvwP0=; 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=kZNhou5tMNryCnA3djLbKfOTQK3GAuUdbSeW3Uk9TMHdIA2cqdMyLm6oGqBTLHXAH PDNPgqRtq5d+xgcBIWqHrnlrGsXueQRZHn8RfwRvg8T27IMcpQDdNNhOpPFCRcCj7g T1K8IbWVigBZi+MFvbAslKaVBqkIjXzY+vmY6j9+T9AcBL/J7so09ZTH8+e1M+UyUN i6W1lNdIxsPidb5mJjTgQRexH1mCetNmvOG1vTReAaeHpldJigflOFYmeFLMG/ju4Y vPCckPaV+gY2+4TLaQYnLEoKgff8UivF/vr71n6kuDjwUZOl9PPenvyn2NxLKTCl1t QeqM0PWrxRVHA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 16A165FF82 for ; Tue, 6 Jan 2026 15:05:36 -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 OBk8F-xDAw_v for ; Tue, 6 Jan 2026 15:05:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737136; bh=FlQfEodLXWRDFJ9PPqJmDC/vIF/QLQJjxU6aKKhvwP0=; 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=kZNhou5tMNryCnA3djLbKfOTQK3GAuUdbSeW3Uk9TMHdIA2cqdMyLm6oGqBTLHXAH PDNPgqRtq5d+xgcBIWqHrnlrGsXueQRZHn8RfwRvg8T27IMcpQDdNNhOpPFCRcCj7g T1K8IbWVigBZi+MFvbAslKaVBqkIjXzY+vmY6j9+T9AcBL/J7so09ZTH8+e1M+UyUN i6W1lNdIxsPidb5mJjTgQRexH1mCetNmvOG1vTReAaeHpldJigflOFYmeFLMG/ju4Y vPCckPaV+gY2+4TLaQYnLEoKgff8UivF/vr71n6kuDjwUZOl9PPenvyn2NxLKTCl1t QeqM0PWrxRVHA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 023F369146 for ; Tue, 6 Jan 2026 15:05:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737133; bh=oVMYQDFUC0QvQJuqdyneTUAK8IBBc2cCn0oeVt4uckA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U25yZJIL/Nsd6ooal5B3dGIbDMfX981E4KQJ1JBZjM7hA01JStpozrf2ZvPicnaZG qrfFJQ+iH6MRocNpXkWhBtdnz69e9/ixDuNcZDCWxGeE76thiBRqeM9BvUkRraDRYX zGwObRb9HRnL3NtNTd/+lwhk/FzIy8chopdXOQCfxXbKZ4sux1sHUBVvjasq7w4cIP vXaFu3QU8Y6RmF+jp5Sj5jHleJ0sf/HF2PBFDF1XpluO7W3Tk6XZqYzWJibKQ3UIsc hgN7hFB/sXHDewHV1Aa+zBCVjo8ILNCT4maNqar9eMzuWThoEFq49tUFddaGhl8rXK gqXqK0cPHDBRg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8861E5FF82; Tue, 6 Jan 2026 15:05:33 -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 VgI3zh5a45US; Tue, 6 Jan 2026 15:05:33 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737129; bh=ghC/zIAWT92V+FFWqevkyWP2JXZvhgDr3PsdQbB+Au8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AlVgi/BaLD9VX1uwmjs8IZU1r/oZQq/1HL3mLrbF+Wvd6tSOgVe7qXYNdYVliNloe 2TK91IvNaGjmrn+fMe0/buHEbEtOCiTyzWtt5JnHwGEDxE8LKl+l49BxqUR72zNgSK fAxPz2fOJUWlJDKfIHUtufz3m/6wOXJ/lKzsJliVTkqo5XmH2DoEZR0ojJKDFbx99H XYwM35CdFzmHfdReDwhCppHFQ22vu5n6S3WWJLq4hFYxuoYcFeH8QmXldJvliraD6N NVoBKPFTJkshycsg5RtKuqeRWNnNlgnYTKfT3Hv7QWdZEgTrxJQv+Iio2v7X4nHMxh EjA/Bby5XaUUA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1333F690CB; Tue, 6 Jan 2026 15:05:29 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:34 -0700 Message-ID: <20260106220403.2915630-17-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: AWDGNSSHF6PMTTDVBYF6QODD67QBCOI2 X-Message-ID-Hash: AWDGNSSHF6PMTTDVBYF6QODD67QBCOI2 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 16/29] buildman: Refactor print_size_summary() 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 Extract the 'for target' loop into _calc_size_changes() to improve readability and reduce complexity in print_size_summary() Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 51 +++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 172a8970ec9..f1fbdc7b888 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1241,32 +1241,26 @@ class Builder: outcome.func_sizes[fname]) - def print_size_summary(self, board_selected, board_dict, show_detail, - show_bloat): - """Print a summary of image sizes broken down by section. + def _calc_size_changes(self, board_selected, board_dict): + """Calculate changes in size for different image parts - The summary takes the form of one line per architecture. The - line contains deltas for each of the sections (+ means the section - got bigger, - means smaller). The numbers are the average number - of bytes that a board in this section increased by. - - For example: - powerpc: (622 boards) text -0.0 - arm: (285 boards) text -0.0 + The previous sizes are in Board.sizes, for each board Args: board_selected (dict): Dict containing boards to summarise, keyed by board.target board_dict (dict): Dict containing boards for which we built this commit, keyed by board.target. The value is an Outcome object. - show_detail (bool): Show size delta detail for each board - show_bloat (bool): Show detail for each function + + Returns: + tuple: (arch_list, arch_count) where: + arch_list: dict keyed by arch name, containing a list of + size-change dicts + arch_count: dict keyed by arch name, containing the number of + boards for that arch """ arch_list = {} arch_count = {} - - # Calculate changes in size for different image parts - # The previous sizes are in Board.sizes, for each board for target in board_dict: if target not in board_selected: continue @@ -1303,6 +1297,31 @@ class Builder: arch_list[arch] = [err] else: arch_list[arch].append(err) + return arch_list, arch_count + + def print_size_summary(self, board_selected, board_dict, show_detail, + show_bloat): + """Print a summary of image sizes broken down by section. + + The summary takes the form of one line per architecture. The + line contains deltas for each of the sections (+ means the section + got bigger, - means smaller). The numbers are the average number + of bytes that a board in this section increased by. + + For example: + powerpc: (622 boards) text -0.0 + arm: (285 boards) text -0.0 + + Args: + board_selected (dict): Dict containing boards to summarise, keyed + by board.target + board_dict (dict): Dict containing boards for which we built this + commit, keyed by board.target. The value is an Outcome object. + show_detail (bool): Show size delta detail for each board + show_bloat (bool): Show detail for each function + """ + arch_list, arch_count = self._calc_size_changes(board_selected, + board_dict) # We now have a list of image size changes sorted by arch # Print out a summary of these From patchwork Tue Jan 6 22:03:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1320 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=1767737140; bh=+ZrvrIFaP4KnyKeUvlMAhCJrQ52/kv9omunx5tzK90o=; 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=tse7H6kccrBwNMRu3bHFfksVqp04N4+rLXnWiIJ4RbEomFNJFd3EnmL7rG51YKYxd fXQT3XRjmAWps//OZysUXIwz4aL4E2ZwV7KQFu9ATrB3oGrXhggjWAT9rF0rbKxoVq ugcd6Us6snnzgdn9t2bkyoOycYzRwEKXvsLgfMl6qiqvJNM88CJqcu5FXT5Dcfdk+H iQYJ5eN8ASud+lwxN8SqjAcP3bU9oHX0i97XmHO7t2eIm3T8fYzvXkBy78HoM41BTm PAIWLKCXhCjV8w1KQVFzwvcNhue+idlVQycGqlJS0VvNgYpDPF5Sxwq04fktUyFY6U vMRMIaqNrN7jQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8FCD269162 for ; Tue, 6 Jan 2026 15:05:40 -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 TCU57xfNf_17 for ; Tue, 6 Jan 2026 15:05:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737140; bh=+ZrvrIFaP4KnyKeUvlMAhCJrQ52/kv9omunx5tzK90o=; 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=tse7H6kccrBwNMRu3bHFfksVqp04N4+rLXnWiIJ4RbEomFNJFd3EnmL7rG51YKYxd fXQT3XRjmAWps//OZysUXIwz4aL4E2ZwV7KQFu9ATrB3oGrXhggjWAT9rF0rbKxoVq ugcd6Us6snnzgdn9t2bkyoOycYzRwEKXvsLgfMl6qiqvJNM88CJqcu5FXT5Dcfdk+H iQYJ5eN8ASud+lwxN8SqjAcP3bU9oHX0i97XmHO7t2eIm3T8fYzvXkBy78HoM41BTm PAIWLKCXhCjV8w1KQVFzwvcNhue+idlVQycGqlJS0VvNgYpDPF5Sxwq04fktUyFY6U vMRMIaqNrN7jQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7EDCA69146 for ; Tue, 6 Jan 2026 15:05:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737138; bh=d4s5cI7hT71fc7J0cJaDrGz6q9uepPRiKxYtTF4bRmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fO7M2bopwXc7FiscBAsQDT9CyA3kE2fb8vX00+0X1PYOiHor+dp9aLGChBwmj1fKD /X6JdScjRx7yc1nLT+TPCw+VKVibGk2UcjLKWJydfi2DSf/ERP3c2g3n0cMVNBcMXg MYBDG8lMEqLwPQr0nGBQSGs87g6ZiJDvlEz4Va46QxTZDo0GMNuXlZCZI8/h9ZUtd8 EvLGTHigToAujpjxVXacM4hY0Dl+rnafPk8ZO3HIxjXuyMVoXNraX6+Y+VtED8gDY0 +Iu+28pALjrcSoyyLcpmdDDzIiXNsDK9KWJhLBm4Q7lp4EIbmbRF1QRE4bGBk1Jmqw BOU0JafwQAMwg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7BC1869146; Tue, 6 Jan 2026 15:05:38 -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 g_8SSp9FyrtP; Tue, 6 Jan 2026 15:05:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737134; bh=J6Opj+mHnbyrzK/oGPOYIfFSdBtCoW0ntrnbgWsMQn0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=meHmx6PmMyuqeWH9iDm/oTAaIsNj/Cc1PKTWpAhtoRx4DiTjGb10b2d1IkvbSFNWs m+BB003MwL1fmJNsqmrZ73ZLuKCbYb3W+tu2dubIY6MLgRPUZPRSNxRl4NM7ZiSNe9 YUG7Y6+z38fbD6AqKUXq76cw6gFENRfd5z7VuQg+mLMzw6X5doQBc16ddYnuwSdqJk unitIxj03G0x6UNAVsf40nc/pAK0CcphUPZ+szjtQAOaDotWJFrQeKF3sLwu0tqH+V uEs69t/yfr/AwoqSJtDgPbakTZ2rysXtj5EVllrE9Ws2uUKHs1LAMvhazWJu++1b7M tJe54/ulWm9Ew== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C3388690CB; Tue, 6 Jan 2026 15:05:33 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:35 -0700 Message-ID: <20260106220403.2915630-18-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: YXODNEZNL3FNHUNFMYYKWNSNMX6CHGA3 X-Message-ID-Hash: YXODNEZNL3FNHUNFMYYKWNSNMX6CHGA3 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 17/29] buildman: Refactor _calc_size_changes() 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 Extract the inner 'for image' loop into _calc_image_size_changes() to improve readability and reduce nesting. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 50 ++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index f1fbdc7b888..5c33b737740 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1241,6 +1241,36 @@ class Builder: outcome.func_sizes[fname]) + @staticmethod + def _calc_image_size_changes(target, sizes, base_sizes): + """Calculate size changes for each image/part + + Args: + target (str): Target board name + sizes (dict): Dict of image sizes, keyed by image name + base_sizes (dict): Dict of base image sizes, keyed by image name + + Returns: + dict: Size changes, e.g.: + {'_target': 'snapper9g45', 'data': 5, 'u-boot-spl:text': -4} + meaning U-Boot data increased by 5 bytes, SPL text decreased + by 4 + """ + err = {'_target' : target} + for image in sizes: + if image in base_sizes: + base_image = base_sizes[image] + # Loop through the text, data, bss parts + for part in sorted(sizes[image]): + diff = sizes[image][part] - base_image[part] + if diff: + if image == 'u-boot': + name = part + else: + name = image + ':' + part + err[name] = diff + return err + def _calc_size_changes(self, board_selected, board_dict): """Calculate changes in size for different image parts @@ -1267,25 +1297,7 @@ class Builder: base_sizes = self._base_board_dict[target].sizes outcome = board_dict[target] sizes = outcome.sizes - - # Loop through the list of images, creating a dict of size - # changes for each image/part. We end up with something like - # {'target' : 'snapper9g45, 'data' : 5, 'u-boot-spl:text' : -4} - # which means that U-Boot data increased by 5 bytes and SPL - # text decreased by 4. - err = {'_target' : target} - for image in sizes: - if image in base_sizes: - base_image = base_sizes[image] - # Loop through the text, data, bss parts - for part in sorted(sizes[image]): - diff = sizes[image][part] - base_image[part] - if diff: - if image == 'u-boot': - name = part - else: - name = image + ':' + part - err[name] = diff + err = self._calc_image_size_changes(target, sizes, base_sizes) arch = board_selected[target].arch if not arch in arch_count: arch_count[arch] = 1 From patchwork Tue Jan 6 22:03:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1321 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=1767737145; bh=8gH13Ut7jKqzKyBdm9mlJfw8Lgs6gSTZpnvusYkjeBk=; 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=s72OJrvefCuxb2XYO4JS20LQnmsgy4LT9nR/uD5cAHAU9NwR5CnNxUPu6dUaP/74q z5mohGGjkEskefcb9tyPhFC4ijzANz4yZEpZxKKR+8kpNKSaZmA7lA4vRNwi0lr8Kq 0jmZlIGNGdeWv5W0BgETPHDbfRxTJ009Ogi+5rCKSkrorgkWSYTEnGcUiZKzW4v9k0 4S+cdiBPQzoujhO82aH8oqhIvAlCnOgetIRDfsgEdQnjOK2lnOfBnRFHZ2l10o2m+m 4htyq7YRuPqmKfZTXepxGXnjxD6lkFGjCReRAGlnOKDSQmtFBQEY+WqQ4ogwiYcC1g cBBJKEs0vWwzQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 03EE95FF82 for ; Tue, 6 Jan 2026 15:05:45 -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 Rm3bQWPjz1kt for ; Tue, 6 Jan 2026 15:05:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737144; bh=8gH13Ut7jKqzKyBdm9mlJfw8Lgs6gSTZpnvusYkjeBk=; 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=prn+AQJRbl06vbCor9cib2G2pKp0cvS0uy18dtr5L9HFBCk7ilxFSLgXsHyqg3sfI L4f+8eQV4Zu+m5889n0AacIp20UmlBunLz8No6SiN3oA8X1BbmDZixSE0HZYd20w0q 37egGEETrfTjPRz+J/v/Ih2OnqH4sSl50Pwc4mYu/mQeMTIA8wCO99Mgnz2NqVcar/ TRZ2xnScXBeoJFrCJKwjF+FRfZgvJaxJ3W4tBbEI6ZLEjkxeLOi85DYDLXXHxC/A9X ji4dKn9F/XXjwIzOVttNPIc8T7CxI+7OoJlSlON/8JeXLfhnwF1/Pqpmkn9EYN2hp1 ZQcRIWktRH5RQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E73C069146 for ; Tue, 6 Jan 2026 15:05:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737142; bh=npBjD7EYuZq7bwovZwg7jXoXnEzYuyeluTBQLAHd93U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mRDswH7Ow8urjPhhlJGe3xP5UAk01zoiZG5H7HuK+BsfPQLCGI8ck57X3q0RYJ3da pktfb8eJ8UxR/rSbt/1Q/FeWiB7TnVWLFmtQ2zirpgPRGJN4s93s5hiTjw8plpXelJ geBVK624LOO4J9mqUi8KznWAgJk6WboP60JhqUd7w8SIocr98d2+SGj0nyaHyIDhMm MA/+xWRsjCs84OdlsmgrroNNWmpbMikt2E9v1rEowC83fIkx1Ph3j5PHNC1T2xV9v7 4Ly/9oscxkV+Ix1Ao5dn3UP5tpxqkmMLgmBw62Th4St48oHls805Tl7gorrtJVCr9n DwZi0Kc/RvBAA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E70365FF82; Tue, 6 Jan 2026 15:05:42 -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 7Cqciqz9_KUA; Tue, 6 Jan 2026 15:05:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737138; bh=vuyLCq6uYwxH+UNj8uKjRlRBHW3FwfqqVGwJDQ3Zg7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SgAap7CvYl6+WT1EQyjPjVjPSP7Q54bbtGI4g3E54vB7XJnDU2NU8Xsq/9tAbp7un 0ssxNK4C0EgAzl5hSccnRlKi8zghsAZMNZee+eN8g+E44A13xx88ACY14fNkQDkRaC aL+pK4CfMR0oXEzlDfP3pCG4jUlKxDKIkbOSpSGEyL8zR+D48Dem+LK6dsz+6Iho9B gbkognDy2d4Dq5MehOttstP6xMeaWmrg7DCDO6drkHSLD0sX2kUcNPEwGdWz6GeLm0 N9oSq1TP0XNWiHjJCMRb1cIcPzvZx2eXkk1Kwe+WlDXbSFeypBTUS5K5eNvaGpouj4 8/beofMWIR0eg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 80F1C690CB; Tue, 6 Jan 2026 15:05:38 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:36 -0700 Message-ID: <20260106220403.2915630-19-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: SZ3AV5E7N5TRR7BTBJC67JBVU7FLALH7 X-Message-ID-Hash: SZ3AV5E7N5TRR7BTBJC67JBVU7FLALH7 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 18/29] buildman: Refactor print_size_summary() more 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 Extract the architecture size-printing code into _print_arch_size_summary() to improve readability and reduce complexity in print_size_summary() Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 55 +++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 5c33b737740..9d7357b5e06 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1353,26 +1353,41 @@ class Builder: result['_total_diff'] = total result['_outcome'] = board_dict[result['_target']] - count = len(target_list) - printed_arch = False - for name in sorted(totals): - diff = totals[name] - if diff: - # Display the average difference in this name for this - # architecture - avg_diff = float(diff) / count - color = self.col.RED if avg_diff > 0 else self.col.GREEN - msg = f' {name} {avg_diff:+1.1f}' - if not printed_arch: - tprint(f'{arch:>10s}: (for {count}/{arch_count[arch]} ' - 'boards)', newline=False) - printed_arch = True - tprint(msg, colour=color, newline=False) - - if printed_arch: - tprint() - if show_detail: - self.print_size_detail(target_list, show_bloat) + self._print_arch_size_summary(arch, target_list, arch_count, + totals, show_detail, show_bloat) + + def _print_arch_size_summary(self, arch, target_list, arch_count, totals, + show_detail, show_bloat): + """Print size summary for a single architecture + + Args: + arch (str): Architecture name + target_list (list): List of size-change dicts for this arch + arch_count (dict): Dict of arch name to board count + totals (dict): Dict of name to total size diff + show_detail (bool): Show size delta detail for each board + show_bloat (bool): Show detail for each function + """ + count = len(target_list) + printed_arch = False + for name in sorted(totals): + diff = totals[name] + if diff: + # Display the average difference in this name for this + # architecture + avg_diff = float(diff) / count + color = self.col.RED if avg_diff > 0 else self.col.GREEN + msg = f' {name} {avg_diff:+1.1f}' + if not printed_arch: + tprint(f'{arch:>10s}: (for {count}/{arch_count[arch]} ' + 'boards)', newline=False) + printed_arch = True + tprint(msg, colour=color, newline=False) + + if printed_arch: + tprint() + if show_detail: + self.print_size_detail(target_list, show_bloat) def print_result_summary(self, board_selected, board_dict, err_lines, From patchwork Tue Jan 6 22:03:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1322 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=1767737149; bh=ftPuSqwnDFAwTNWy03V/yNXcOrRKSaK2Ql4LepkiDTg=; 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=skgpepgcefM+W8MuLxCmC+oaGifE5WqzLBLkF4QrpT6Rr1bZXMAf4qIs6YVKri7cY hjupdy99+wkg+Z/bU60K1/WA4YCGmbfa3L46V2303SCJWoBtUGxICimOdiS3obH5Nx LIzOypqlZtGL1ZLOHael9mLUYhtgaUg/PjEoa2vjCatrUjq+iBYliJAGWKdVmFnY2e qBknLY8ChAAmrFZRa1OU02iAw4uUpVXeH0yiXBdMWPpjIZnb6JHB0LHTQFnWWcnGw/ Aj2D/2yJ5r21zWxGa7E9sKtjANtNXdyxw7s8Po3xRQU6zcUMMSlF1VQ3Mq6JSvf030 lRRkibE00417g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DFE116916C for ; Tue, 6 Jan 2026 15:05:49 -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 fAQNCllpiwhm for ; Tue, 6 Jan 2026 15:05:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737149; bh=ftPuSqwnDFAwTNWy03V/yNXcOrRKSaK2Ql4LepkiDTg=; 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=skgpepgcefM+W8MuLxCmC+oaGifE5WqzLBLkF4QrpT6Rr1bZXMAf4qIs6YVKri7cY hjupdy99+wkg+Z/bU60K1/WA4YCGmbfa3L46V2303SCJWoBtUGxICimOdiS3obH5Nx LIzOypqlZtGL1ZLOHael9mLUYhtgaUg/PjEoa2vjCatrUjq+iBYliJAGWKdVmFnY2e qBknLY8ChAAmrFZRa1OU02iAw4uUpVXeH0yiXBdMWPpjIZnb6JHB0LHTQFnWWcnGw/ Aj2D/2yJ5r21zWxGa7E9sKtjANtNXdyxw7s8Po3xRQU6zcUMMSlF1VQ3Mq6JSvf030 lRRkibE00417g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CC06F69146 for ; Tue, 6 Jan 2026 15:05:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737147; bh=51Sy8/FE5koWZx5HjihkhCDlUN3diRPgM63Mb8YMXps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gI341D/4tfysEvQGzS4Ow9zYPP4VvUoYS0J6zjggBTgKWfD4To5qD5Y5OmfRl5yxL X9dOIhje7z9n145vy8T8gJq1IOs9GlDFdFEmPTDY9Ml0xay4SF0DomERlspRbx9Rh1 3tLCGFs0u3ijaBP5tEO2Fddq0Q3+C+C3TqNE10I2ZW75luadlSLmfMKMuICJWkqTqx dYj0QvCXEvXJWoqc9Csnl184VZYY42IgDZdkKM8skbGDO0hXeHn8PInu5/N46AxahK GWfAhU+yHSSQ0JmDmqQIJ5TX7m+SQ5zvKzd7gtxjEzs8pokzok5qMDGM5bUhBlWkvu VR1vdboulWPhQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8F6F75FF82; Tue, 6 Jan 2026 15:05:47 -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 QEG4oOwIhiZj; Tue, 6 Jan 2026 15:05:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737143; bh=xEc0OQqG85eyOFxujeYyDTv+Mk6eezNy5TzptgFp25g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DKjGnjvcbTRSeCHUhIbCJ+DyLGosA3ogXNkJQV492eLcgsH85SOT4/xnT9CXQvloo tq/34K8Tst6XH5hTWT8YYukBK6rFnOrU1cbuOhC2zUH3xD3BLxHRI5b/tFr3PFhO3+ lY9+5gvoFeNvH86CvmgnJdVAcxtcKsOcLQUHM/rPmahiKT5UEFd7m+Kpcc7PWtUvRw QipyBnynCVHpbt+Sci/pORXRHhL6s7vZSPRcjZvzmAMq/A65qdAEM8OZZREt/5FgD/ Wq1jdjOmMngkKJrtuXneIhXOBYMb6WkroNicG3ACyKNUW/Y0V+yr5KPz6qI+iEybf+ WJJLz44V+lenA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 104F0690CB; Tue, 6 Jan 2026 15:05:43 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:37 -0700 Message-ID: <20260106220403.2915630-20-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: 3S4LOVQTHHJIERTUYWEHWSVJGMRLB7FT X-Message-ID-Hash: 3S4LOVQTHHJIERTUYWEHWSVJGMRLB7FT 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 19/29] buildman: Refactor print_result_summary() 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 Extract several pieces from print_result_summary() to reduce its complexity: - _classify_boards(): Board classification loop - _calc_config(): Calculate configuration changes (static method) - _add_config(): Add configuration changes to a list (class method) - _output_config_info(): Output configuration change information Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 214 +++++++++++++++++++++----------------- 1 file changed, 119 insertions(+), 95 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 9d7357b5e06..011cd326926 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1389,6 +1389,109 @@ class Builder: if show_detail: self.print_size_detail(target_list, show_bloat) + def _classify_boards(self, board_selected, board_dict): + """Classify boards into outcome categories + + Args: + board_selected (dict): Dict containing boards to summarise, keyed + by board.target + board_dict (dict): Dict containing boards for which we built this + commit, keyed by board.target. The value is an Outcome object. + + Returns: + tuple: (ok_boards, warn_boards, err_boards, new_boards, + unknown_boards) where each is a list of board targets + """ + ok_boards = [] # List of boards fixed since last commit + warn_boards = [] # List of boards with warnings since last commit + err_boards = [] # List of new broken boards since last commit + new_boards = [] # List of boards that didn't exist last time + unknown_boards = [] # List of boards that were not built + + for target in board_dict: + if target not in board_selected: + continue + + # If the board was built last time, add its outcome to a list + if target in self._base_board_dict: + base_outcome = self._base_board_dict[target].rc + outcome = board_dict[target] + if outcome.rc == OUTCOME_UNKNOWN: + unknown_boards.append(target) + elif outcome.rc < base_outcome: + if outcome.rc == OUTCOME_WARNING: + warn_boards.append(target) + else: + ok_boards.append(target) + elif outcome.rc > base_outcome: + if outcome.rc == OUTCOME_WARNING: + warn_boards.append(target) + else: + err_boards.append(target) + else: + new_boards.append(target) + return ok_boards, warn_boards, err_boards, new_boards, unknown_boards + + @staticmethod + def _calc_config(delta, name, config): + """Calculate configuration changes + + Args: + delta: Type of the delta, e.g. '+' + name: name of the file which changed (e.g. .config) + config: configuration change dictionary + key: config name + value: config value + Returns: + String containing the configuration changes which can be + printed + """ + out = '' + for key in sorted(config.keys()): + out += f'{key}={config[key]} ' + return f'{delta} {name}: {out}' + + @classmethod + def _add_config(cls, lines, name, config_plus, config_minus, config_change): + """Add changes in configuration to a list + + Args: + lines: list to add to + name: config file name + config_plus: configurations added, dictionary + key: config name + value: config value + config_minus: configurations removed, dictionary + key: config name + value: config value + config_change: configurations changed, dictionary + key: config name + value: config value + """ + if config_plus: + lines.append(cls._calc_config('+', name, config_plus)) + if config_minus: + lines.append(cls._calc_config('-', name, config_minus)) + if config_change: + lines.append(cls._calc_config('c', name, config_change)) + + def _output_config_info(self, lines): + """Output configuration change information + + Args: + lines: List of configuration change strings + """ + for line in lines: + if not line: + continue + col = None + if line[0] == '+': + col = self.col.GREEN + elif line[0] == '-': + col = self.col.RED + elif line[0] == 'c': + col = self.col.YELLOW + tprint(' ' + line, newline=True, colour=col) def print_result_summary(self, board_selected, board_dict, err_lines, err_line_boards, warn_lines, warn_line_boards, @@ -1480,60 +1583,6 @@ class Builder: better_lines.append(errline) return better_lines, worse_lines - def _calc_config(delta, name, config): - """Calculate configuration changes - - Args: - delta: Type of the delta, e.g. '+' - name: name of the file which changed (e.g. .config) - config: configuration change dictionary - key: config name - value: config value - Returns: - String containing the configuration changes which can be - printed - """ - out = '' - for key in sorted(config.keys()): - out += f'{key}={config[key]} ' - return f'{delta} {name}: {out}' - - def _add_config(lines, name, config_plus, config_minus, config_change): - """Add changes in configuration to a list - - Args: - lines: list to add to - name: config file name - config_plus: configurations added, dictionary - key: config name - value: config value - config_minus: configurations removed, dictionary - key: config name - value: config value - config_change: configurations changed, dictionary - key: config name - value: config value - """ - if config_plus: - lines.append(_calc_config('+', name, config_plus)) - if config_minus: - lines.append(_calc_config('-', name, config_minus)) - if config_change: - lines.append(_calc_config('c', name, config_change)) - - def _output_config_info(lines): - for line in lines: - if not line: - continue - col = None - if line[0] == '+': - col = self.col.GREEN - elif line[0] == '-': - col = self.col.RED - elif line[0] == 'c': - col = self.col.YELLOW - tprint(' ' + line, newline=True, colour=col) - def _output_err_lines(err_lines, colour): """Output the line of error/warning lines, if not empty @@ -1562,34 +1611,8 @@ class Builder: self._error_lines += 1 - ok_boards = [] # List of boards fixed since last commit - warn_boards = [] # List of boards with warnings since last commit - err_boards = [] # List of new broken boards since last commit - new_boards = [] # List of boards that didn't exist last time - unknown_boards = [] # List of boards that were not built - - for target in board_dict: - if target not in board_selected: - continue - - # If the board was built last time, add its outcome to a list - if target in self._base_board_dict: - base_outcome = self._base_board_dict[target].rc - outcome = board_dict[target] - if outcome.rc == OUTCOME_UNKNOWN: - unknown_boards.append(target) - elif outcome.rc < base_outcome: - if outcome.rc == OUTCOME_WARNING: - warn_boards.append(target) - else: - ok_boards.append(target) - elif outcome.rc > base_outcome: - if outcome.rc == OUTCOME_WARNING: - warn_boards.append(target) - else: - err_boards.append(target) - else: - new_boards.append(target) + ok_boards, warn_boards, err_boards, new_boards, unknown_boards = \ + self._classify_boards(board_selected, board_dict) # Get a list of errors and warnings that have appeared, and disappeared better_err, worse_err = _calc_error_delta(self._base_err_lines, @@ -1658,10 +1681,10 @@ class Builder: desc = f'{value} -> {new_value}' environment_change[key] = desc - _add_config(lines, target, environment_plus, environment_minus, - environment_change) + self._add_config(lines, target, environment_plus, + environment_minus, environment_change) - _output_config_info(lines) + self._output_config_info(lines) if show_config and self._base_config: summary = {} @@ -1724,10 +1747,10 @@ class Builder: arch_config_minus[arch][name].update(config_minus) arch_config_change[arch][name].update(config_change) - _add_config(lines, name, config_plus, config_minus, - config_change) - _add_config(lines, 'all', all_config_plus, all_config_minus, - all_config_change) + self._add_config(lines, name, config_plus, config_minus, + config_change) + self._add_config(lines, 'all', all_config_plus, + all_config_minus, all_config_change) summary[target] = '\n'.join(lines) lines_by_target = {} @@ -1746,20 +1769,21 @@ class Builder: all_plus.update(arch_config_plus[arch][name]) all_minus.update(arch_config_minus[arch][name]) all_change.update(arch_config_change[arch][name]) - _add_config(lines, name, arch_config_plus[arch][name], - arch_config_minus[arch][name], - arch_config_change[arch][name]) - _add_config(lines, 'all', all_plus, all_minus, all_change) + self._add_config(lines, name, + arch_config_plus[arch][name], + arch_config_minus[arch][name], + arch_config_change[arch][name]) + self._add_config(lines, 'all', all_plus, all_minus, all_change) #arch_summary[target] = '\n'.join(lines) if lines: tprint(f'{arch}:') - _output_config_info(lines) + self._output_config_info(lines) for lines, targets in lines_by_target.items(): if not lines: continue tprint(f"{' '.join(sorted(targets))} :") - _output_config_info(lines.split('\n')) + self._output_config_info(lines.split('\n')) # Save our updated information for the next call to this function From patchwork Tue Jan 6 22:03:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1323 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=1767737153; bh=mfULeNyw6/jFe78mB7j4dFKZnnYEB+Ekn2lryZvdEok=; 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=kqDjgIkjL7GcJiXY6OlQ66EC3ma8Zzt4H/9lNXaT2vKRi8x/78pUqdqzeZEZ/gm4F w7lW7Vis4DvEFO8mPVldMUC8V0rQCPcn5ocUq/TanLO8dmRieVA5VY1ejTQ4Ft97H7 VRp6zH1TaP6+8+hCOAmF+GE7mcq3h9Eq/0Ir9PiagSevH2USZEob3265sdqFv8g4s/ qsoNGUL2SUY/cb5wwJX4t0+Z7zEDxBS0DB4KgTv4fgBAleCjOfbB4O00AvwnALXcB5 WyrWWHa61tXwAKIxWMaIKFOSEdKbX53d5DlM6f7gIqAVA+A2Ptx25a5X9k2aAa1244 V8AJvs/LM3cNg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6299B5FF82 for ; Tue, 6 Jan 2026 15:05:53 -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 NZ1QeOMmJr2p for ; Tue, 6 Jan 2026 15:05:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737153; bh=mfULeNyw6/jFe78mB7j4dFKZnnYEB+Ekn2lryZvdEok=; 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=kqDjgIkjL7GcJiXY6OlQ66EC3ma8Zzt4H/9lNXaT2vKRi8x/78pUqdqzeZEZ/gm4F w7lW7Vis4DvEFO8mPVldMUC8V0rQCPcn5ocUq/TanLO8dmRieVA5VY1ejTQ4Ft97H7 VRp6zH1TaP6+8+hCOAmF+GE7mcq3h9Eq/0Ir9PiagSevH2USZEob3265sdqFv8g4s/ qsoNGUL2SUY/cb5wwJX4t0+Z7zEDxBS0DB4KgTv4fgBAleCjOfbB4O00AvwnALXcB5 WyrWWHa61tXwAKIxWMaIKFOSEdKbX53d5DlM6f7gIqAVA+A2Ptx25a5X9k2aAa1244 V8AJvs/LM3cNg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 50EA669146 for ; Tue, 6 Jan 2026 15:05:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737152; bh=iH1F/wSPJNi7yi367zxCKWHlFlbmRNYZAUFsakGPvUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FWJE7oGAzDVWUAVNWXWQvdOW0o/+dgUT2kEfpQQoJXONSpoenaWT6B9knNbkeUoGN EOXh8ALDoaBFXVYIqyQJjcaXoB+1gEydRZz/UIy9rFTy3QeOQ+/RkgqIUbnHDcAG6g CDuyNN784TTzKuvl8AiFBPBdCtom9lpsGBx0HV4OhBIOA+dUGf3ST9uX9XAfjSYcD+ Jq/8GyOwMBP3Fa2lOLAHLUEeGU8aJyW6P1Fur0QLiia+4srPWbgR6IcXCBZ7em3WZC eADsTcZ8kmZoWSr7LK0ixlf1IgOVNV/5DN70aDgegCXLdukCaJMxnqm0TBGjUcn1lX RI3CIwFbRdJfA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5606E5FF82; Tue, 6 Jan 2026 15:05:52 -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 lc7v1n5kGq7k; Tue, 6 Jan 2026 15:05:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737148; bh=mJOgYSsdaM7QXTfhYhzo9M61R6/L1/63YLTspalzdKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q5RBFoK4CfROQd9H3Ol5NsaxyyU0kLNUvAAbx2xWVpn6WO1VJtzkk/RSsgr//5Uyq zFQLKz2mvojjZNm9lgUzvRRyTlTB9vL8/jeS493VAPkY+TdNyS+mUAnZfNFOZC7xcS o4+a6/+XoYTvfOQE+EE7SN2TO3jR6wrRnwMz/aNVosIgl4w+gJwFU17T7aBFz2zkIq Fkp6PyRes2iLDQ8CtuchxWg26IopLAwEgG+pVljCsAhLCLHcOPN8Gh9gC7C5gSUO1G 3nULdrujLcU2HetfqLDZKaq6TbjsgP8s/v65XM2nQTlWtgMd/hzZUpWikoEphFFuc6 mr5aOglHV48Lw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CE80A690CB; Tue, 6 Jan 2026 15:05:47 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:38 -0700 Message-ID: <20260106220403.2915630-21-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: OCAXOF5PYSVTY45RYUTUKI7ORMGDOHKU X-Message-ID-Hash: OCAXOF5PYSVTY45RYUTUKI7ORMGDOHKU 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 20/29] buildman: Split out environment and config display 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 Extract the environment and config display logic from print_result_summary() into separate methods: - _show_environment_changes(): Display environment variable changes - _show_config_changes(): Display configuration changes Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 274 +++++++++++++++++++++----------------- 1 file changed, 149 insertions(+), 125 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 011cd326926..a632a6a6ade 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1493,6 +1493,152 @@ class Builder: col = self.col.YELLOW tprint(' ' + line, newline=True, colour=col) + def _show_environment_changes(self, board_selected, board_dict, + environment): + """Show changes in environment variables + + Args: + board_selected (dict): Dict containing boards to summarise, keyed + by board.target + board_dict (dict): Dict containing boards for which we built this + commit, keyed by board.target. The value is an Outcome object. + environment (dict): Dict of environment changes, keyed by + board.target + """ + lines = [] + for target in board_dict: + if target not in board_selected: + continue + + tbase = self._base_environment[target] + tenvironment = environment[target] + environment_plus = {} + environment_minus = {} + environment_change = {} + base = tbase.environment + for key, value in tenvironment.environment.items(): + if key not in base: + environment_plus[key] = value + for key, value in base.items(): + if key not in tenvironment.environment: + environment_minus[key] = value + for key, value in base.items(): + new_value = tenvironment.environment.get(key) + if new_value and value != new_value: + desc = f'{value} -> {new_value}' + environment_change[key] = desc + + self._add_config(lines, target, environment_plus, + environment_minus, environment_change) + self._output_config_info(lines) + + def _show_config_changes(self, board_selected, board_dict, config): + """Show changes in configuration + + Args: + board_selected (dict): Dict containing boards to summarise, keyed + by board.target + board_dict (dict): Dict containing boards for which we built this + commit, keyed by board.target. The value is an Outcome object. + config (dict): Dict of config changes, keyed by board.target + """ + summary = {} + arch_config_plus = {} + arch_config_minus = {} + arch_config_change = {} + arch_list = [] + + for target in board_dict: + if target not in board_selected: + continue + arch = board_selected[target].arch + if arch not in arch_list: + arch_list.append(arch) + + for arch in arch_list: + arch_config_plus[arch] = {} + arch_config_minus[arch] = {} + arch_config_change[arch] = {} + for name in self.config_filenames: + arch_config_plus[arch][name] = {} + arch_config_minus[arch][name] = {} + arch_config_change[arch][name] = {} + + for target in board_dict: + if target not in board_selected: + continue + + arch = board_selected[target].arch + + all_config_plus = {} + all_config_minus = {} + all_config_change = {} + tbase = self._base_config[target] + tconfig = config[target] + lines = [] + for name in self.config_filenames: + if not tconfig.config[name]: + continue + config_plus = {} + config_minus = {} + config_change = {} + base = tbase.config[name] + for key, value in tconfig.config[name].items(): + if key not in base: + config_plus[key] = value + all_config_plus[key] = value + for key, value in base.items(): + if key not in tconfig.config[name]: + config_minus[key] = value + all_config_minus[key] = value + for key, value in base.items(): + new_value = tconfig.config.get(key) + if new_value and value != new_value: + desc = f'{value} -> {new_value}' + config_change[key] = desc + all_config_change[key] = desc + + arch_config_plus[arch][name].update(config_plus) + arch_config_minus[arch][name].update(config_minus) + arch_config_change[arch][name].update(config_change) + + self._add_config(lines, name, config_plus, config_minus, + config_change) + self._add_config(lines, 'all', all_config_plus, + all_config_minus, all_config_change) + summary[target] = '\n'.join(lines) + + lines_by_target = {} + for target, lines in summary.items(): + if lines in lines_by_target: + lines_by_target[lines].append(target) + else: + lines_by_target[lines] = [target] + + for arch in arch_list: + lines = [] + all_plus = {} + all_minus = {} + all_change = {} + for name in self.config_filenames: + all_plus.update(arch_config_plus[arch][name]) + all_minus.update(arch_config_minus[arch][name]) + all_change.update(arch_config_change[arch][name]) + self._add_config(lines, name, + arch_config_plus[arch][name], + arch_config_minus[arch][name], + arch_config_change[arch][name]) + self._add_config(lines, 'all', all_plus, all_minus, all_change) + if lines: + tprint(f'{arch}:') + self._output_config_info(lines) + + for lines, targets in lines_by_target.items(): + if not lines: + continue + tprint(f"{' '.join(sorted(targets))} :") + self._output_config_info(lines.split('\n')) + def print_result_summary(self, board_selected, board_dict, err_lines, err_line_boards, warn_lines, warn_line_boards, config, environment, show_sizes, show_detail, @@ -1657,133 +1803,11 @@ class Builder: show_bloat) if show_environment and self._base_environment: - lines = [] - - for target in board_dict: - if target not in board_selected: - continue - - tbase = self._base_environment[target] - tenvironment = environment[target] - environment_plus = {} - environment_minus = {} - environment_change = {} - base = tbase.environment - for key, value in tenvironment.environment.items(): - if key not in base: - environment_plus[key] = value - for key, value in base.items(): - if key not in tenvironment.environment: - environment_minus[key] = value - for key, value in base.items(): - new_value = tenvironment.environment.get(key) - if new_value and value != new_value: - desc = f'{value} -> {new_value}' - environment_change[key] = desc - - self._add_config(lines, target, environment_plus, - environment_minus, environment_change) - - self._output_config_info(lines) + self._show_environment_changes(board_selected, board_dict, + environment) if show_config and self._base_config: - summary = {} - arch_config_plus = {} - arch_config_minus = {} - arch_config_change = {} - arch_list = [] - - for target in board_dict: - if target not in board_selected: - continue - arch = board_selected[target].arch - if arch not in arch_list: - arch_list.append(arch) - - for arch in arch_list: - arch_config_plus[arch] = {} - arch_config_minus[arch] = {} - arch_config_change[arch] = {} - for name in self.config_filenames: - arch_config_plus[arch][name] = {} - arch_config_minus[arch][name] = {} - arch_config_change[arch][name] = {} - - for target in board_dict: - if target not in board_selected: - continue - - arch = board_selected[target].arch - - all_config_plus = {} - all_config_minus = {} - all_config_change = {} - tbase = self._base_config[target] - tconfig = config[target] - lines = [] - for name in self.config_filenames: - if not tconfig.config[name]: - continue - config_plus = {} - config_minus = {} - config_change = {} - base = tbase.config[name] - for key, value in tconfig.config[name].items(): - if key not in base: - config_plus[key] = value - all_config_plus[key] = value - for key, value in base.items(): - if key not in tconfig.config[name]: - config_minus[key] = value - all_config_minus[key] = value - for key, value in base.items(): - new_value = tconfig.config.get(key) - if new_value and value != new_value: - desc = f'{value} -> {new_value}' - config_change[key] = desc - all_config_change[key] = desc - - arch_config_plus[arch][name].update(config_plus) - arch_config_minus[arch][name].update(config_minus) - arch_config_change[arch][name].update(config_change) - - self._add_config(lines, name, config_plus, config_minus, - config_change) - self._add_config(lines, 'all', all_config_plus, - all_config_minus, all_config_change) - summary[target] = '\n'.join(lines) - - lines_by_target = {} - for target, lines in summary.items(): - if lines in lines_by_target: - lines_by_target[lines].append(target) - else: - lines_by_target[lines] = [target] - - for arch in arch_list: - lines = [] - all_plus = {} - all_minus = {} - all_change = {} - for name in self.config_filenames: - all_plus.update(arch_config_plus[arch][name]) - all_minus.update(arch_config_minus[arch][name]) - all_change.update(arch_config_change[arch][name]) - self._add_config(lines, name, - arch_config_plus[arch][name], - arch_config_minus[arch][name], - arch_config_change[arch][name]) - self._add_config(lines, 'all', all_plus, all_minus, all_change) - #arch_summary[target] = '\n'.join(lines) - if lines: - tprint(f'{arch}:') - self._output_config_info(lines) - - for lines, targets in lines_by_target.items(): - if not lines: - continue - tprint(f"{' '.join(sorted(targets))} :") - self._output_config_info(lines.split('\n')) + self._show_config_changes(board_selected, board_dict, config) # Save our updated information for the next call to this function From patchwork Tue Jan 6 22:03:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1324 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=1767737158; bh=RFhgl+QjJWMPgFqHcC/Htoiv5jBI3lJqEDhK5zU0qwg=; 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=iEgVWMryfqsa86ndKNcPYHMit2DP/NLT4vyOj/bmYueDNTiG9sU6SGC+BNdTx+7nL OzsmozpQwyUxmA3maJPgV0m3V3MNKx+YiCgiwpbFU+YBgLeQVk7PYRo/MFNgifV3il kVTot+2Ca/tX6xzZ+ekXnImOs2lWf2E30jkhgNDtyVV6TlzM+yms8cDR3/o8vm+Y07 HltqJINLqhdQKmA65H79sks5R2jMoIyly1kDntGHSkjqRNMeUOEHS/kC5SfFpV/y7f io72u+vHf5eGnBO++DzW2FQ0Pmrdup13jcNMr/dmdTuqg9Yi5uhp/+GDIqSK0dnA1T KnlvGTqPwPkmg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DE87A6916C for ; Tue, 6 Jan 2026 15:05:58 -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 6zJknsGEjqmT for ; Tue, 6 Jan 2026 15:05:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737158; bh=RFhgl+QjJWMPgFqHcC/Htoiv5jBI3lJqEDhK5zU0qwg=; 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=iEgVWMryfqsa86ndKNcPYHMit2DP/NLT4vyOj/bmYueDNTiG9sU6SGC+BNdTx+7nL OzsmozpQwyUxmA3maJPgV0m3V3MNKx+YiCgiwpbFU+YBgLeQVk7PYRo/MFNgifV3il kVTot+2Ca/tX6xzZ+ekXnImOs2lWf2E30jkhgNDtyVV6TlzM+yms8cDR3/o8vm+Y07 HltqJINLqhdQKmA65H79sks5R2jMoIyly1kDntGHSkjqRNMeUOEHS/kC5SfFpV/y7f io72u+vHf5eGnBO++DzW2FQ0Pmrdup13jcNMr/dmdTuqg9Yi5uhp/+GDIqSK0dnA1T KnlvGTqPwPkmg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CD5EB69146 for ; Tue, 6 Jan 2026 15:05:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737157; bh=wCDSVyUReUSd32AQvhPYnngap7z03DzqV62maDOzGBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=abRdNbnQ8JG/te9KAXk+EDkWbKCcJlN4esWh/iYLL7P/G6gUFVTxUKrcJbaN/aGym 7DDOOrszR22GTNLeOz9q7DzZK0Tfm/jNdzOGlAl2HQC7sZ4SMZZB882Us3S1H5aPKN 1B9Yo9vlNw/4Nq1u4bL6i9MB2Fr3pnNQmWW21/ErscEhg36Tea/4x5z21NcO8HCwIn vwmKftC7zpQKaRwg9Sx4yPoh4/GEYb7fv2Ec64uSe6ayRf9ygIoDIPHCP549u/nFKU L8ZLrwmAOD1IFeSwBLoQaMOY43sq5+OsP9kV3srAIjI4HNNDW2oN4a1iO/5aybhlRQ Wplzm9ahrtL7g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0D2B35FF82; Tue, 6 Jan 2026 15:05:57 -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 obH8eVXQ--yK; Tue, 6 Jan 2026 15:05:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737152; bh=+5DiaqOWkMJM8PF3U1heobdwCdQ9vaTEg6JuTlosDW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B6egOYtbYDO3vQI8aXKG61zQSdnOaeh226Qn5Z0fwooz/QbFgbY0hnJAWkA9X5hGn qZmehbrKtyi4U/UJmIXkaB0YmcxjkPnh2rFJJYxWzyRLpfV1sAHr68AGWK7AcotYwG G6nNa8s9i0F11pDglWvI1aGF6Biyj7mF5xkEO2B5oW/cvZGRyL/uHdzo3xn1q/GnQw ZVson2HmLtwc6jW+/BZA1TNVDQibhMl8XQVYd5ORU3gcBUUx0Tlf4IgtUuSi9tpZSe SF5eBcj1spcyBHNbG4W8RwMyf6+dOIZ5kNQuym7nUSRdrIz8M6vzX0/LzGharickHK EiZIqWUI5UDhA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 93456690CB; Tue, 6 Jan 2026 15:05:52 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:39 -0700 Message-ID: <20260106220403.2915630-22-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: OPYLO7GUAILXBM4NN6EOULWKX46UBSBO X-Message-ID-Hash: OPYLO7GUAILXBM4NN6EOULWKX46UBSBO 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 21/29] buildman: Split out target loop in _show_config_changes() 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 Extract the per-target config calculation loop into _calc_config_changes() to improve readability and reduce complexity. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 98 +++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 39 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index a632a6a6ade..723d65bc76d 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1532,6 +1532,62 @@ class Builder: environment_minus, environment_change) self._output_config_info(lines) + def _calc_config_changes(self, target, arch, config, arch_config_plus, + arch_config_minus, arch_config_change): + """Calculate configuration changes for a single target + + Args: + target (str): Target board name + arch (str): Architecture name + config (dict): Dict of config changes, keyed by board.target + arch_config_plus (dict): Dict to update with added configs by + arch + arch_config_minus (dict): Dict to update with removed configs by + arch + arch_config_change (dict): Dict to update with changed configs by + arch + + Returns: + str: Summary of config changes for this target + """ + all_config_plus = {} + all_config_minus = {} + all_config_change = {} + tbase = self._base_config[target] + tconfig = config[target] + lines = [] + for name in self.config_filenames: + if not tconfig.config[name]: + continue + config_plus = {} + config_minus = {} + config_change = {} + base = tbase.config[name] + for key, value in tconfig.config[name].items(): + if key not in base: + config_plus[key] = value + all_config_plus[key] = value + for key, value in base.items(): + if key not in tconfig.config[name]: + config_minus[key] = value + all_config_minus[key] = value + for key, value in base.items(): + new_value = tconfig.config.get(key) + if new_value and value != new_value: + desc = f'{value} -> {new_value}' + config_change[key] = desc + all_config_change[key] = desc + + arch_config_plus[arch][name].update(config_plus) + arch_config_minus[arch][name].update(config_minus) + arch_config_change[arch][name].update(config_change) + + self._add_config(lines, name, config_plus, config_minus, + config_change) + self._add_config(lines, 'all', all_config_plus, + all_config_minus, all_config_change) + return '\n'.join(lines) + def _show_config_changes(self, board_selected, board_dict, config): """Show changes in configuration @@ -1567,46 +1623,10 @@ class Builder: for target in board_dict: if target not in board_selected: continue - arch = board_selected[target].arch - - all_config_plus = {} - all_config_minus = {} - all_config_change = {} - tbase = self._base_config[target] - tconfig = config[target] - lines = [] - for name in self.config_filenames: - if not tconfig.config[name]: - continue - config_plus = {} - config_minus = {} - config_change = {} - base = tbase.config[name] - for key, value in tconfig.config[name].items(): - if key not in base: - config_plus[key] = value - all_config_plus[key] = value - for key, value in base.items(): - if key not in tconfig.config[name]: - config_minus[key] = value - all_config_minus[key] = value - for key, value in base.items(): - new_value = tconfig.config.get(key) - if new_value and value != new_value: - desc = f'{value} -> {new_value}' - config_change[key] = desc - all_config_change[key] = desc - - arch_config_plus[arch][name].update(config_plus) - arch_config_minus[arch][name].update(config_minus) - arch_config_change[arch][name].update(config_change) - - self._add_config(lines, name, config_plus, config_minus, - config_change) - self._add_config(lines, 'all', all_config_plus, - all_config_minus, all_config_change) - summary[target] = '\n'.join(lines) + summary[target] = self._calc_config_changes( + target, arch, config, arch_config_plus, arch_config_minus, + arch_config_change) lines_by_target = {} for target, lines in summary.items(): From patchwork Tue Jan 6 22:03:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1325 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=1767737164; bh=VyRVPgNfRhr7TZacLRp6OSGT9B3KgXYUPbKs3mxcY68=; 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=VxCtXQ8CjHbSTZDsawN9uXbDQ4SmI+8mjNBaE8dWdCjVMs0MjFarfepdXKUm92Nix jY4TOspgCxT6scetTKZCtNkWwK40MVFVV5ohZxD5rygrmU3FWJH/Kl08Fr1BDVuioc BBANiJFb3zqvMpK1JiQSNziF/FR2jiRkallu8M/xhvDAhJDURqP23AhJ5ZCfIig0oc U3EioIWsiTTb2auU8YuD84Ivt6FWDPo8csKrtQWEJGeC38FUbIXQu8GtNzFbXwichQ lKpOEzrDR/Kz5zPNtNjHGq3uvaorcMJAEfKrsJQR6U9u+CkpjJ04B1o206i57jnoV5 6O9WwbQn3EgdA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 203DC69172 for ; Tue, 6 Jan 2026 15:06:04 -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 qK7hVQ-_fAKH for ; Tue, 6 Jan 2026 15:06:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737164; bh=VyRVPgNfRhr7TZacLRp6OSGT9B3KgXYUPbKs3mxcY68=; 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=VxCtXQ8CjHbSTZDsawN9uXbDQ4SmI+8mjNBaE8dWdCjVMs0MjFarfepdXKUm92Nix jY4TOspgCxT6scetTKZCtNkWwK40MVFVV5ohZxD5rygrmU3FWJH/Kl08Fr1BDVuioc BBANiJFb3zqvMpK1JiQSNziF/FR2jiRkallu8M/xhvDAhJDURqP23AhJ5ZCfIig0oc U3EioIWsiTTb2auU8YuD84Ivt6FWDPo8csKrtQWEJGeC38FUbIXQu8GtNzFbXwichQ lKpOEzrDR/Kz5zPNtNjHGq3uvaorcMJAEfKrsJQR6U9u+CkpjJ04B1o206i57jnoV5 6O9WwbQn3EgdA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 095B05FF82 for ; Tue, 6 Jan 2026 15:06:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737161; bh=3GS2m/RRBkT7ddylt5QzGmcJX4nD79Qqz65VuPZKlhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cn35aPRlt6ShY38FHgYJV8yeaUgsY8OwqMM9hkC3jSVhKNnhrBIMTFOgdJrKRFMGZ wvC5x9pSEk6WTLvrgEh0OmufMEy+AYzkIUUbogsMpN//UsM0fUb+9MkFvYulaYvjVj NseJfWSu0tcTdFYkQrARzg3gAEMWcbxqQgLhU4yupFqXGphi0rJj1dr5ZSfz0kk6Mu gTX/0bl52KLjT09a7+rUZ6uXlVbegAdSqs96Vs2VALc2ZcUv7rtbO7zzbOJ5jhrkhq iKMVp80F22YYQR5Q9ZRzQNrEH0kIvf3BwjJwr24rm7WGj8Hl17H9aVZ9YgkGqZM1U2 7cTlPiM5qMHqQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 778F95FF82; Tue, 6 Jan 2026 15:06:01 -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 83UD-vS-X6xc; Tue, 6 Jan 2026 15:06:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737157; bh=rnBg13+Sdn1NfVdoXNhMJCtcUG0M+jAMD3hHUw0rgJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hC13RJI5xTfMD2x3fFIpHcNNMNYnNs3EdTEAYp7CwJ95ia8UYZLbffv8TUBlLmDfQ mHvQ2JxFtBDkMMhq1LijonHcCfR06s8ssP9WPAZjZS/WMaLYh6bvDF9Cuv+0Zj2/YS I18dBbESbOmPV6T8ulpwJn8cJFGvILgUOJ/giZPqbcDtzeOrMNyH9yFJcONi+UkQ9Z PULs1XNrJvHcKm5ynhHyZFv4pPH9gdcNWYzagudpDjlQQNiZM4eut00XespXbA7TlA XsI/fnCEPFFtwj5lcFPithCaWz4NPm5znCP+sQzO+QYFPtX2Bd+oWy945CE9AIeY9R BI56jQ3F0v36A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4CCA3690CB; Tue, 6 Jan 2026 15:05:57 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:40 -0700 Message-ID: <20260106220403.2915630-23-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: OJXXUP3MLGVYYTOIGB6NBYIQ3CUN2TTQ X-Message-ID-Hash: OJXXUP3MLGVYYTOIGB6NBYIQ3CUN2TTQ 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 22/29] buildman: Split out arch config summary display 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 Extract the 'for arch in arch_list' loop that prints configuration summaries into _print_arch_config_summary() to reduce complexity. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 46 +++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 723d65bc76d..7217cccc687 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1588,6 +1588,33 @@ class Builder: all_config_minus, all_config_change) return '\n'.join(lines) + def _print_arch_config_summary(self, arch, arch_config_plus, + arch_config_minus, arch_config_change): + """Print configuration summary for a single architecture + + Args: + arch (str): Architecture name + arch_config_plus (dict): Dict of added configs by arch/filename + arch_config_minus (dict): Dict of removed configs by arch/filename + arch_config_change (dict): Dict of changed configs by arch/filename + """ + lines = [] + all_plus = {} + all_minus = {} + all_change = {} + for name in self.config_filenames: + all_plus.update(arch_config_plus[arch][name]) + all_minus.update(arch_config_minus[arch][name]) + all_change.update(arch_config_change[arch][name]) + self._add_config(lines, name, + arch_config_plus[arch][name], + arch_config_minus[arch][name], + arch_config_change[arch][name]) + self._add_config(lines, 'all', all_plus, all_minus, all_change) + if lines: + tprint(f'{arch}:') + self._output_config_info(lines) + def _show_config_changes(self, board_selected, board_dict, config): """Show changes in configuration @@ -1636,22 +1663,9 @@ class Builder: lines_by_target[lines] = [target] for arch in arch_list: - lines = [] - all_plus = {} - all_minus = {} - all_change = {} - for name in self.config_filenames: - all_plus.update(arch_config_plus[arch][name]) - all_minus.update(arch_config_minus[arch][name]) - all_change.update(arch_config_change[arch][name]) - self._add_config(lines, name, - arch_config_plus[arch][name], - arch_config_minus[arch][name], - arch_config_change[arch][name]) - self._add_config(lines, 'all', all_plus, all_minus, all_change) - if lines: - tprint(f'{arch}:') - self._output_config_info(lines) + self._print_arch_config_summary(arch, arch_config_plus, + arch_config_minus, + arch_config_change) for lines, targets in lines_by_target.items(): if not lines: From patchwork Tue Jan 6 22:03:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1326 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=1767737166; bh=8tpvCI/qHHEw9pZQu+bgan+BkhO5IuP8wrkpFA90qew=; 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=XnwWdwPS1uoiUU0WHqs50P7Wy/txzcUBGmBt3LKrO8WEcEQUhCRWaJsc8eNAzuG9l kYln5qJlP+ztHZw3XLH/jU3gVPvsEEmGUh/FI4OskbcqNPZMrNwIdfkbCdCjy1Ac2r WjJ9StBAbPh0pV3NyCMNvJLVAjw06GoXosnANNYzlZGXAuZZheGG9SeU+BXhwTYyAl ayzeuXNzBxLj4YeUw74gcm0g3ykp9UQzXyQCr/ETM+FCVfDKm/snOPj/xEKPsx7719 BBVrQVDdKaD4NBb7J+CHDASqIx/5yh6KnyMOHIPQhEruvkdsaMFoSmTakKojbFK4dI ea8PvFZzFZfKg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 972BD69146 for ; Tue, 6 Jan 2026 15:06:06 -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 d6Cyq9fqkRxW for ; Tue, 6 Jan 2026 15:06:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737164; bh=8tpvCI/qHHEw9pZQu+bgan+BkhO5IuP8wrkpFA90qew=; 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=P0jOmDwaKo+kn16WF+MqOkLHR+u2+AvlLDoLO2KAIZ//ZRRIY8tV/AdF3jM2x1PID 4uAL1XwCV3gRXfp8lIbTAGnSRSHmXlJjGoU+3JuDvTLIaGK4I2k1q3i5SYMUf6Zy3s iYR6s0Y7FSwN3iawmKxPJx1ms0mXGH6/544bEEO5M6WHXdQvVX+18nHZurBnbh26ta RkG5fktIcPN8cUGK0BBwOKJD4LdC9Yy4JY8Hqdyr3l90JfVQv1E+eP9JuPWqFx30W0 NusfnklxNiQGK8iroHNaP465iqnSEKxKIpyvxYIo9e+B46vSt8O5rTLIV7e23OgKlS n+Dw45VmsgBlg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9973769173 for ; Tue, 6 Jan 2026 15:06:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737162; bh=ek6WIAPSBMtycINTQy/RtgEKqYgi9x1pvVZfNaKvtJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C846UV/L0LBEHBO+LKJVO3vx6s0QAm4tVzPYbhbs7FRc2vHDKc2sF1cH86ysWfjcE Y/IyOdQpbHUDONRlM6elJlyn0q+9Xx+UfcZaphon3CbwQG8ln9WRPRLaHmKzjVbeVm qJSxnfTxlVbwM4+2mWtaFESDQyIEtzpY7SVY8nQd7/tpWI9lDbHOjRQ///UfnfJJr3 nx2COBB4ciPjYwu6Rp9hPG0HEq76lK/i8PRTDQH7DdXb75xZBpj4Woplnt1H/mvBEv KqEPzwwhcjW+bV+OzdcBZ+UP+D6YO4Wv6JNr0WE3G0RuUGD8JyojajRPxh+5A1D0nz I0bfYD8Z1qzmQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6811769162; Tue, 6 Jan 2026 15:06:02 -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 iK_Sh2vYsaXL; Tue, 6 Jan 2026 15:06:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737162; bh=V/W+ZriyDc5v3iY4iJXiiqHaw2iW1/2AkByTWRjN4YI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XpB7KFeYDt5awClW9RZmbFYHUeKbFE/bnUPLi6JuzEmvcFKIFt4B1FJk+aCSdDe92 Ukm96QHSrqMSmjLD+fLpS6PISOBeZRvvjN743BjX+Rwql6fzkgCO2vhniWyaRMK8ob +u0w9/7xZ3QIlj3FDyX3thdhNKzdmF7c81e0Ru48gwt7FVoVGVLzjRObP1jg8e+LaO Hq1fYvI2R7gJ3zTRvSidxMnuXt4xvyJ6GZ4Sv1b1XsOxLrsSZZdn6fx2yeAMFDpwZj H5DmQ51EnLBdIVNNTounENqJBMOZN5J+wTP2vw15n04do78/qz1ArFRhta29aZJrvO pu6XMBlbq4fug== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B9288690CB; Tue, 6 Jan 2026 15:06:01 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:41 -0700 Message-ID: <20260106220403.2915630-24-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: YF6EWZYBEXSXFZNNJ3FIRHPRDELNT4KZ X-Message-ID-Hash: YF6EWZYBEXSXFZNNJ3FIRHPRDELNT4KZ 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 23/29] buildman: Return named tuple from _classify_boards() 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 Add BoardStatus named tuple to make the return value from _classify_boards() more self-documenting and easier to use. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 61 ++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 7217cccc687..db20c3d156d 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -112,6 +112,14 @@ u-boot/ source directory # errline: The text of the error line ErrLine = collections.namedtuple('ErrLine', 'char,brds,errline') +# Holds the outcome of classifying the boards: +# ok: List of boards fixed since last commit +# warn: List of boards with warnings since last commit +# err: List of new broken boards since last commit +# new: List of boards that didn't exist last time +# unknown: List of boards that were not built +BoardStatus = collections.namedtuple('BoardStatus', 'ok,warn,err,new,unknown') + # Possible build outcomes OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN = list(range(4)) @@ -1399,14 +1407,13 @@ class Builder: commit, keyed by board.target. The value is an Outcome object. Returns: - tuple: (ok_boards, warn_boards, err_boards, new_boards, - unknown_boards) where each is a list of board targets + BoardStatus: Named tuple containing lists of board targets """ - ok_boards = [] # List of boards fixed since last commit - warn_boards = [] # List of boards with warnings since last commit - err_boards = [] # List of new broken boards since last commit - new_boards = [] # List of boards that didn't exist last time - unknown_boards = [] # List of boards that were not built + ok = [] # List of boards fixed since last commit + warn = [] # List of boards with warnings since last commit + err = [] # List of new broken boards since last commit + new = [] # List of boards that didn't exist last time + unknown = [] # List of boards that were not built for target in board_dict: if target not in board_selected: @@ -1417,20 +1424,20 @@ class Builder: base_outcome = self._base_board_dict[target].rc outcome = board_dict[target] if outcome.rc == OUTCOME_UNKNOWN: - unknown_boards.append(target) + unknown.append(target) elif outcome.rc < base_outcome: if outcome.rc == OUTCOME_WARNING: - warn_boards.append(target) + warn.append(target) else: - ok_boards.append(target) + ok.append(target) elif outcome.rc > base_outcome: if outcome.rc == OUTCOME_WARNING: - warn_boards.append(target) + warn.append(target) else: - err_boards.append(target) + err.append(target) else: - new_boards.append(target) - return ok_boards, warn_boards, err_boards, new_boards, unknown_boards + new.append(target) + return BoardStatus(ok, warn, err, new, unknown) @staticmethod def _calc_config(delta, name, config): @@ -1791,8 +1798,7 @@ class Builder: self._error_lines += 1 - ok_boards, warn_boards, err_boards, new_boards, unknown_boards = \ - self._classify_boards(board_selected, board_dict) + brd_status = self._classify_boards(board_selected, board_dict) # Get a list of errors and warnings that have appeared, and disappeared better_err, worse_err = _calc_error_delta(self._base_err_lines, @@ -1810,20 +1816,21 @@ class Builder: sys.stderr.write(line) # Display results by arch - elif any((ok_boards, warn_boards, err_boards, unknown_boards, - new_boards, worse_err, better_err, worse_warn, better_warn)): + elif any((brd_status.ok, brd_status.warn, brd_status.err, + brd_status.unknown, brd_status.new, worse_err, better_err, + worse_warn, better_warn)): arch_list = {} - self.add_outcome(board_selected, arch_list, ok_boards, '', - self.col.GREEN) - self.add_outcome(board_selected, arch_list, warn_boards, 'w+', - self.col.YELLOW) - self.add_outcome(board_selected, arch_list, err_boards, '+', - self.col.RED) - self.add_outcome(board_selected, arch_list, new_boards, '*', + self.add_outcome(board_selected, arch_list, brd_status.ok, '', + self.col.GREEN) + self.add_outcome(board_selected, arch_list, brd_status.warn, 'w+', + self.col.YELLOW) + self.add_outcome(board_selected, arch_list, brd_status.err, '+', + self.col.RED) + self.add_outcome(board_selected, arch_list, brd_status.new, '*', self.col.BLUE) if self._show_unknown: - self.add_outcome(board_selected, arch_list, unknown_boards, '?', - self.col.MAGENTA) + self.add_outcome(board_selected, arch_list, brd_status.unknown, + '?', self.col.MAGENTA) for arch, target_list in arch_list.items(): tprint(f'{arch:>10s}: {target_list}') self._error_lines += 1 From patchwork Tue Jan 6 22:03:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1327 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=1767737171; bh=9numfcgB5VNadvgtVb//HduqnAkKPP1nqFWV/63IsnQ=; 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=vby4qAk2w/cUdJiM/7j41Ir8zc/amQnTcJD9wikpbavDuKoBWaXQ2zlon69uizchl dp8YQK5bYk40ozHCt+glN9Qir86exVtTDmXXKTVnafxiiAMBXfpvZaADpMsxeS8eTg JHYR5iES8jAudYPVzp4raNhFf0JbSaJy0K6+rqq+U88rKGNERm598ygN2Z5tFtUZZn dT2ZkIWyS5bhsSeocEFEkBrZHAL0M5+qLdx58+iFlSu1Hir3aPyhTh4ksYlSrfGvsf rfPeoiQQ0+Xl2e5O/YVhES2xZkrxu9k9JGGgG9z/IGUZkTXqEz8XQGEQ8Hqigxh98C PpsN1D8kNVOfw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7B93E69162 for ; Tue, 6 Jan 2026 15:06:11 -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 s6DxTPfZ8wvh for ; Tue, 6 Jan 2026 15:06:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737171; bh=9numfcgB5VNadvgtVb//HduqnAkKPP1nqFWV/63IsnQ=; 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=vby4qAk2w/cUdJiM/7j41Ir8zc/amQnTcJD9wikpbavDuKoBWaXQ2zlon69uizchl dp8YQK5bYk40ozHCt+glN9Qir86exVtTDmXXKTVnafxiiAMBXfpvZaADpMsxeS8eTg JHYR5iES8jAudYPVzp4raNhFf0JbSaJy0K6+rqq+U88rKGNERm598ygN2Z5tFtUZZn dT2ZkIWyS5bhsSeocEFEkBrZHAL0M5+qLdx58+iFlSu1Hir3aPyhTh4ksYlSrfGvsf rfPeoiQQ0+Xl2e5O/YVhES2xZkrxu9k9JGGgG9z/IGUZkTXqEz8XQGEQ8Hqigxh98C PpsN1D8kNVOfw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 659A85FF82 for ; Tue, 6 Jan 2026 15:06:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737168; bh=+MLI189TReNeFshVd8OapwmkO0kJI3RroLrCbMTj1to=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lCSrF6JRdh+HVw6AiTqbj9602dQou8AuqiUDbWrfjZUOea7qq8s/2c9P5QEfm2ZzI YrG7kt9aVKLdYctTud4B8IhH4FSqhDUK9m5TAiibq8YMJjpfUT4WEohEBXdDqEDjK2 bKd7FoyRQEASj3oInb3ket6BzfQLnAQuIxI58nrw+WrgHG9W/J4/1CSrgZwTKAgBXr rUzFpaIdWk/4gtQTWJVlkZ5CkuBim+IP6ZVlxlmmkp8yFVD6TIIlQ41lJbqsFVEoUm n2H8gRNZ+FlppvMxJeDfvxx6bYcRXPr2mW9LCxMwrXnMt+qqNciqGssYpbNxgIPV01 LM2pPn2CmMtmA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E18E35FF82; Tue, 6 Jan 2026 15:06:08 -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 7TRlm67xWWOg; Tue, 6 Jan 2026 15:06:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737162; bh=yKn+OhC0o4iCxKFY+PaPWRxm3BwVXkVPf4FbA++v+1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mt858t8JCWs1vA2toQnd1fNzso1m0m9SoseAp8xKkdXvcYoqLR3FVRtdpufQcXzJ+ uT+YZ0BoiuAW8t1T3o7tHHTTarGwTVMyFeIdPu632jP6gCK34vUaDm0GGOS5T+6Uop SyJ08b5WZ2Nkux/Ec9zX4/wEoqMGsDdoZy2na9gUMLY0qkZh9nvgjZ0uA8A9d4dDdF n/EyvaZNXVcFRgL8cp4V43pH8CpzhX/j6z/KoGZ1mVpAGRLu32+QO+gF3b1mlJztNy qo5pW2el7ysvmlbp/qcpaePUVyAd+4K/W+9EgPTwsxYsdflchV+LWyWrWjpHFAM4Gh OJt6KIPRGVlqg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A663F690CB; Tue, 6 Jan 2026 15:06:02 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:42 -0700 Message-ID: <20260106220403.2915630-25-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: 5OODM4VQLUOWSUVIK64UTVCTT6DGXNFQ X-Message-ID-Hash: 5OODM4VQLUOWSUVIK64UTVCTT6DGXNFQ 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 24/29] buildman: Extract arch results display 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 arch results display block into _display_arch_results() and convert the nested _output_err_lines() function to a class method. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 117 ++++++++++++++++++++++---------------- 1 file changed, 67 insertions(+), 50 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index db20c3d156d..d5b57246908 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1680,6 +1680,71 @@ class Builder: tprint(f"{' '.join(sorted(targets))} :") self._output_config_info(lines.split('\n')) + def _output_err_lines(self, err_lines, colour): + """Output the line of error/warning lines, if not empty + + Also increments self._error_lines if err_lines not empty + + Args: + err_lines: List of ErrLine objects, each an error or warning + line, possibly including a list of boards with that + error/warning + colour: Colour to use for output + """ + if err_lines: + out_list = [] + for line in err_lines: + names = [brd.target for brd in line.brds] + board_str = ' '.join(names) if names else '' + if board_str: + out = self.col.build(colour, line.char + '(') + out += self.col.build(self.col.MAGENTA, board_str, + bright=False) + out += self.col.build(colour, f') {line.errline}') + else: + out = self.col.build(colour, line.char + line.errline) + out_list.append(out) + tprint('\n'.join(out_list)) + self._error_lines += 1 + + def _display_arch_results(self, board_selected, brd_status, better_err, + worse_err, better_warn, worse_warn): + """Display results by architecture + + Args: + board_selected (dict): Dict containing boards to summarise + brd_status (BoardStatus): Named tuple with board classifications + better_err: List of ErrLine for fixed errors + worse_err: List of ErrLine for new errors + better_warn: List of ErrLine for fixed warnings + worse_warn: List of ErrLine for new warnings + """ + if self._ide: + return + if not any((brd_status.ok, brd_status.warn, brd_status.err, + brd_status.unknown, brd_status.new, worse_err, better_err, + worse_warn, better_warn)): + return + arch_list = {} + self.add_outcome(board_selected, arch_list, brd_status.ok, '', + self.col.GREEN) + self.add_outcome(board_selected, arch_list, brd_status.warn, 'w+', + self.col.YELLOW) + self.add_outcome(board_selected, arch_list, brd_status.err, '+', + self.col.RED) + self.add_outcome(board_selected, arch_list, brd_status.new, '*', + self.col.BLUE) + if self._show_unknown: + self.add_outcome(board_selected, arch_list, brd_status.unknown, + '?', self.col.MAGENTA) + for arch, target_list in arch_list.items(): + tprint(f'{arch:>10s}: {target_list}') + self._error_lines += 1 + self._output_err_lines(better_err, colour=self.col.GREEN) + self._output_err_lines(worse_err, colour=self.col.RED) + self._output_err_lines(better_warn, colour=self.col.CYAN) + self._output_err_lines(worse_warn, colour=self.col.YELLOW) + def print_result_summary(self, board_selected, board_dict, err_lines, err_line_boards, warn_lines, warn_line_boards, config, environment, show_sizes, show_detail, @@ -1770,34 +1835,6 @@ class Builder: better_lines.append(errline) return better_lines, worse_lines - def _output_err_lines(err_lines, colour): - """Output the line of error/warning lines, if not empty - - Also increments self._error_lines if err_lines not empty - - Args: - err_lines: List of ErrLine objects, each an error or warning - line, possibly including a list of boards with that - error/warning - colour: Colour to use for output - """ - if err_lines: - out_list = [] - for line in err_lines: - names = [brd.target for brd in line.brds] - board_str = ' '.join(names) if names else '' - if board_str: - out = self.col.build(colour, line.char + '(') - out += self.col.build(self.col.MAGENTA, board_str, - bright=False) - out += self.col.build(colour, f') {line.errline}') - else: - out = self.col.build(colour, line.char + line.errline) - out_list.append(out) - tprint('\n'.join(out_list)) - self._error_lines += 1 - - brd_status = self._classify_boards(board_selected, board_dict) # Get a list of errors and warnings that have appeared, and disappeared @@ -1816,28 +1853,8 @@ class Builder: sys.stderr.write(line) # Display results by arch - elif any((brd_status.ok, brd_status.warn, brd_status.err, - brd_status.unknown, brd_status.new, worse_err, better_err, - worse_warn, better_warn)): - arch_list = {} - self.add_outcome(board_selected, arch_list, brd_status.ok, '', - self.col.GREEN) - self.add_outcome(board_selected, arch_list, brd_status.warn, 'w+', - self.col.YELLOW) - self.add_outcome(board_selected, arch_list, brd_status.err, '+', - self.col.RED) - self.add_outcome(board_selected, arch_list, brd_status.new, '*', - self.col.BLUE) - if self._show_unknown: - self.add_outcome(board_selected, arch_list, brd_status.unknown, - '?', self.col.MAGENTA) - for arch, target_list in arch_list.items(): - tprint(f'{arch:>10s}: {target_list}') - self._error_lines += 1 - _output_err_lines(better_err, colour=self.col.GREEN) - _output_err_lines(worse_err, colour=self.col.RED) - _output_err_lines(better_warn, colour=self.col.CYAN) - _output_err_lines(worse_warn, colour=self.col.YELLOW) + self._display_arch_results(board_selected, brd_status, better_err, + worse_err, better_warn, worse_warn) if show_sizes: self.print_size_summary(board_selected, board_dict, show_detail, From patchwork Tue Jan 6 22:03:43 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1328 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=1767737174; bh=XPChOeL1ER1oirXhic7LraSTPYXptb9SUznNDeKuWK0=; 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=nOE8yID4K57CK94R+VptOVC3kTn9OpfoYAcRo2S5Agi1AG9SCZNWvId6/HSpbw+FR 9hrwVFijx0Ne9G6brddnMLHhrzmElGD5p+LfvIJ4QILUI/auTBnW427YXsX2vlu8mP WVOFWyBHoEm7aQfb5YnzZAVefsz+g8EjNGFiC8wILwl8vC8IQ1PZc7fbgBZlDbNeYm I+JA3PXyBWKF+6yValnroMWQhv3jvRTrrXy6q3n4ZRHWnWGXLDRuvMcmkQmOrrpPOs YAmzF9oiREwmTy2/62tPIXG+ZMq/nrdst0YwZMGLw3QRqQVOKE4yzJbdx56SUlR/La p7hVi7nrkszBA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2E38369162 for ; Tue, 6 Jan 2026 15:06:14 -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 7mB3ghoeYa2c for ; Tue, 6 Jan 2026 15:06:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737174; bh=XPChOeL1ER1oirXhic7LraSTPYXptb9SUznNDeKuWK0=; 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=nOE8yID4K57CK94R+VptOVC3kTn9OpfoYAcRo2S5Agi1AG9SCZNWvId6/HSpbw+FR 9hrwVFijx0Ne9G6brddnMLHhrzmElGD5p+LfvIJ4QILUI/auTBnW427YXsX2vlu8mP WVOFWyBHoEm7aQfb5YnzZAVefsz+g8EjNGFiC8wILwl8vC8IQ1PZc7fbgBZlDbNeYm I+JA3PXyBWKF+6yValnroMWQhv3jvRTrrXy6q3n4ZRHWnWGXLDRuvMcmkQmOrrpPOs YAmzF9oiREwmTy2/62tPIXG+ZMq/nrdst0YwZMGLw3QRqQVOKE4yzJbdx56SUlR/La p7hVi7nrkszBA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1D8FF690CB for ; Tue, 6 Jan 2026 15:06:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737171; bh=mWWHx72xpYSETCtJeBUf8hg52x+S11R7goSqT+LfOLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=scmNH8Jt2TcWY9RYRFDi02SQCayZA1+Yecu66MLyOjPLO7g0QNR+ccMi1qw/vrdoj VuSWf94I6epTdUwQXA0P2YTJqxupj9KmgKMtcv8s6Oh/KtgiaVAwSAHKl1amqkHtKd 8iTgRiVnkQJwsikJ0CgxmJW4SVfMWwo6UccdsNCBwXYmte7gy4ufqhjeUlNxl6eSYO FpjgMk5duoQYd8lKihLRWZUF498dcFebU/RjUZPEluMdDxs4xmbuNGpzGWERdLfftv GJmahP4yYfetRlttwknEVFCntHw5NTVKuiM+vN1f0n2D0JPCXNswcP3iHIKoEF+a2Y aoFCSCc6s001g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AABF26916D; Tue, 6 Jan 2026 15:06:11 -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 Nf0xTtfcmmai; Tue, 6 Jan 2026 15:06:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737167; bh=7I19PaAmvH4MG82pAhsJZuBvDZrd361RG+Sl/q3QO44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fO/vNXlU7g5ZWsMhYBUy23ogn+7Dpva0w6/IvJNDSwL4oh8yTC10FXvKytu4dkDot C0J/G89c6GBXAr9IzqExEj5OvaerKGvyN+wbkVf3MDtIAluMctgtgFPy6vyrjV/4QM LZoMMOtjG6XV+EGKz695ySUOupyrAO/Nb0WHhWOcO6gv5TOg2TvTUmxmoCtPMuwv3J 1TT/ccOUJLtumxaIolrW+8nUvG12WQ1267v3U5MhBuskxlaPa+mq7IbvI4gywRY4hu 3zFjv/5jodKXvo11JBv+TeywvaBqrjt6PW57AM+zoJ4oEGjtSTDuc+WN035BWFPM2E Sf1ilhMH0HidA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7628969146; Tue, 6 Jan 2026 15:06:07 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:43 -0700 Message-ID: <20260106220403.2915630-26-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: XJOJ2TX45TZJU3PGHB5GGJLEJCBAF6PQ X-Message-ID-Hash: XJOJ2TX45TZJU3PGHB5GGJLEJCBAF6PQ 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 25/29] buildman: Extract not-built display 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 not-built boards display into _show_not_built() to reduce complexity in print_result_summary() Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index d5b57246908..f8217124864 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1877,10 +1877,19 @@ class Builder: self._base_config = config self._base_environment = environment - # Get a list of boards that did not get built, if needed + self._show_not_built(board_selected, board_dict) + + @staticmethod + def _show_not_built(board_selected, board_dict): + """Show boards that were not built + + Args: + board_selected (dict): Dict of selected boards, keyed by target + board_dict (dict): Dict of boards that were built, keyed by target + """ not_built = [] for brd in board_selected: - if not brd in board_dict: + if brd not in board_dict: not_built.append(brd) if not_built: tprint(f"Boards not built ({len(not_built)}): " From patchwork Tue Jan 6 22:03:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1329 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=1767737177; bh=33XpqIfnDbMPe31oShew+eLdGFeRhqr6W2oatMYtfSc=; 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=c+e9YbUd4xgXMfgav7ov/Tc/P5yYi1R0/0BzkrJj6rovAmMXTossEC7FvEqu/i1lX 4XOJI7A3ntKOnyjwUvk7HcmpR0zPZ8Y5MGr68kNKie4EWr0zbtD46R09jQo7Ls4P+1 XOWypzH6tJSZWHjzzqo96o615JZlKKAo7CjLXRaR8IzzQlFHaFqF4bqdiu4JrZiAWp TNxwEGqeBKBV4+lyHSmAHO8wBYiNPODgQX6q6WoxjpGnpLQ/P5cuuOgtpGRvofuw9O SYR3Q84fDc5waTyNOrBfK9pGJV9qVvY3QxFDqS9A+jxAGXijbuCFhYvZ6MiXXLClV+ B5cG/nVxX4PPQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A10D0690CB for ; Tue, 6 Jan 2026 15:06:17 -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 b8GkHMaSAvVM for ; Tue, 6 Jan 2026 15:06:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737177; bh=33XpqIfnDbMPe31oShew+eLdGFeRhqr6W2oatMYtfSc=; 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=c+e9YbUd4xgXMfgav7ov/Tc/P5yYi1R0/0BzkrJj6rovAmMXTossEC7FvEqu/i1lX 4XOJI7A3ntKOnyjwUvk7HcmpR0zPZ8Y5MGr68kNKie4EWr0zbtD46R09jQo7Ls4P+1 XOWypzH6tJSZWHjzzqo96o615JZlKKAo7CjLXRaR8IzzQlFHaFqF4bqdiu4JrZiAWp TNxwEGqeBKBV4+lyHSmAHO8wBYiNPODgQX6q6WoxjpGnpLQ/P5cuuOgtpGRvofuw9O SYR3Q84fDc5waTyNOrBfK9pGJV9qVvY3QxFDqS9A+jxAGXijbuCFhYvZ6MiXXLClV+ B5cG/nVxX4PPQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8BC7069146 for ; Tue, 6 Jan 2026 15:06:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737176; bh=S3RC0xaZ5rAQsRW8WiH6nE80r4VdFHt7Sui2ZqBhM9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mw+58AiM66f+qrXEnCBVykrPxG64Ssg7G/O2m2wkw4aHCAuECajdGmsLtKpAAr7L+ kf/sbjIqTeLrqERNr5kbai1b4Bx3mfeYMLsYqj94hZ7GgGkfZXStyRmz/lJpJicVI6 nSzkqTnFTQztn744XkF4/h5deh+xb2kI3qC4EuQOaM3Qi0nB1vA4WVuUBo1CiIXoiP a0kt/OY+cRyJ+qheNgMD1jYEdMreHtgzYnxpEWGRKnERIsQATlhKF5WDmdM8at6fVU eW+cGb6zEC6zvHk/hSe16L7AzZZkrS+Dx/kIpgSawUZPFx8daK4doh0xI976HL9pe1 3/Fu1AQxXBkkA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 93676690CB; Tue, 6 Jan 2026 15:06:16 -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 crzIhtkbmyYZ; Tue, 6 Jan 2026 15:06:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737172; bh=qq8q78VpG6Wd/Q91HNYYLbKGxC0Uo9OoqepufBFvmM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UxqJWRn2r1iajRdeWMNoOXuRaaAb4XvmMngyJ2nO9lm1q3yKnR6NtU/CXz30aotyZ 0F4Wf71tJ89WHN52OaYmH8KztWj07u9enUiPLpJ9iivpfhUXpr0/0uqg9yDXw3QiKW Xnm5qqodslcSIIJ5chNQBlLwXlIXLmM4I7kd6auC9iHHuwy2DrCSIIQw/zTPpe4i1a vChug6bhe2st97D9PKrJv7oPUvI2JDJcrjhWMddgUTHpqIDASiC+tYZ4Wd0WobmhXZ qnMv4K/JiuyMZ6zQVWHA1szVG2Xf5rXagd3d47rem9JBXDJvTKrtmdmMEsHJDyVjJC 1Thuyo8idbh7w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DE0FD69173; Tue, 6 Jan 2026 15:06:11 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:44 -0700 Message-ID: <20260106220403.2915630-27-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: ZXMIFFOIDCDESFYGA4MODOP2HYGR7EK4 X-Message-ID-Hash: ZXMIFFOIDCDESFYGA4MODOP2HYGR7EK4 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 26/29] buildman: Extract IDE output in print_result_summary() 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 IDE output printing into _print_ide_output() to reduce complexity in print_result_summary() Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index f8217124864..72bd812fde4 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1745,6 +1745,22 @@ class Builder: self._output_err_lines(better_warn, colour=self.col.CYAN) self._output_err_lines(worse_warn, colour=self.col.YELLOW) + def _print_ide_output(self, board_selected, board_dict): + """Print output for IDE mode + + Args: + board_selected (dict): Dict of selected boards, keyed by target + board_dict (dict): Dict of boards that were built, keyed by target + """ + if not self._ide: + return + for target in board_dict: + if target not in board_selected: + continue + outcome = board_dict[target] + for line in outcome.err_lines: + sys.stderr.write(line) + def print_result_summary(self, board_selected, board_dict, err_lines, err_line_boards, warn_lines, warn_line_boards, config, environment, show_sizes, show_detail, @@ -1844,13 +1860,7 @@ class Builder: self._base_warn_line_boards, warn_lines, warn_line_boards, 'w') # For the IDE mode, print out all the output - if self._ide: - for target in board_dict: - if target not in board_selected: - continue - outcome = board_dict[target] - for line in outcome.err_lines: - sys.stderr.write(line) + self._print_ide_output(board_selected, board_dict) # Display results by arch self._display_arch_results(board_selected, brd_status, better_err, From patchwork Tue Jan 6 22:03:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1330 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=1767737182; bh=pMzi1yQJIqB0/wwkQGexyA73lpVSLZYNmPn4ZNLzruw=; 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=c0kBJyHQ8aNh2ET3vgRYUWhoHbW8qaQWgYxLXre8XtcnoD+TCoRXtPVfOqsDvmWxO kc7u3nG/sUjgXD56eAoBlRex/InsWALmTD+4BnnVr1RQkwgGz3JKcHvBcHgcpLhB0j HMYnLLsB1/IJRrwZh6776FW2EYwijevcj48V9QSlT7J375AiqyUEXp8TM7gGnmVnF+ QJ+jSKubzRijl/DgT1dAaBCBEKORbTPJWUctcRdY1FlOSK949gogb3whbXXb+KRwix i8MakqdeHcZaMKvZa/y399o/41uGPQ0vN5y5/v8PioCMKxQgFjoV+1J+N8JxyS4KIs e0/GlLnsRZkEw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 916936916D for ; Tue, 6 Jan 2026 15:06:22 -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 8y1ogRsxLvxm for ; Tue, 6 Jan 2026 15:06:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737182; bh=pMzi1yQJIqB0/wwkQGexyA73lpVSLZYNmPn4ZNLzruw=; 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=c0kBJyHQ8aNh2ET3vgRYUWhoHbW8qaQWgYxLXre8XtcnoD+TCoRXtPVfOqsDvmWxO kc7u3nG/sUjgXD56eAoBlRex/InsWALmTD+4BnnVr1RQkwgGz3JKcHvBcHgcpLhB0j HMYnLLsB1/IJRrwZh6776FW2EYwijevcj48V9QSlT7J375AiqyUEXp8TM7gGnmVnF+ QJ+jSKubzRijl/DgT1dAaBCBEKORbTPJWUctcRdY1FlOSK949gogb3whbXXb+KRwix i8MakqdeHcZaMKvZa/y399o/41uGPQ0vN5y5/v8PioCMKxQgFjoV+1J+N8JxyS4KIs e0/GlLnsRZkEw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7F8D869146 for ; Tue, 6 Jan 2026 15:06:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737180; bh=lS2yuz3W77yXc/kmRKt7cGFSGoUxgFWFGfsfDQ59ScU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CUPc+Oc1B2cBQ24w3+XM4vlqn9CGa8oNK/GqRMnQlxPy3m1+aO2qR1KPdQVyVEA+4 +LhZvDLoKhQZov5ZvaHMwbD7a3N2MgUe6ZsP4foLWItCH7Ad28ctLoioLIcxP9eGfx rYnm+CgrVBgEIeHOo/ViiSpzmGhkFmiiPDBmE5l75uByZkqDBi15RgrNzSGjQiRNOe Ce/OEL57U8lf7z4naONqQt0LQ1iE+yD1Yz7beyW51TZ0KcB+TBMfLEjktpKb+NLtXV T+sjQRRTRikU9iAmOkLaDyOT7gc9WHfnMBmBqtmB7Mf+GbiHcLpSUt75DJgBps0LeR LXiCFlnkz1Mgw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 82289690CB; Tue, 6 Jan 2026 15:06:20 -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 Xy-eiL6Du3Dh; Tue, 6 Jan 2026 15:06:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737176; bh=lZkiB0D0DGqKJqARotAzOawMnI1gO35eBX0rzYkBUSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qDetP7WsjBRN3YlcbNQ20xEnSDx/om76v3RRalbDBlDqm2CT5O92yfE7Tn+BCnMYM jW0HMvE/sPQ2CwObMJO17SQjkwmfTc8oaSemcygivt9L25KXTpsRhaheOmodxmU6st pNusLYpiFKf/eTlecE+/TKYv9FdXQMzF2iVaynKtuUr+NKSDg3hlnkJ6921pj978R7 0ahedbe3tazKRfhtIsBoZ7ghgM9KI4tebqUXJOa4N0rTvB9rhqBq1MTdCkfWocqfgp F1iCI4r+KTg8P3mz6RA/sG3HJ4ktPCjTfHudLp20fFY0VcjhDgWP3whrLZ4T5NJxDU wlQ3BmZJYuyKw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 53FA15FF82; Tue, 6 Jan 2026 15:06:16 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:45 -0700 Message-ID: <20260106220403.2915630-28-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: GCZ3THVQZ7TXBSDQ3JMALNRTHERPMKWG X-Message-ID-Hash: GCZ3THVQZ7TXBSDQ3JMALNRTHERPMKWG 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 27/29] buildman: Disable R0902/R0903 pylint warnings 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 Disable too-many-instance-attributes (R0902) and too-few-public-methods (R0903) warnings as these are not useful for this module. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 72bd812fde4..067034aa52b 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -6,6 +6,8 @@ """Build manager for U-Boot builds across multiple boards and commits""" +# pylint: disable=R0902,R0903 + import collections from datetime import datetime, timedelta import glob From patchwork Tue Jan 6 22:03:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1331 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=1767737187; bh=f6a+WGTOryXYQ/I09K5e+d+ohs7ZUYEqM9ZWjP7S1Ms=; 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=i4jy7JMAHC5P5TWen4oDjETAcvl9iy4cFeJXnW5l+ei4wvLG49um/Q8KBwzNNQbni NA283irfOGpXpfb5XuicqQheSL8Bi2rUWtTXPuEJA/RXKLj2ba/THmAZ4ryBgKvGd9 hS/VbioofH82lvG81I09CbnjSz5zfoWGFK3z9l0S/PYn8Tk2AIwMmCy5s5yhz8wLp1 gNHWHlTF0jBRaQVCycUtuHHwFOF0HbyYr6RRjsaXBWcLEJlbwM9+NbUF/yLhvzI8yd UDmfmCG5tdcG/DQd6HXcRDUH0cnkBbSTOHbWZ9OxGgwVtEmR8q88+1MBUmBtV+XVR9 EwOaJvqR5aIXg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0CBEB6916D for ; Tue, 6 Jan 2026 15:06:27 -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 t3S08v1ZiVfa for ; Tue, 6 Jan 2026 15:06:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737186; bh=f6a+WGTOryXYQ/I09K5e+d+ohs7ZUYEqM9ZWjP7S1Ms=; 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=mJoJs1+iVN0Fx6soFAvAvVofolkH+JkduB1OTs6aNoxL+wkvLhysVkTNkDdhtH4NS s9wWOKG3mpPBP9Yb8gNOS2AkhTQqv0/M/QqZQjEhr++lcgRyIh3+uxeXruwoPOnBbM /gxan+DgANiQ1BPJa71OmeGYefAbIC9bBLYKjW0XlSs1t5ryIeQta1fLzVFWhAP7r1 fhuxrxMdDkjEb3qB0tBD9OEQsDl2Vxo+jWprAiWCwNV8HSmwFHJNQQS+kc8OvHKpLA FXmctcKBbxpcShhwDkXKqPBPrhEBfaJXUImpYGFN8FhLW7/ruzV7HkSah4fo87xSvD +7fE/fcwOnXUg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EFCA369146 for ; Tue, 6 Jan 2026 15:06:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737185; bh=lacShWqLEEpA2HLJa7M27sRhpTOosD9mQ2HsCmDs7zU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MoK4ua1JQX62RhsoQruDHJ5kwg9W849STEGLkmk17oSBWBhHPb2aqxTsjWBk7WD0g PHmlBLMFdohXnCYvLCKA/Et7E30dkPap9ynAKmPdjHTPYLkJ+JTRyBrciRObO1ozGB D8vQ3BTdbI094VRz7WE0xI/dsvl3boTaW8PHu+6bVD8PNNe9/DzZWK49spzc/tvqiU 4Nu919R/Wzs4O5d6dDAQJ3xuPkKM4liapSbszrY7CmE8PnEyMSjMhwxxNfMHT25aUP GLo0na3zSLpU0hHLKXQYWvAQfpA2dWGZvrCPRJZTu6gLK1atTJMeOYuV9x1f+/2ZR0 tP637ZThOws2Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3E06A690CB; Tue, 6 Jan 2026 15:06:25 -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 tpwLaUS3kE5z; Tue, 6 Jan 2026 15:06:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737181; bh=K3bHojwFenKHJjckWSRTotfrNBfm/EMwREOKZWEKh7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LAbi0AhzraSjg4yBAP7CuBxxu0SdAwQORdtWhd6+FOI6Ea8hFwX6hnNyK5tDBJ/kV DFQnQxh57eOQcgOH3bjQ0pFsjqVCvPYD/PEJj9lmizqHfk9UKTou0nxRGwZZ9PjwsJ HB1WVylZ0lL8kbGpKTn5MH796FTfISzblGADlDzFlgjqtY/JC8cMbZMhF3fiCCe7Ti c7WxGw+e84LF+CNpMvUPVgi3UP3t4wIXA7s7vJTKIhYrHLW6+sShHyWS3YaTxUEhYd 7Rd4Sk7VCoUp4Zp3yZtlLb/cHyTZhEdU5dOYa+AX/I+CG5AwkRoFHNE2wnJTtynxlg 3cL7YK/VEwBlg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C33805FF82; Tue, 6 Jan 2026 15:06:20 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:46 -0700 Message-ID: <20260106220403.2915630-29-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: M23H5NYLVMDMIRDDRA2IK3SR3PQOZPLG X-Message-ID-Hash: M23H5NYLVMDMIRDDRA2IK3SR3PQOZPLG 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 28/29] buildman: Move regex patterns to module-level constants 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 compiler output regex patterns from instance attributes to module-level constants for better efficiency and clarity. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 41 ++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 067034aa52b..0d6e7d1732c 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -37,6 +37,17 @@ from u_boot_pylib.terminal import tprint # which indicates that BREAK_ME has an empty default RE_NO_DEFAULT = re.compile(br'\((\w+)\) \[] \(NEW\)') +# Regex patterns for matching compiler output +RE_FUNCTION = re.compile('(.*): In function.*') +RE_FILES = re.compile('In file included from.*') +RE_WARNING = re.compile(r'(.*):(\d*):(\d*): warning: .*') +RE_DTB_WARNING = re.compile('(.*): Warning .*') +RE_NOTE = re.compile( + r'(.*):(\d*):(\d*): note: this is the location of the previous.*') +RE_MIGRATION_WARNING = re.compile(r'^={21} WARNING ={22}\n.*\n=+\n', + re.MULTILINE | re.DOTALL) +RE_MAKE_ERR = re.compile('(make.*Waiting for unfinished)|(Segmentation fault)') + # Symbol types which appear in the bloat feature (-B). Others are silently # dropped when reading in the 'nm' output NM_SYMBOL_TYPES = 'tTdDbBr' @@ -203,7 +214,6 @@ class Builder: num_jobs: Number of jobs to run at once (passed to make as -j) num_threads: Number of builder threads to run out_queue: Queue of results to process - re_make_err: Compiled regular expression for ignore_lines queue: Queue of jobs to run threads: List of active threads toolchains: Toolchains object to use for building @@ -400,15 +410,6 @@ class Builder: self.warnings_as_errors = warnings_as_errors self.col = terminal.Color() - self._re_function = re.compile('(.*): In function.*') - self._re_files = re.compile('In file included from.*') - self._re_warning = re.compile(r'(.*):(\d*):(\d*): warning: .*') - self._re_dtb_warning = re.compile('(.*): Warning .*') - self._re_note = re.compile( - r'(.*):(\d*):(\d*): note: this is the location of the previous.*') - self._re_migration_warning = re.compile( - r'^={21} WARNING ={22}\n.*\n=+\n', re.MULTILINE | re.DOTALL) - self.thread_exceptions = [] self.test_thread_exceptions = test_thread_exceptions @@ -464,10 +465,6 @@ class Builder: self._single_builder = builderthread.BuilderThread( self, -1, mrproper, per_board_out_dir) - 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) @@ -773,12 +770,12 @@ class Builder: out_lines = [] if self._filter_migration_warnings: text = '\n'.join(lines) - text = self._re_migration_warning.sub('', text) + text = RE_MIGRATION_WARNING.sub('', text) lines = text.splitlines() for line in lines: - if self.re_make_err.search(line): + if RE_MAKE_ERR.search(line): continue - if self._filter_dtb_warnings and self._re_dtb_warning.search(line): + if self._filter_dtb_warnings and RE_DTB_WARNING.search(line): continue out_lines.append(line) return out_lines @@ -1005,13 +1002,13 @@ class Builder: last_was_warning = False for line in err_lines: if line: - if (self._re_function.match(line) or - self._re_files.match(line)): + if (RE_FUNCTION.match(line) or + RE_FILES.match(line)): last_func = line else: - is_warning = (self._re_warning.match(line) or - self._re_dtb_warning.match(line)) - is_note = self._re_note.match(line) + is_warning = (RE_WARNING.match(line) or + RE_DTB_WARNING.match(line)) + is_note = RE_NOTE.match(line) if is_warning or (last_was_warning and is_note): if last_func: self._add_line(warn_lines_summary, 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()