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: