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