From patchwork Mon Jan 5 18:30:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1271 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=1767637854; bh=5FEFQ99x0yRSml1wxOZPetJkoM48rz5TrrS9kFRjQqQ=; 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=V+hipblP/jo500bTWpvMHJCtvBym745i+geGVh9v3Zw3b1SkxAAsvd3kDBw+NJ0nK uAXGofoXw5VrFwpDisucXh6lz/pC+IGWT44xFuDj7CJKrO/HQ9vAqT7bFxXSSP7Sqt IsBUMZ2Viznw19tYXAsKpEJQURJF3FsRH8HJDX9oSL3/NtsavRcZlE34/JRy7/APWq pWRr7jq0+kjQhyChe85ZvXbprC9IUawqycmY/sWdlk61SqFizAJMKawGCXgUuZqVaE Gp31jR+ro/ZEN1+SH4swVbhfTPjyhvuc+YyUAgtwJDoktpVzhj40yEAc0BMtDgZN9E x9Y5keznE37tA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6A4266910D for ; Mon, 5 Jan 2026 11:30:54 -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 njayO7Z4Pm6T for ; Mon, 5 Jan 2026 11:30:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637854; bh=5FEFQ99x0yRSml1wxOZPetJkoM48rz5TrrS9kFRjQqQ=; 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=V+hipblP/jo500bTWpvMHJCtvBym745i+geGVh9v3Zw3b1SkxAAsvd3kDBw+NJ0nK uAXGofoXw5VrFwpDisucXh6lz/pC+IGWT44xFuDj7CJKrO/HQ9vAqT7bFxXSSP7Sqt IsBUMZ2Viznw19tYXAsKpEJQURJF3FsRH8HJDX9oSL3/NtsavRcZlE34/JRy7/APWq pWRr7jq0+kjQhyChe85ZvXbprC9IUawqycmY/sWdlk61SqFizAJMKawGCXgUuZqVaE Gp31jR+ro/ZEN1+SH4swVbhfTPjyhvuc+YyUAgtwJDoktpVzhj40yEAc0BMtDgZN9E x9Y5keznE37tA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D00A69103 for ; Mon, 5 Jan 2026 11:30:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637851; bh=b3pgrMxgbCzY3/ql7krAjsrcpwIISsX1Lb5fsa9pJc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DKWXOeuFUKwN+Yh3jvVueCA1r5lzaKix+FitT2CkUd14z6BW1yaIrZ+dpvJ+clQtf ja8W7EyLhII0Gl6/677Hqdn4h5jzym1A3Sbr5j/9OEqe5wV++8fVB07TJmnWswLz/e WI70nPEVJ4ffogq41BIuwsmYGYqvrLgcpvFzvqRKgwIVsa0h6SF58CzHGWu4sXr2rT pv62rXYui5hYwlkoqxJz4HadOF/YfcV5h6JNtOsUGNF1qT+hpLbKpmmExDsowaGn5V Yzi0O+rBhbQaVFPJYLZ7fD317RcJzSsxPgDySF7mG/cvTeX2uyEg0mzj0cJ1a8vmSI 1ytwf2Vfgt1QA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E6372690EB; Mon, 5 Jan 2026 11:30: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 EFx99SVCQ5wD; Mon, 5 Jan 2026 11:30:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637847; bh=osi9QJTQon6WIPphcnxPRzrqt57A2UwppJX6vxzR/IM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mXVc2Frxsc284qyeQDnqp0XIzdjkMnlGHhOZ9EJtOrSg+L67Kh0SafYbp6hEcl9/u SQ9sXMgNtDx5CYOnNfsfDPYWVrZCpMObUgD61cR6SLfHrSduO81fujHCy42Gf6izyP muE2uTgK8MpM5WtEhI+LLOlOAVVShRHld8nnb9AdfpyGICVYTJo8IC+H4GPI6dj37z vfR8+uPy8yo0+k/1yknIjfzBa159edLqNkZovaf92pDJHxmkTt7MttInsxkpcVlTH7 H8BoADA4H3ZjkR5Q3hdEGqkI+7YDJsPWCVzXATF0/zqimAl8LfYe69Shr18rJNIny5 i7MIxEaSD2/XA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5BF5669045; Mon, 5 Jan 2026 11:30:47 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:16 -0700 Message-ID: <20260105183030.1487468-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: U3JEKGET7DPFBCPTFZFDSWFDHFXM5CCO X-Message-ID-Hash: U3JEKGET7DPFBCPTFZFDSWFDHFXM5CCO 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/11] buildman: Fix pylint warnings in control.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 various pylint warnings: - Fix line too long in show_actions() - Fix docstring parameter mismatches (wrong names, missing types) - Add pylint disable comments for functions with many positional args - Remove unnecessary else after return in check_pid() - Remove unused variable running_fname in wait_for_process_limit() - Add pylint disable for import-outside-toplevel (filelock) - Shorten URL in check_pid() docstring This brings control.py to pylint 10.00/10 Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/control.py | 94 ++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 88e8338c599..052c9fa4343 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -68,14 +68,13 @@ def get_action_summary(is_summary, commit_count, selected, threads, jobs): Args: is_summary (bool): True if this is a summary (otherwise it is building) - commits (list): List of commits being built + commit_count (int): Number of commits being built selected (list of Board): List of Board objects that are marked - step (int): Step increment through commits threads (int): Number of processor threads being used jobs (int): Number of jobs to build at once Returns: - Summary string. + str: Summary string """ if commit_count: commit_str = f'{commit_count} commit{get_plural(commit_count)}' @@ -87,22 +86,23 @@ def get_action_summary(is_summary, commit_count, selected, threads, jobs): f'{jobs} job{get_plural(jobs)} per thread)') return msg -# pylint: disable=R0913 +# pylint: disable=R0913,R0917 def show_actions(series, why_selected, boards_selected, output_dir, board_warnings, step, threads, jobs, verbose): """Display a list of actions that we would take, if not a dry run. Args: - series: Series object - why_selected: Dictionary where each key is a buildman argument - provided by the user, and the value is the list of boards - brought in by that argument. For example, 'arm' might bring - in 400 boards, so in this case the key would be 'arm' and - the value would be a list of board names. - boards_selected: Dict of selected boards, key is target name, - value is Board object + series (Series): Series object + why_selected (dict): Dictionary where each key is a buildman argument + provided by the user, and the value is the list of boards + brought in by that argument. For example, 'arm' might bring + in 400 boards, so in this case the key would be 'arm' and + the value would be a list of board names. + boards_selected (dict): Dict of selected boards, key is target name, + value is Board object output_dir (str): Output directory for builder - board_warnings: List of warnings obtained from board selected + board_warnings (list of str): List of warnings obtained from board + selected step (int): Step increment through commits threads (int): Number of processor threads being used jobs (int): Number of jobs to build at once @@ -121,7 +121,8 @@ def show_actions(series, why_selected, boards_selected, output_dir, if commits: for upto in range(0, len(series.commits), step): commit = series.commits[upto] - print(' ', col.build(col.YELLOW, commit.hash[:8], bright=False), end=' ') + print(' ', col.build(col.YELLOW, commit.hash[:8], bright=False), + end=' ') print(commit.subject) print() for arg in why_selected: @@ -143,11 +144,9 @@ def show_toolchain_prefix(brds, toolchains): the correct value for CROSS_COMPILE. Args: - boards: Boards object containing selected boards - toolchains: Toolchains object containing available toolchains - - Return: - None on success, string error message otherwise + brds (Boards): Boards object containing selected boards + toolchains (Toolchains): Toolchains object containing available + toolchains """ board_selected = brds.get_selected_dict() tc_set = set() @@ -165,10 +164,7 @@ def show_arch(brds): the correct value for ARCH. Args: - boards: Boards object containing selected boards - - Return: - None on success, string error message otherwise + brds (Boards): Boards object containing selected boards """ board_selected = brds.get_selected_dict() arch_set = set() @@ -251,6 +247,7 @@ def count_commits(branch, count, col, git_dir): return count, has_range +# pylint: disable=R0917 def determine_series(selected, col, git_dir, count, branch, work_in_output): """Determine the series which is to be built, if any @@ -348,6 +345,7 @@ def do_fetch_arch(toolchains, col, fetch_arch): return 0 +# pylint: disable=R0917 def get_toolchains(toolchains, col, override_toolchain, fetch_arch, list_tool_chains, verbose): """Get toolchains object to use @@ -383,6 +381,7 @@ def get_toolchains(toolchains, col, override_toolchain, fetch_arch, return toolchains +# pylint: disable=R0917 def get_boards_obj(output_dir, regen_board_list, maintainer_check, full_check, threads, verbose): """Object the Boards object to use @@ -501,6 +500,7 @@ def adjust_args(args, series, selected): args.show_detail = True +# pylint: disable=R0917 def setup_output_dir(output_dir, work_in_output, branch, no_subdirs, col, in_tree, clean_dir): """Set up the output directory @@ -510,9 +510,10 @@ def setup_output_dir(output_dir, work_in_output, branch, no_subdirs, col, work_in_output (bool): True to work in the output directory branch (str): Name of branch to build, or None if none no_subdirs (bool): True to put the output in the top-level output dir + col (Terminal.Color): Color object to use in_tree (bool): True if doing an in-tree build - clean_dir: Used for tests only, indicates that the existing output_dir - should be removed before starting the build + clean_dir (bool): Used for tests only, indicates that the existing + output_dir should be removed before starting the build Returns: str: Updated output directory pathname @@ -537,8 +538,9 @@ def run_builder(builder, commits, board_selected, args): """Run the builder or show the summary Args: + builder (Builder): Builder to use commits (list of Commit): List of commits being built, None if no branch - boards_selected (dict): Dict of selected boards: + board_selected (dict): Dict of selected boards: key: target name value: Board object args (Namespace): Namespace to use @@ -622,26 +624,26 @@ def read_procs(tmpdir=tempfile.gettempdir()): def check_pid(pid): """Check for existence of a unix PID - https://stackoverflow.com/questions/568271/how-to-check-if-there-exists-a-process-with-a-given-pid-in-python + See: https://stackoverflow.com/questions/568271 Args: pid (int): PID to check Returns: - True if it exists, else False + bool: True if it exists, else False """ try: os.kill(pid, 0) except OSError: return False - else: - return True + return True def write_procs(procs, tmpdir=tempfile.gettempdir()): """Write the list of running buildman processes Args: + procs (list of int): List of process IDs to write tmpdir (str): Temporary directory to use (for testing only) """ running_fname = os.path.join(tmpdir, RUNNING_FNAME) @@ -678,9 +680,9 @@ def wait_for_process_limit(limit, tmpdir=tempfile.gettempdir(), tmpdir (str): Temporary directory to use (for testing only) pid (int): Current process ID (for testing only) """ + # pylint: disable=C0415 from filelock import Timeout, FileLock - running_fname = os.path.join(tmpdir, RUNNING_FNAME) lock_fname = os.path.join(tmpdir, LOCK_FNAME) lock = FileLock(lock_fname) @@ -719,26 +721,26 @@ def wait_for_process_limit(limit, tmpdir=tempfile.gettempdir(), tprint('starting build', newline=False) print_clear() +# pylint: disable=R0917 def do_buildman(args, toolchains=None, make_func=None, brds=None, clean_dir=False, test_thread_exceptions=False): """The main control code for buildman Args: - args: ArgumentParser object - args: Command line arguments (list of strings) - toolchains: Toolchains to use - this should be a Toolchains() - object. If None, then it will be created and scanned - make_func: Make function to use for the builder. This is called - to execute 'make'. If this is None, the normal function - will be used, which calls the 'make' tool with suitable - arguments. This setting is useful for tests. - brds: Boards() object to use, containing a list of available - boards. If this is None it will be created and scanned. - clean_dir: Used for tests only, indicates that the existing output_dir - should be removed before starting the build - test_thread_exceptions: Uses for tests only, True to make the threads - raise an exception instead of reporting their result. This simulates - a failure in the code somewhere + args (Namespace): ArgumentParser object + toolchains (Toolchains): Toolchains to use - this should be a + Toolchains() object. If None, then it will be created and scanned + make_func (function): Make function to use for the builder. This is + called to execute 'make'. If this is None, the normal function + will be used, which calls the 'make' tool with suitable + arguments. This setting is useful for tests. + brds (Boards): Boards() object to use, containing a list of available + boards. If this is None it will be created and scanned. + clean_dir (bool): Used for tests only, indicates that the existing + output_dir should be removed before starting the build + test_thread_exceptions (bool): Uses for tests only, True to make the + threads raise an exception instead of reporting their result. This + simulates a failure in the code somewhere """ # Used so testing can obtain the builder: pylint: disable=W0603 global TEST_BUILDER From patchwork Mon Jan 5 18:30:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1272 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=1767637858; bh=NTdqgmqDdp0JGjBQnzxqaHvkjDKMOk+wMEJkYl20VM4=; 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=sHqctZlfr2jgq/E1bmp9rin9hlE5Hscx5Rx+uo6Pj7ktRTBVgIS6mJ1OpLS3kFdlN 4NyRLZkBCVzhNOqrQUyOmbTuNRHkij9rHF9f9iCeIKBe6ySvMjGfrzndXh/FxcQ64b Cq1R5fD8zFFq6ON+fXBNW1invYD4hQThLwhsefs28w/kUF9vNpk/AaosrNkgHGrwee o4+6xwZLRHQ++Dl+TUXA7lcJAl3/YoHD86Y2P76tufXde4tdpYGnJqN1JDaWg0HyNW U+VYzYyy0aDBYYXvGSyVETWHnLYzs2g5jOPImXUcw8GDnBD5sam5wPQ4rHgcz3ewcv wOY7QE872sv7A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 68ECD690EB for ; Mon, 5 Jan 2026 11:30: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 DQGZ6_FMgEQS for ; Mon, 5 Jan 2026 11:30:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637858; bh=NTdqgmqDdp0JGjBQnzxqaHvkjDKMOk+wMEJkYl20VM4=; 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=sHqctZlfr2jgq/E1bmp9rin9hlE5Hscx5Rx+uo6Pj7ktRTBVgIS6mJ1OpLS3kFdlN 4NyRLZkBCVzhNOqrQUyOmbTuNRHkij9rHF9f9iCeIKBe6ySvMjGfrzndXh/FxcQ64b Cq1R5fD8zFFq6ON+fXBNW1invYD4hQThLwhsefs28w/kUF9vNpk/AaosrNkgHGrwee o4+6xwZLRHQ++Dl+TUXA7lcJAl3/YoHD86Y2P76tufXde4tdpYGnJqN1JDaWg0HyNW U+VYzYyy0aDBYYXvGSyVETWHnLYzs2g5jOPImXUcw8GDnBD5sam5wPQ4rHgcz3ewcv wOY7QE872sv7A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 557A169103 for ; Mon, 5 Jan 2026 11:30:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637856; bh=5e6P0S/7clCXeSoKydBi2+t+laMDVJk7bas2qqpwr2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k9pHuMUX+83EGxGPNnZS7FgazZz9mR50sGhQWA0lZg+bkI0CCAHBc80VrW3eRy7fE iw2DEX5j8RENhO6hWAXcnh9Auo5qsGaYUqEsMF8DiBN0EJITh+IosTtnj/lIWuTEDt uPibBbGuXuUY1dX7/ikifYtuHoEd8TrRdDu5WQceXwBALJeaA+34a0PIDgB8vmWpmW lW/2HK79vOXWI9OAPzNhY2N3Cd1p/00qC1ERCJjExQmTZa7gBS3RBPIQgpb588HPyJ nE0wOD9Des9j1vrbO5AJZPwxw+LV12aKOGl4Heu4i3iTYo+fijTvPOprggaWsnfDAz PM14tDPDwxuyw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A488E690EB; Mon, 5 Jan 2026 11:30: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 7tRQjOzA_Akd; Mon, 5 Jan 2026 11:30:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637852; bh=7IUOYKB5oUf4SY0Zxpw6/upUgePtAPB5MX7GH42ZqR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBaoztPmYA2qSIP47kR2kKGjUL+L5BhubNnEN6ql5cEEJ39qqyoOmi3NqoaiSmyGV UkEZk21F1/p1d+Z8bJVdoLBD1CDvz56U5b1xnxFp+7ursDPU5guEywLCAeKMgfRzDh 23q56437sHRj/n8wY7vw0mPx7Zy1rVt2dEU94cI1v00Q0QFiIXPjMHpIMDbTKhF61z du0h96TMzdRFVOGExr4dTCNLZjGHgdn19PJCYTgxtObrcfSNP0KMFwPUsKQEWMFLaj uI3/ldGlpLnQPZkw2/X0T34ld7yP+5Uqd9BkRo8zMe1IcODVEx/GUzDeiNb6PlD8Ai Cd/q12r8JJrLg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 32C6D69045; Mon, 5 Jan 2026 11:30:52 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:17 -0700 Message-ID: <20260105183030.1487468-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RUKE5PN35WRPQUHHSGMTB4UMWVG52OSY X-Message-ID-Hash: RUKE5PN35WRPQUHHSGMTB4UMWVG52OSY 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 02/11] buildman: Fix some pylint warnings in builderthread.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 various pylint warnings: - Remove unused import sys - Add ValueError to raises documentation in mkdir() - Use "from err" when re-raising ValueError - Change "!= None" to "is not None" (singleton comparison) - Fix long line in run_commit() - Add pylint disable for broad-exception-caught in run() This brings builderthread.py to pylint 9.97/10 Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 0fd589934fe..1102f61ef45 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -13,7 +13,6 @@ import glob import io import os import shutil -import sys import threading from buildman import cfgutil @@ -71,6 +70,7 @@ def mkdir(dirname, parents=False): Raises: OSError: File already exists + ValueError: Trying to create the current working directory """ if not dirname or os.path.exists(dirname): return @@ -83,7 +83,8 @@ def mkdir(dirname, parents=False): if err.errno == errno.EEXIST: if os.path.realpath('.') == os.path.realpath(dirname): raise ValueError( - f"Cannot create the current working directory '{dirname}'!") + f"Cannot create the current working directory " + f"'{dirname}'!") from err else: raise @@ -464,7 +465,7 @@ class BuilderThread(threading.Thread): config_args.append(fname) else: config_args = [f'{brd.target}_defconfig'] - if fragments != None: + if fragments is not None: config_args.extend(fragments.split(',')) config_out = io.StringIO() @@ -553,7 +554,8 @@ class BuilderThread(threading.Thread): except ValueError as err: result.return_code = 10 result.stdout = '' - result.stderr = f'Tool chain error for {brd.arch}: {str(err)}' + result.stderr = (f'Tool chain error for {brd.arch}: ' + f'{str(err)}') if self.toolchain: commit = self._checkout(commit_upto, work_dir) @@ -848,7 +850,7 @@ class BuilderThread(threading.Thread): job = self.builder.queue.get() try: self.run_job(job) - except Exception as exc: + except Exception as exc: # pylint: disable=W0718 print('Thread exception (use -T0 to run without threads):', exc) self.builder.thread_exceptions.append(exc) From patchwork Mon Jan 5 18:30:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1273 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=1767637863; bh=B1d2UJXANNc07YT05QYcGTRjI0SXQx6kSTOavyf5QMI=; 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=Vkg+q3PeF9qdE4YUDjQoKAOxcvtRtyNSRVpGCoTsK5f67r2atMf/NMjmw7M08UAiu gGRmyZpLd/z9ZmQ2vIQyVSOi/X3fJMoZeAQdvwniURcGtivkyJcefcwwMUoocS82hf OS2bvGPCXRkH33sDs8FKUhbC2oXdpyjpkkJsy4LYbM0336N654VXVz/8S1ms/XvP8M vCDTgMQsCVfNGCgOGQs8WnuHuNBVTQETBY6NBfzdRGfwYn9YG9oYXM81lMDSQzRGoX 73jILJ590aW3/UtKCUh4dIuxqubiDi/g2c5WUj8UvMpez/EmUkVPXv7CPNGPou3ZQU 3CxK+9652kw1A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 13BCF69112 for ; Mon, 5 Jan 2026 11:31: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 t_ac9YC0NitE for ; Mon, 5 Jan 2026 11:31:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637863; bh=B1d2UJXANNc07YT05QYcGTRjI0SXQx6kSTOavyf5QMI=; 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=Vkg+q3PeF9qdE4YUDjQoKAOxcvtRtyNSRVpGCoTsK5f67r2atMf/NMjmw7M08UAiu gGRmyZpLd/z9ZmQ2vIQyVSOi/X3fJMoZeAQdvwniURcGtivkyJcefcwwMUoocS82hf OS2bvGPCXRkH33sDs8FKUhbC2oXdpyjpkkJsy4LYbM0336N654VXVz/8S1ms/XvP8M vCDTgMQsCVfNGCgOGQs8WnuHuNBVTQETBY6NBfzdRGfwYn9YG9oYXM81lMDSQzRGoX 73jILJ590aW3/UtKCUh4dIuxqubiDi/g2c5WUj8UvMpez/EmUkVPXv7CPNGPou3ZQU 3CxK+9652kw1A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 02B3E69103 for ; Mon, 5 Jan 2026 11:31:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637861; bh=XfJlOrC4bKaYA16ic7dPmrQcm9dOX82GxLjxIouqFQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gPwa4KaMMgw4kRT6fbro9ZyRUj4vqY0A9wkv5B8a8CO2klKhlibMBRr8Fi54z1I55 khnqAazPVAvM4jOOJakAt/HN7EYZl8dwZUClMe365W3s1kcGr8azFK5LiDCwxqaqo0 jLdDHLT27zbBGc0ylF5OkxBhJfwslDamzcbfGPXhC7fhjNiNmZP4x8b0HTOEFocAwb G1oVa0W8SM+kFh2GvCMMVvc1vH1YARzu9cqwDp6YKkUk8YKVKhkhMNTpsC0VzaP8l2 6yXfUwR+Wg9Xb8Bq9awjTmhBQP/H+bZL2O8BwiiuqdXhGpa/5XupQp+z27zs0eua2m JTzMcdv/XN6TA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1B6A1690EB; Mon, 5 Jan 2026 11:31: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 NzuEsounyap1; Mon, 5 Jan 2026 11:31:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637857; bh=Dm0YESfVClA1+6wiQC4vrl05wPsjDx91DRWY9MIz2YI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tR9M3gvuL50zlDbIoHqoUFH2nDLstAyEw/JDPV3NbZjRlIj9/hfPWf1jUo221aJ7J DheOySqo6/H4QaVubIIVvNbYUVowFZeCrylXDkFmVpvbHkIwrzeVyWagrK93EwzCoK nkf82wGHIk0+uPGa5I9xflYcV4gaZ9OIHiQubdP7T7YrMTk0OiKPrhapjRfzvVdGW7 qfQZaexy44Lh7xYgti9bSRBu1qS7barrPNrVtZjs2cQjI/ZCP0NbAZjxoyAroaoAe7 DLbdY221N9NJw9kOcjqd+6Ku0EM2mOl12n3JuTHqNOTAK8E5QoHQP4v3ZBodiQ+gLD CSxUMwqy7Y5CA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E653A69045; Mon, 5 Jan 2026 11:30:56 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:18 -0700 Message-ID: <20260105183030.1487468-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: EPBEHBQH5ZGUUWGYERS4WFKKRYS7YFOY X-Message-ID-Hash: EPBEHBQH5ZGUUWGYERS4WFKKRYS7YFOY 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 03/11] buildman: Document toolchain member in BuilderThread 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 missing documentation for the toolchain member in the BuilderThread class docstring. This member holds the selected toolchain for building and is used throughout the class. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 1102f61ef45..c480f4888a1 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -189,6 +189,8 @@ class BuilderThread(threading.Thread): board rather than a thread-specific directory test_exception: Used for testing; True to raise an exception instead of reporting the build result + toolchain: Toolchain object to use for building, or None if not yet + selected """ def __init__(self, builder, thread_num, mrproper, per_board_out_dir, test_exception=False): From patchwork Mon Jan 5 18:30: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: 1274 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=1767637868; bh=2ggrlzVTtrC+96xsO/ZNMkBtLX5dgY1YHd05McqNeq4=; 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=icI7RIImCzxFBd41bJRlR1XODxdu/kdaiQQyjKwWZO+veQYrqfmR0f9PhZp/CKYQU 4x8V9wWIawT7f+edk88/TPeleTZVh+JCcGdSP842hNU2gXkH+z/GuUlEKj3r/QJuZ2 psBi9wFvyX9oVMsrFx+d4Cn6PCY53rb7HFD+MTcPbcgaVo90jP4s8qUIA22Z56msBq ofNWPEK+I5altwJVjI55l6/4Vk9+g45l+aXK8LPRxmBaa7Czna0lVmMyCBT/9KpIO+ e5QSIFY/Y1UHaozG8hOEFrPKolMN8bd+8wyo2cNVUczBTJBixWH8pPLIpJzmjUsQ7L WXHfNcoqDAeoA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 970CC690EB for ; Mon, 5 Jan 2026 11:31: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 10024) with ESMTP id ApnE3WdC1dyb for ; Mon, 5 Jan 2026 11:31:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637868; bh=2ggrlzVTtrC+96xsO/ZNMkBtLX5dgY1YHd05McqNeq4=; 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=icI7RIImCzxFBd41bJRlR1XODxdu/kdaiQQyjKwWZO+veQYrqfmR0f9PhZp/CKYQU 4x8V9wWIawT7f+edk88/TPeleTZVh+JCcGdSP842hNU2gXkH+z/GuUlEKj3r/QJuZ2 psBi9wFvyX9oVMsrFx+d4Cn6PCY53rb7HFD+MTcPbcgaVo90jP4s8qUIA22Z56msBq ofNWPEK+I5altwJVjI55l6/4Vk9+g45l+aXK8LPRxmBaa7Czna0lVmMyCBT/9KpIO+ e5QSIFY/Y1UHaozG8hOEFrPKolMN8bd+8wyo2cNVUczBTJBixWH8pPLIpJzmjUsQ7L WXHfNcoqDAeoA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 817E269103 for ; Mon, 5 Jan 2026 11:31:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637865; bh=w0//HkVeA75SwLwhKMwqs+6fPeVxkRhlZ/bRzdAT6cU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MWUHLJiPVMJcZzrveKNWMGTU2WBwyBgKq2WLMr898tH7o0UWHP2g5di18A4/gWyAH 6gWf58FQV6v6Nw+N6qfnbKjNvC96rM/hcjSUIpsL9Qv7DhA6Y1beOZaQ4poxdY+Gix o3XVKGyMHfCljU5vTj5hK86UK++6hrHZpS67paRncxHGAbSX6r3V5amO8OeK+M8zbz cuzGR2/YQsROYWVnyNgpfWYKrbkn/5hzXil1xPvGQ0VqNk7QN73kBqa8iLgv5WmObb nHa/9jpqZCFdCDcee/gUFhs3v5SnGdNs1HSQ0FrPONzBNMJoeTT5ja6f4LpEK2+2au GFBlYzOO3s46g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F0BB5690EB; Mon, 5 Jan 2026 11:31: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 WHtKE5bRgZ3x; Mon, 5 Jan 2026 11:31:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637861; bh=x4ZcJ+5Vw+AZ/DD1moFOJrRPjV1Y/sUhhWtRs6kTY3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qgvoBj4wUsubXQyuwhFQtG/iTdrg04HYr28E3ud3Ig6yu3Im716YotfRAhF/DeB/e EpstJjBo1Eb9iyXVM99L43M/tahMPTuPETXl8lcTK2xasb+BlB4PnYCTOrwNtHPwrb 4AW9CHVgEyPYBnF4W+ZC5Noty5plZ1HvpqHu0VIFQ2oqaV9Y79Fe8jBJpdENpfbh8K mItZTpKRbCG60KXDQaGp46oVacFYWlFqEvBx5GS4eEgw87mnexvO6EKRg+mMxNBkq9 eUghxHkL7TtlWsdlNrpbb/o/27WfsiamJRJxtWB71YkOa5hwemVFecnccliMJUppLR gte0Y2zHTm6lw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 59A7669045; Mon, 5 Jan 2026 11:31:01 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:19 -0700 Message-ID: <20260105183030.1487468-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: R367TRHH3ZPZCEWTTFMVS2B3MHNOJERA X-Message-ID-Hash: R367TRHH3ZPZCEWTTFMVS2B3MHNOJERA 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 04/11] buildman: Add RunRequest named tuple for run_commit() parameters 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 Introduce a RunRequest named tuple to group the parameters that don't change during a job's for loop in run_job() This includes: - brd: Board to build - work_dir: Directory for source checkout - work_in_output: Whether to use output directory as work directory - adjust_cfg: Config adjustments - fragments: Config fragments This reduces the run_commit() signature from 11 parameters to 7, and simplifies passing these values through to _decide_dirs() and _config_and_build() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 158 ++++++++++++++++---------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index c480f4888a1..eda2b0083d4 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -8,6 +8,7 @@ This module provides the BuilderThread class, which handles calling the builder based on the jobs provided. """ +from collections import namedtuple import errno import glob import io @@ -20,6 +21,23 @@ from u_boot_pylib import command from u_boot_pylib import gitutil from u_boot_pylib import tools +# Named tuple for run_commit() options that don't change during a job +# +# Members: +# brd (Board): Board to build +# work_dir (str): Directory to which the source will be checked out +# work_in_output (bool): Use the output directory as the work directory and +# don't write to a separate output directory +# adjust_cfg (list of str): List of changes to make to .config file before +# building. Each is one of (where C is either CONFIG_xxx or just xxx): +# C to enable C +# ~C to disable C +# C=val to set the value of C (val must have quotes if C is a +# string Kconfig +# fragments (str): Config fragments added to defconfig +RunRequest = namedtuple('RunRequest', ['brd', 'work_dir', 'work_in_output', + 'adjust_cfg', 'fragments']) + RETURN_CODE_RETRY = -1 BASE_ELF_FILENAMES = ['u-boot', 'spl/u-boot-spl', 'tpl/u-boot-tpl'] @@ -384,28 +402,26 @@ class BuilderThread(threading.Thread): return will_build, result - def _decide_dirs(self, brd, work_dir, work_in_output): + def _decide_dirs(self, req): """Decide the output directory to use Args: - work_dir (str): Directory to which the source will be checked out - work_in_output (bool): Use the output directory as the work - directory and don't write to a separate output directory. + req (RunRequest): Run request (see RunRequest for details) Returns: tuple: out_dir (str): Output directory for the build - out_rel_dir (str): Output directory relatie to the current dir + out_rel_dir (str): Output directory relative to the current dir """ - if work_in_output or self.builder.in_tree: + if req.work_in_output or self.builder.in_tree: out_rel_dir = None - out_dir = work_dir + out_dir = req.work_dir else: if self.per_board_out_dir: - out_rel_dir = os.path.join('..', brd.target) + out_rel_dir = os.path.join('..', req.brd.target) else: out_rel_dir = 'build' - out_dir = os.path.join(work_dir, out_rel_dir) + out_dir = os.path.join(req.work_dir, out_rel_dir) return out_dir, out_rel_dir def _checkout(self, commit_upto, work_dir): @@ -427,24 +443,20 @@ class BuilderThread(threading.Thread): commit = 'current' return commit - def _config_and_build(self, commit_upto, brd, work_dir, do_config, mrproper, - config_only, adjust_cfg, commit, out_dir, out_rel_dir, - fragments, result): + def _config_and_build(self, req, commit_upto, do_config, mrproper, + config_only, commit, out_dir, out_rel_dir, result): """Do the build, configuring first if necessary Args: + req (RunRequest): Run request (see RunRequest for details) commit_upto (int): Commit number to build (0...n-1) - brd (Board): Board to create arguments for - work_dir (str): Directory to which the source will be checked out do_config (bool): True to run a make _defconfig on the source mrproper (bool): True to run mrproper first config_only (bool): Only configure the source, do not build it - adjust_cfg (list of str): See the cfgutil module and run_commit() - commit (Commit): Commit only being built + commit (Commit): Commit being built out_dir (str): Output directory for the build, or None to use current - out_rel_dir (str): Output directory relatie to the current dir - fragments (str): config fragments added to defconfig + out_rel_dir (str): Output directory relative to the current dir result (CommandResult): Previous result Returns: @@ -458,17 +470,17 @@ class BuilderThread(threading.Thread): if out_dir and not os.path.exists(out_dir): mkdir(out_dir) - args, cwd, src_dir = self._build_args(brd, out_dir, out_rel_dir, - work_dir, commit_upto) - if brd.extended: - config_args = [f'{brd.orig_target}_defconfig'] - for frag in brd.extended.fragments: + args, cwd, src_dir = self._build_args(req.brd, out_dir, out_rel_dir, + req.work_dir, commit_upto) + if req.brd.extended: + config_args = [f'{req.brd.orig_target}_defconfig'] + for frag in req.brd.extended.fragments: fname = os.path.join(f'{frag}.config') config_args.append(fname) else: - config_args = [f'{brd.target}_defconfig'] - if fragments is not None: - config_args.extend(fragments.split(',')) + config_args = [f'{req.brd.target}_defconfig'] + if req.fragments is not None: + config_args.extend(req.fragments.split(',')) config_out = io.StringIO() _remove_old_outputs(out_dir) @@ -476,26 +488,26 @@ class BuilderThread(threading.Thread): # If we need to reconfigure, do that now cfg_file = os.path.join(out_dir or '', '.config') cmd_list = [] - if do_config or adjust_cfg: + if do_config or req.adjust_cfg: result = self._reconfigure( - commit, brd, cwd, args, env, config_args, config_out, cmd_list, - mrproper) + commit, req.brd, cwd, args, env, config_args, config_out, + cmd_list, mrproper) do_config = False # No need to configure next time - if adjust_cfg: - cfgutil.adjust_cfg_file(cfg_file, adjust_cfg) + if req.adjust_cfg: + cfgutil.adjust_cfg_file(cfg_file, req.adjust_cfg) # Now do the build, if everything looks OK if result.return_code == 0: - if adjust_cfg: + if req.adjust_cfg: oldc_args = list(args) + ['oldconfig'] - oldc_result = self.make(commit, brd, 'oldconfig', cwd, + oldc_result = self.make(commit, req.brd, 'oldconfig', cwd, *oldc_args, env=env) if oldc_result.return_code: return oldc_result - result = self._build(commit, brd, cwd, args, env, cmd_list, + result = self._build(commit, req.brd, cwd, args, env, cmd_list, config_only) - if adjust_cfg: - errs = cfgutil.check_cfg_file(cfg_file, adjust_cfg) + if req.adjust_cfg: + errs = cfgutil.check_cfg_file(cfg_file, req.adjust_cfg) if errs: result.stderr += errs result.return_code = 1 @@ -505,34 +517,22 @@ class BuilderThread(threading.Thread): result.cmd_list = cmd_list return result, do_config - def run_commit(self, commit_upto, brd, work_dir, do_config, mrproper, - config_only, force_build, force_build_failures, - work_in_output, adjust_cfg, fragments): + def run_commit(self, req, commit_upto, do_config, mrproper, config_only, + force_build, force_build_failures): """Build a particular commit. If the build is already done, and we are not forcing a build, we skip the build and just return the previously-saved results. Args: + req (RunRequest): Run request (see RunRequest for details) commit_upto (int): Commit number to build (0...n-1) - brd (Board): Board to build - work_dir (str): Directory to which the source will be checked out do_config (bool): True to run a make _defconfig on the source mrproper (bool): True to run mrproper first config_only (bool): Only configure the source, do not build it force_build (bool): Force a build even if one was previously done - force_build_failures (bool): Force a bulid if the previous result + force_build_failures (bool): Force a build if the previous result showed failure - work_in_output (bool) : Use the output directory as the work - directory and don't write to a separate output directory. - adjust_cfg (list of str): List of changes to make to .config file - before building. Each is one of (where C is either CONFIG_xxx - or just xxx): - C to enable C - ~C to disable C - C=val to set the value of C (val must have quotes if C is - a string Kconfig - fragments (str): config fragments added to defconfig Returns: tuple containing: @@ -541,10 +541,11 @@ class BuilderThread(threading.Thread): """ # Create a default result - it will be overwritte by the call to # self.make() below, in the event that we do a build. - out_dir, out_rel_dir = self._decide_dirs(brd, work_dir, work_in_output) + out_dir, out_rel_dir = self._decide_dirs(req) # Check if the job was already completed last time - will_build, result = self._read_done_file(commit_upto, brd, force_build, + will_build, result = self._read_done_file(commit_upto, req.brd, + force_build, force_build_failures) kconfig_reconfig = False @@ -552,33 +553,33 @@ class BuilderThread(threading.Thread): # We are going to have to build it. First, get a toolchain if not self.toolchain: try: - self.toolchain = self.builder.toolchains.select(brd.arch) + self.toolchain = self.builder.toolchains.select( + req.brd.arch) except ValueError as err: result.return_code = 10 result.stdout = '' - result.stderr = (f'Tool chain error for {brd.arch}: ' + result.stderr = (f'Tool chain error for {req.brd.arch}: ' f'{str(err)}') if self.toolchain: - commit = self._checkout(commit_upto, work_dir) + commit = self._checkout(commit_upto, req.work_dir) # Check if Kconfig files have changed since last config if self.builder.kconfig_check: config_file = os.path.join(out_dir, '.config') - if kconfig_changed_since(config_file, work_dir, - brd.target): + if kconfig_changed_since(config_file, req.work_dir, + req.brd.target): kconfig_reconfig = True do_config = True result, do_config = self._config_and_build( - commit_upto, brd, work_dir, do_config, mrproper, - config_only, adjust_cfg, commit, out_dir, out_rel_dir, - fragments, result) + req, commit_upto, do_config, mrproper, config_only, + commit, out_dir, out_rel_dir, result) result.already_done = False result.kconfig_reconfig = kconfig_reconfig result.toolchain = self.toolchain - result.brd = brd + result.brd = req.brd result.commit_upto = commit_upto result.out_dir = out_dir return result, do_config @@ -761,29 +762,29 @@ class BuilderThread(threading.Thread): brd = job.brd work_dir = self.builder.get_thread_dir(self.thread_num) self.toolchain = None + req = RunRequest(brd, work_dir, job.work_in_output, job.adjust_cfg, + job.fragments) if job.commits: # Run 'make board_defconfig' on the first commit do_config = True commit_upto = 0 force_build = False for commit_upto in range(0, len(job.commits), job.step): - result, request_config = self.run_commit(commit_upto, brd, - work_dir, do_config, self.mrproper, + result, request_config = self.run_commit( + req, commit_upto, do_config, self.mrproper, self.builder.config_only, force_build or self.builder.force_build, - self.builder.force_build_failures, - job.work_in_output, job.adjust_cfg, job.fragments) + self.builder.force_build_failures) failed = result.return_code did_config = do_config if failed and not do_config and not self.mrproper: # If our incremental build failed, try building again # with a reconfig. if self.builder.force_config_on_failure: - result, request_config = self.run_commit(commit_upto, - brd, work_dir, True, + result, request_config = self.run_commit( + req, commit_upto, True, self.mrproper or self.builder.fallback_mrproper, - False, True, False, job.work_in_output, - job.adjust_cfg, job.fragments) + False, True, False) did_config = True if not self.builder.force_reconfig: do_config = request_config @@ -826,17 +827,16 @@ class BuilderThread(threading.Thread): self._send_result(result) else: # Just build the currently checked-out build - result, request_config = self.run_commit(None, brd, work_dir, True, - self.mrproper, self.builder.config_only, True, - self.builder.force_build_failures, job.work_in_output, - job.adjust_cfg, job.fragments) + result, request_config = self.run_commit( + req, None, True, self.mrproper, + self.builder.config_only, True, + self.builder.force_build_failures) failed = result.return_code if failed and not self.mrproper: - result, request_config = self.run_commit(None, brd, work_dir, - True, self.builder.fallback_mrproper, + result, request_config = self.run_commit( + req, None, True, self.builder.fallback_mrproper, self.builder.config_only, True, - self.builder.force_build_failures, - job.work_in_output, job.adjust_cfg, job.fragments) + self.builder.force_build_failures) result.commit_upto = 0 self._write_result(result, job.keep_outputs, job.work_in_output) From patchwork Mon Jan 5 18:30: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: 1275 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=1767637872; bh=x4y0UmyPK1bPfr9tg7VfPWj/OF0HUd0rwcENgAbA36E=; 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=TMOIfcSgMpiYBTr/AfZduW3LXYSwwDr3Yfow6PHkd6rtAmNiv18sdf0yE91Doiq2C dnIKNkS9a+7ue4SfLkuQABDOiy0iihYar6m9RSozMK8D2iR92UoRc14HC3ZkS0tVo+ xfPohWaCKTC6CnBdykhtxW/dtAbIdyt5GR2CtsSCV3lU4xTsT2J7dP2BOoFC8w46Fm JyZm2JWYnu38Z3kPAp3whKQ92RGzNrSJwQOKTYHmIjpjI89qyb66rcXT7Gt6ozTj94 r4vELUAtvNbhlyItVf5YpTOLL3j60/Gy54iKXwf3MnPxyeP1788WITfRY1w9lNwF7U oZ36WpiyEDrxA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2DF42690EB for ; Mon, 5 Jan 2026 11:31: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 1yrKiPhhejT2 for ; Mon, 5 Jan 2026 11:31:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637872; bh=x4y0UmyPK1bPfr9tg7VfPWj/OF0HUd0rwcENgAbA36E=; 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=TMOIfcSgMpiYBTr/AfZduW3LXYSwwDr3Yfow6PHkd6rtAmNiv18sdf0yE91Doiq2C dnIKNkS9a+7ue4SfLkuQABDOiy0iihYar6m9RSozMK8D2iR92UoRc14HC3ZkS0tVo+ xfPohWaCKTC6CnBdykhtxW/dtAbIdyt5GR2CtsSCV3lU4xTsT2J7dP2BOoFC8w46Fm JyZm2JWYnu38Z3kPAp3whKQ92RGzNrSJwQOKTYHmIjpjI89qyb66rcXT7Gt6ozTj94 r4vELUAtvNbhlyItVf5YpTOLL3j60/Gy54iKXwf3MnPxyeP1788WITfRY1w9lNwF7U oZ36WpiyEDrxA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1CEF669103 for ; Mon, 5 Jan 2026 11:31:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637870; bh=fFuq9wqBKTwspuN+kWlHc2igNTEJ5CP3gdcE3OiZ8Xo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WJFUmXUfaPY7k3RdtuOaCD4Vkf8iEg3VGZ75/8rKdamioN4nCj6HEDaEnhBQ/cmTw iYmy96RsxFg1dN8K3PtYZhV00MwUsSS6YOcP8w3hUq3duH4Qg8KXOaC8326ViZOuhc pudE7gkzd8l4b6qgsFw9acztpCMr/GV3ZdbP2k1mGDjtvjdVzx2NtY8MxwtmHsj3/n KnhoqKTFwFRc2S7X2LdZDU/TjGtHOv8y5A6KTqrwJyIcwANfHygd55brhOLEkZ/2wu s0+/sBq+ox9vVkPC5fi4O6iDCvfrNR0RoLe6p1ISeANUmbYyisJo3B+NU7E9/LJIhu bG0wwgsy+wQCQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B730D690EB; Mon, 5 Jan 2026 11:31: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 CesxFiYJWPoW; Mon, 5 Jan 2026 11:31:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637866; bh=aqxioQRIhXpveVjrSfRkri5qnPROUd2o7P0FFxSmAuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rXjkpLsu+P/hox2RhnbADsoF9HdUbx5q8gGnHGClBnmJYmfa0dKfrvCGldjtpOVjv y7w7x39/LrCZmZPZgsz0gw2d9P9/+LGViBLFHpSTKo27Frh1gPlUeDWvOYMUpGmHzc 5hNQR9fMfw4YZE5AVsGHjRmfYRSrDq6MUKxTanjWlkDJbLnh4y5oaJ9CclT9vw+iQJ IlD8eXWDDOJ6JVo/CDx4F8qlIL4cyli9LnmLHd6wH2fF+viLWti0HOG/DPEfGOR/Hr 7uGZDL3J3R0yLGdjPQtH9DfTC1LCbDdolbWfesGKHdZ43p18VnDwZb+r4KzbShcho4 WlhHdqmzvGuRA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 39F0169045; Mon, 5 Jan 2026 11:31:06 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:20 -0700 Message-ID: <20260105183030.1487468-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NXWHZZUNDGQOQNDPDNPX4PJGSCUDLMJO X-Message-ID-Hash: NXWHZZUNDGQOQNDPDNPX4PJGSCUDLMJO 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 05/11] buildman: Split _config_and_build() into three methods 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 Refactor the _config_and_build() method to improve readability by splitting it into three separate methods: - _setup_build(): Set up the build environment and arguments - _reconfig_if_needed(): Handle reconfiguration if needed - _build_and_get_result(): Perform the build and finalise the result Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 110 +++++++++++++++++++++++++++----- 1 file changed, 94 insertions(+), 16 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index eda2b0083d4..67a0b486b47 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -443,29 +443,24 @@ class BuilderThread(threading.Thread): commit = 'current' return commit - def _config_and_build(self, req, commit_upto, do_config, mrproper, - config_only, commit, out_dir, out_rel_dir, result): - """Do the build, configuring first if necessary + def _setup_build(self, req, commit_upto, out_dir, out_rel_dir): + """Set up the build environment and arguments Args: req (RunRequest): Run request (see RunRequest for details) commit_upto (int): Commit number to build (0...n-1) - do_config (bool): True to run a make _defconfig on the source - mrproper (bool): True to run mrproper first - config_only (bool): Only configure the source, do not build it - commit (Commit): Commit being built out_dir (str): Output directory for the build, or None to use current out_rel_dir (str): Output directory relative to the current dir - result (CommandResult): Previous result Returns: tuple: - result (CommandResult): Result of the build - do_config (bool): indicates whether 'make config' is needed on - the next incremental build + env (dict): Environment variables for the build + args (list of str): Arguments to pass to make + config_args (list of str): Arguments for configuration + cwd (str): Current working directory for the build + src_dir (str): Source directory path """ - # Set up the environment and command line env = self.builder.make_environment(self.toolchain) if out_dir and not os.path.exists(out_dir): mkdir(out_dir) @@ -481,13 +476,37 @@ class BuilderThread(threading.Thread): config_args = [f'{req.brd.target}_defconfig'] if req.fragments is not None: config_args.extend(req.fragments.split(',')) - config_out = io.StringIO() _remove_old_outputs(out_dir) - # If we need to reconfigure, do that now + return env, args, config_args, cwd, src_dir + + def _reconfig_if_needed(self, req, commit, cwd, args, env, config_args, + config_out, cmd_list, out_dir, do_config, mrproper, + result): + """Reconfigure the build if needed + + Args: + req (RunRequest): Run request (see RunRequest for details) + commit (Commit): Commit being built + cwd (str): Current working directory + args (list of str): Arguments to pass to make + env (dict): Environment strings + config_args (list of str): Arguments for configuration + config_out (StringIO): Buffer for configuration output + cmd_list (list of str): List to add the commands to, for logging + out_dir (str): Output directory for the build + do_config (bool): True to run a make _defconfig on the source + mrproper (bool): True to run mrproper first + result (CommandResult): Previous result + + Returns: + tuple: + result (CommandResult): Result of the reconfiguration + do_config (bool): Whether config is still needed + cfg_file (str): Path to the .config file + """ cfg_file = os.path.join(out_dir or '', '.config') - cmd_list = [] if do_config or req.adjust_cfg: result = self._reconfigure( commit, req.brd, cwd, args, env, config_args, config_out, @@ -495,8 +514,29 @@ class BuilderThread(threading.Thread): do_config = False # No need to configure next time if req.adjust_cfg: cfgutil.adjust_cfg_file(cfg_file, req.adjust_cfg) + return result, do_config, cfg_file + + def _build_and_get_result(self, req, commit, cwd, args, env, cmd_list, + config_out, cfg_file, src_dir, config_only, + result): + """Perform the build and finalise the result + + Args: + req (RunRequest): Run request (see RunRequest for details) + commit (Commit): Commit being built + cwd (str): Current working directory + args (list of str): Arguments to pass to make + env (dict): Environment strings + cmd_list (list of str): List to add the commands to, for logging + config_out (StringIO): Buffer for configuration output + cfg_file (str): Path to the .config file + src_dir (str): Source directory path + config_only (bool): Only configure the source, do not build it + result (CommandResult): Previous result - # Now do the build, if everything looks OK + Returns: + CommandResult: Result of the build + """ if result.return_code == 0: if req.adjust_cfg: oldc_args = list(args) + ['oldconfig'] @@ -515,6 +555,44 @@ class BuilderThread(threading.Thread): if self.builder.verbose_build: result.stdout = config_out.getvalue() + result.stdout result.cmd_list = cmd_list + return result + + def _config_and_build(self, req, commit_upto, do_config, mrproper, + config_only, commit, out_dir, out_rel_dir, result): + """Do the build, configuring first if necessary + + Args: + req (RunRequest): Run request (see RunRequest for details) + commit_upto (int): Commit number to build (0...n-1) + do_config (bool): True to run a make _defconfig on the source + mrproper (bool): True to run mrproper first + config_only (bool): Only configure the source, do not build it + commit (Commit): Commit being built + out_dir (str): Output directory for the build, or None to use + current + out_rel_dir (str): Output directory relative to the current dir + result (CommandResult): Previous result + + Returns: + tuple: + result (CommandResult): Result of the build + do_config (bool): indicates whether 'make config' is needed on + the next incremental build + """ + env, args, config_args, cwd, src_dir = self._setup_build( + req, commit_upto, out_dir, out_rel_dir) + + config_out = io.StringIO() + cmd_list = [] + + result, do_config, cfg_file = self._reconfig_if_needed( + req, commit, cwd, args, env, config_args, config_out, cmd_list, + out_dir, do_config, mrproper, result) + + result = self._build_and_get_result( + req, commit, cwd, args, env, cmd_list, config_out, cfg_file, + src_dir, config_only, result) + return result, do_config def run_commit(self, req, commit_upto, do_config, mrproper, config_only, From patchwork Mon Jan 5 18:30: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: 1276 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=1767637877; bh=6ah2k7nA7xtVmbINuyBh+rLp5LgDyrM04KmRauFOp+s=; 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=XG7cmdbTdeSAyf8deWt7bRwwfaVF0YOEwEE9zQVIEaOhRZRaB1LuKyMoUlGgQ9val 23StY9oLkSKQW5PP3xGZyKg5Jsa3Ames/0ZAO4W0zBPy/s/CgOLGQg0nC/uCobA+ui vKEuZ61C9gEtYkU3b6N4mOqueD/Mp2aZKX9Ka+9JovnRKqsOccEfHuw5mNqmPEdJl7 uAhdUbsb52fmF7Aj9Jj0DBJh4mw5d2p0rLOnOYtPG20ZclbL1HCUlWT2OsNGLXrjDy 2ozJrSaFf2nFyA+Eh4Q+7x9yNCXjHRTh2d1Iv83M0EpERKNfh9bx6yz2nc0xR+d+wE EjhOK+GPhjuDg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2E88169116 for ; Mon, 5 Jan 2026 11:31: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 mLLoC7lOmDLY for ; Mon, 5 Jan 2026 11:31:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637877; bh=6ah2k7nA7xtVmbINuyBh+rLp5LgDyrM04KmRauFOp+s=; 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=XG7cmdbTdeSAyf8deWt7bRwwfaVF0YOEwEE9zQVIEaOhRZRaB1LuKyMoUlGgQ9val 23StY9oLkSKQW5PP3xGZyKg5Jsa3Ames/0ZAO4W0zBPy/s/CgOLGQg0nC/uCobA+ui vKEuZ61C9gEtYkU3b6N4mOqueD/Mp2aZKX9Ka+9JovnRKqsOccEfHuw5mNqmPEdJl7 uAhdUbsb52fmF7Aj9Jj0DBJh4mw5d2p0rLOnOYtPG20ZclbL1HCUlWT2OsNGLXrjDy 2ozJrSaFf2nFyA+Eh4Q+7x9yNCXjHRTh2d1Iv83M0EpERKNfh9bx6yz2nc0xR+d+wE EjhOK+GPhjuDg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 13DF069103 for ; Mon, 5 Jan 2026 11:31:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637875; bh=p/uFdMHiZST5CyulHlNjtBn2n2aXSHplf20JQhIdAYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jg7qtgVffQ/hseExHNG3/mNLULjIM4ihZ0n6JjDNoifrYzKSt6740rF/jQpg88A2H tjoy/mDnFNxaE1jl7Zzs7MXMPQHgo3I207tVXURQueYCUk/yrGnTaqm20VDcV7DckL H079ZpnB8HkXC9FofRerfmrCn7rVCdPwwieiRV1D2qgXCJ0b09aZ4dEg6W1pfpCiwG NoIPZdE+ZUnAfWhvUepxaRyG6h0FF2B6iR5g7j9XbI8vw95HKJW9Cf9Ue+pLwQyYN1 KVv18BJJL4cC2yuSdy4VQyn2gDwErztJfvtxQ24QPeRUpb4eeyPKQIk+NSn+5GgRxq qbAkdwKYqnF5A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 397CD69103; Mon, 5 Jan 2026 11:31:15 -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 uk9KQreB6EJI; Mon, 5 Jan 2026 11:31:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637871; bh=BwAGae10sGiR8uvhF5IVHYKXQ2je2hAip4X7TI3EWPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eOJsmJXAvOlXDV8lCdjEZ/SAxfQvBkan9I06GTQMR38GYURucQJewcCJUCuaAoS7f qIyb9MnZVmraCb8Es4PnEl2X0lhEm3D9BQKWJtvyvsn6VZr9Zi2Za6ZTV91+RsFgIG 6sAXDaB5DNP4KUCtHBVKVfjbkcb5CP8Fu8/sCnsPHN9b8kdpcSiqK94DVxtVTb6ali mLx+RRZ/pyufJ5DxvaMlEnJF2WhSLeLMh1RantbQIAegwcC6nvgRNxu8spqOSs/64o goKRONdSSjI6VtYjGJtULv32GSJadL3cxYTIvA0zrfglYL+b+UZNRJLtGRiz9Yt7ei earMfsu8/z9Ng== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 02CA969045; Mon, 5 Jan 2026 11:31:10 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:21 -0700 Message-ID: <20260105183030.1487468-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4LLWOAEIUBYCFP2GZIFJSEROJTHMGPAN X-Message-ID-Hash: 4LLWOAEIUBYCFP2GZIFJSEROJTHMGPAN 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 06/11] buildman: Add BuildSetup named tuple for _setup_build() return value 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 Introduce a BuildSetup named tuple to hold the return value from _setup_build(). This groups the build environment setup values: - env: Environment variables for the build - args: Arguments to pass to make - config_args: Arguments for configuration - cwd: Current working directory for the build - src_dir: Source directory path Update _reconfig_if_needed() and _build_and_get_result() to accept the setup tuple instead of individual parameters, simplifying their signatures and the calls from _config_and_build() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 67 ++++++++++++++++----------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 67a0b486b47..e0164b30a4e 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -38,6 +38,17 @@ from u_boot_pylib import tools RunRequest = namedtuple('RunRequest', ['brd', 'work_dir', 'work_in_output', 'adjust_cfg', 'fragments']) +# Named tuple for _setup_build() return value +# +# Members: +# env (dict): Environment variables for the build +# args (list of str): Arguments to pass to make +# config_args (list of str): Arguments for configuration +# cwd (str): Current working directory for the build +# src_dir (str): Source directory path +BuildSetup = namedtuple('BuildSetup', ['env', 'args', 'config_args', 'cwd', + 'src_dir']) + RETURN_CODE_RETRY = -1 BASE_ELF_FILENAMES = ['u-boot', 'spl/u-boot-spl', 'tpl/u-boot-tpl'] @@ -454,12 +465,7 @@ class BuilderThread(threading.Thread): out_rel_dir (str): Output directory relative to the current dir Returns: - tuple: - env (dict): Environment variables for the build - args (list of str): Arguments to pass to make - config_args (list of str): Arguments for configuration - cwd (str): Current working directory for the build - src_dir (str): Source directory path + BuildSetup: Build setup (see BuildSetup for details) """ env = self.builder.make_environment(self.toolchain) if out_dir and not os.path.exists(out_dir): @@ -479,20 +485,16 @@ class BuilderThread(threading.Thread): _remove_old_outputs(out_dir) - return env, args, config_args, cwd, src_dir + return BuildSetup(env, args, config_args, cwd, src_dir) - def _reconfig_if_needed(self, req, commit, cwd, args, env, config_args, - config_out, cmd_list, out_dir, do_config, mrproper, - result): + def _reconfig_if_needed(self, req, setup, commit, config_out, cmd_list, + out_dir, do_config, mrproper, result): """Reconfigure the build if needed Args: req (RunRequest): Run request (see RunRequest for details) + setup (BuildSetup): Build setup (see BuildSetup for details) commit (Commit): Commit being built - cwd (str): Current working directory - args (list of str): Arguments to pass to make - env (dict): Environment strings - config_args (list of str): Arguments for configuration config_out (StringIO): Buffer for configuration output cmd_list (list of str): List to add the commands to, for logging out_dir (str): Output directory for the build @@ -509,28 +511,24 @@ class BuilderThread(threading.Thread): cfg_file = os.path.join(out_dir or '', '.config') if do_config or req.adjust_cfg: result = self._reconfigure( - commit, req.brd, cwd, args, env, config_args, config_out, - cmd_list, mrproper) + commit, req.brd, setup.cwd, setup.args, setup.env, + setup.config_args, config_out, cmd_list, mrproper) do_config = False # No need to configure next time if req.adjust_cfg: cfgutil.adjust_cfg_file(cfg_file, req.adjust_cfg) return result, do_config, cfg_file - def _build_and_get_result(self, req, commit, cwd, args, env, cmd_list, - config_out, cfg_file, src_dir, config_only, - result): + def _build_and_get_result(self, req, setup, commit, cmd_list, config_out, + cfg_file, config_only, result): """Perform the build and finalise the result Args: req (RunRequest): Run request (see RunRequest for details) + setup (BuildSetup): Build setup (see BuildSetup for details) commit (Commit): Commit being built - cwd (str): Current working directory - args (list of str): Arguments to pass to make - env (dict): Environment strings cmd_list (list of str): List to add the commands to, for logging config_out (StringIO): Buffer for configuration output cfg_file (str): Path to the .config file - src_dir (str): Source directory path config_only (bool): Only configure the source, do not build it result (CommandResult): Previous result @@ -539,19 +537,19 @@ class BuilderThread(threading.Thread): """ if result.return_code == 0: if req.adjust_cfg: - oldc_args = list(args) + ['oldconfig'] - oldc_result = self.make(commit, req.brd, 'oldconfig', cwd, - *oldc_args, env=env) + oldc_args = list(setup.args) + ['oldconfig'] + oldc_result = self.make(commit, req.brd, 'oldconfig', setup.cwd, + *oldc_args, env=setup.env) if oldc_result.return_code: return oldc_result - result = self._build(commit, req.brd, cwd, args, env, cmd_list, - config_only) + result = self._build(commit, req.brd, setup.cwd, setup.args, + setup.env, cmd_list, config_only) if req.adjust_cfg: errs = cfgutil.check_cfg_file(cfg_file, req.adjust_cfg) if errs: result.stderr += errs result.return_code = 1 - result.stderr = result.stderr.replace(src_dir + '/', '') + result.stderr = result.stderr.replace(setup.src_dir + '/', '') if self.builder.verbose_build: result.stdout = config_out.getvalue() + result.stdout result.cmd_list = cmd_list @@ -579,19 +577,18 @@ class BuilderThread(threading.Thread): do_config (bool): indicates whether 'make config' is needed on the next incremental build """ - env, args, config_args, cwd, src_dir = self._setup_build( - req, commit_upto, out_dir, out_rel_dir) + setup = self._setup_build(req, commit_upto, out_dir, out_rel_dir) config_out = io.StringIO() cmd_list = [] result, do_config, cfg_file = self._reconfig_if_needed( - req, commit, cwd, args, env, config_args, config_out, cmd_list, - out_dir, do_config, mrproper, result) + req, setup, commit, config_out, cmd_list, out_dir, do_config, + mrproper, result) result = self._build_and_get_result( - req, commit, cwd, args, env, cmd_list, config_out, cfg_file, - src_dir, config_only, result) + req, setup, commit, cmd_list, config_out, cfg_file, config_only, + result) return result, do_config From patchwork Mon Jan 5 18:30: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: 1277 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=1767637884; bh=l0Ylylmqf9+z0QjVhQB0Qmd4/MCh4plgv2N86RKlxJw=; 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=OIOW+iW3bK07nFgKENod4XGxxtIf6SUK4HirrzwuzYaIcq+wecuFiUhCD/F85mZp2 LeiK7/WB4bHhmwJxosVGc9XDdilhh2s4kwgrn0ocgYgFLUZBjCfKZo8nsIRU8lzlPJ e4348OKgQQ87qEEJQHWRZplkMLZAFo8jaBhcNWZwb9NVpVkJbDlSCe2iEoiql+kGr6 29nUsH/YBZejGzHAUIDC+slBM8/q/nXV4DJaGaSqGvpyvUAmlgMNJruiJgCpjyS63V dmRZDoqNhGEbXW1Ah6eFnfGpRiEe6jWaKfnTWLfZFsrhotkrAF/VpnbTRfanvl8wE3 C0s7GQuux+93Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1E90E6911F for ; Mon, 5 Jan 2026 11:31: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 10024) with ESMTP id mk9hV3xeeu19 for ; Mon, 5 Jan 2026 11:31:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637884; bh=l0Ylylmqf9+z0QjVhQB0Qmd4/MCh4plgv2N86RKlxJw=; 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=OIOW+iW3bK07nFgKENod4XGxxtIf6SUK4HirrzwuzYaIcq+wecuFiUhCD/F85mZp2 LeiK7/WB4bHhmwJxosVGc9XDdilhh2s4kwgrn0ocgYgFLUZBjCfKZo8nsIRU8lzlPJ e4348OKgQQ87qEEJQHWRZplkMLZAFo8jaBhcNWZwb9NVpVkJbDlSCe2iEoiql+kGr6 29nUsH/YBZejGzHAUIDC+slBM8/q/nXV4DJaGaSqGvpyvUAmlgMNJruiJgCpjyS63V dmRZDoqNhGEbXW1Ah6eFnfGpRiEe6jWaKfnTWLfZFsrhotkrAF/VpnbTRfanvl8wE3 C0s7GQuux+93Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0B7EE6911B for ; Mon, 5 Jan 2026 11:31:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637881; bh=imtIJocjfdy8+VkfBc48kVn0ONnl+L4vuiUmp84svjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AIpet9qsT93CX9XEIn1rnB5d7mQDKXBrIl35xMr/LqCTI3x7OXL06+/wKYjaQpxg1 XLLw7oX0R7oBDS8bkfEIQH2brgSmZgvokHDLOJFomBQnlAmosqcZXbo9G2d6i7aTIG Qms1jhzI8m8SxtfPqja/curqjbuVDF8ByMWuzfQImVyCvOxGTKt+2NbS1JOsf2FVMs RcQ8aKuvYH1BzMcMLZ3EopiE7C4UvEVjgVaurOvYfBCaMoVjwHRx5UAmd0bi2n3YDL eZOyDL6FPOl9QlDPBHEDxhlMUB+riv20DdJ5S4YghFcNaJAQ+2P3KC3gqYpsjrvEg7 M/Nqwgb8Fjr9Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BC3BC69116; Mon, 5 Jan 2026 11:31: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 10026) with ESMTP id zxSw_GCOr3Ii; Mon, 5 Jan 2026 11:31:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637875; bh=5XUf+WdwrxSgI+Cf2xttZsA7n6Bol0p0tm30aOK4i7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l/3T0q3nG9FuqGvipq85JOVys2LmdCEuFRqhHYWRyIusjT0OtWjYmmU1DlzaMsW1Y 9u5QxhbHHEhcw605A1y8IB5XAt/X108N1IOobi6bHRLEOg1FygwvM9krDRHDN4Nmf7 g/t8BZHdo3mmKi029Upg+AwPPGGZKXdt9tkW1aGkf2B94lW/ZU9hDa/aQHcq/jSqWH NX5YurUd2WkECndsp2HgRP+pnXr7uNAAokD8ak4Zpm94UxYdyPvDRWvUyFqprbdZgZ YnztbrrXcsAC+d77jjLosZVVfxTzPkBmEyFsX8NcLOmdti2RhxV9OXiUg79EphA0N+ KgZRCfZ7bl/6Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7863869045; Mon, 5 Jan 2026 11:31:15 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:22 -0700 Message-ID: <20260105183030.1487468-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: OMOHN2HK4TBACQJPYSLHMQYRZEXFGEGW X-Message-ID-Hash: OMOHN2HK4TBACQJPYSLHMQYRZEXFGEGW 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 07/11] buildman: Extract _do_build() from run_commit() 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 build logic from the 'if will_build:' block in run_commit() into a separate _do_build() method. This improves readability and reduces the complexity of run_commit() The new method handles: - Obtaining a toolchain if needed - Checking for Kconfig changes that require reconfiguration - Calling _config_and_build() to perform the actual build Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 81 +++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index e0164b30a4e..8420698023a 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -592,6 +592,56 @@ class BuilderThread(threading.Thread): return result, do_config + def _do_build(self, req, commit_upto, do_config, mrproper, config_only, + out_dir, out_rel_dir, result): + """Perform a build if a toolchain can be obtained + + Args: + req (RunRequest): Run request (see RunRequest for details) + commit_upto (int): Commit number to build (0...n-1) + do_config (bool): True to run a make _defconfig on the source + mrproper (bool): True to run mrproper first + config_only (bool): Only configure the source, do not build it + out_dir (str): Output directory for the build + out_rel_dir (str): Output directory relative to the current dir + result (CommandResult): Previous result + + Returns: + tuple: + result (CommandResult): Result of the build + do_config (bool): Whether config is needed next time + kconfig_reconfig (bool): Whether Kconfig triggered a reconfig + """ + kconfig_reconfig = False + + # We are going to have to build it. First, get a toolchain + if not self.toolchain: + try: + self.toolchain = self.builder.toolchains.select(req.brd.arch) + except ValueError as err: + result.return_code = 10 + result.stdout = '' + result.stderr = f'Tool chain error for {req.brd.arch}: {err}' + + if self.toolchain: + commit = self._checkout(commit_upto, req.work_dir) + + # Check if Kconfig files have changed since last config + if self.builder.kconfig_check: + config_file = os.path.join(out_dir, '.config') + if kconfig_changed_since(config_file, req.work_dir, + req.brd.target): + kconfig_reconfig = True + do_config = True + + result, do_config = self._config_and_build( + req, commit_upto, do_config, mrproper, config_only, + commit, out_dir, out_rel_dir, result) + + result.already_done = False + result.kconfig_reconfig = kconfig_reconfig + return result, do_config, kconfig_reconfig + def run_commit(self, req, commit_upto, do_config, mrproper, config_only, force_build, force_build_failures): """Build a particular commit. @@ -623,35 +673,10 @@ class BuilderThread(threading.Thread): force_build, force_build_failures) - kconfig_reconfig = False if will_build: - # We are going to have to build it. First, get a toolchain - if not self.toolchain: - try: - self.toolchain = self.builder.toolchains.select( - req.brd.arch) - except ValueError as err: - result.return_code = 10 - result.stdout = '' - result.stderr = (f'Tool chain error for {req.brd.arch}: ' - f'{str(err)}') - - if self.toolchain: - commit = self._checkout(commit_upto, req.work_dir) - - # Check if Kconfig files have changed since last config - if self.builder.kconfig_check: - config_file = os.path.join(out_dir, '.config') - if kconfig_changed_since(config_file, req.work_dir, - req.brd.target): - kconfig_reconfig = True - do_config = True - - result, do_config = self._config_and_build( - req, commit_upto, do_config, mrproper, config_only, - commit, out_dir, out_rel_dir, result) - result.already_done = False - result.kconfig_reconfig = kconfig_reconfig + result, do_config, _ = self._do_build( + req, commit_upto, do_config, mrproper, config_only, + out_dir, out_rel_dir, result) result.toolchain = self.toolchain result.brd = req.brd From patchwork Mon Jan 5 18:30: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: 1278 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=1767637884; bh=1exaOO1SCKvQRmUWr0E6TxZD5OZwpW16aJH8czXhx/g=; 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=po9HPBemmGLphKdKjS//7MKwDht/7dxxV0gvmhI+R+dZE2edFVbcblEyMAYZbJyA5 o8TMVy/7IkcpiUUoMSXZf5p2w8whAMFPG5mX6HpUC8aKDV+WNRPBpvBIa4FuhkkrLh PbekRpzFQ0p5f2NFNgLWzzvnwjgI/PsIYpisCqFxGLXyMP+B2c0Gz1D37a58p/lxx7 GDIpNcdyO2WW6QicoZJqrcd4YqZIHIcneNOAjN1Zt4+N37CUVV/Zst6zVN9we+ykzB i/kzHufiQ4wx94bJx3LS+IYR5AUZEiU3NQt3c5R8tMdCSrw1vSIqPLIXfDhug0+q1h s2JBQnzfE05MA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A60A269125 for ; Mon, 5 Jan 2026 11:31: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 10024) with ESMTP id 01ttL1IKRsKm for ; Mon, 5 Jan 2026 11:31:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637884; bh=1exaOO1SCKvQRmUWr0E6TxZD5OZwpW16aJH8czXhx/g=; 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=po9HPBemmGLphKdKjS//7MKwDht/7dxxV0gvmhI+R+dZE2edFVbcblEyMAYZbJyA5 o8TMVy/7IkcpiUUoMSXZf5p2w8whAMFPG5mX6HpUC8aKDV+WNRPBpvBIa4FuhkkrLh PbekRpzFQ0p5f2NFNgLWzzvnwjgI/PsIYpisCqFxGLXyMP+B2c0Gz1D37a58p/lxx7 GDIpNcdyO2WW6QicoZJqrcd4YqZIHIcneNOAjN1Zt4+N37CUVV/Zst6zVN9we+ykzB i/kzHufiQ4wx94bJx3LS+IYR5AUZEiU3NQt3c5R8tMdCSrw1vSIqPLIXfDhug0+q1h s2JBQnzfE05MA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9459A6911C for ; Mon, 5 Jan 2026 11:31:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637881; bh=qWrS+cX7z7acKB/+Lq+Lt6syAWr4VcxyeR4d9nzWIoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tEU86fwNWrh6iTjnfriVwQ345uOVbb9BX7jiNHarH9HgAcdzw4+D8dzukOBb8SLNe S+qT9gPXkoBNVnzMdeJy//Mjj6YiUIbixVHVmUd7UqEe+h7v/i4nfo8uWUgHb8WEmI CO92PiqwxWb8xClkB3iBcSF4r7IEdFedAnsmuQAxZsGc6qGBimH4sstM0hClb/p3bw IcioZuYOvvw5b9QJp2YWSttfObcKljjZ4jIdab1Wd1i7dclta28QWJWC4alaV/b/Pw BaRwpF2x5OdSdWiciy5zGUGkz62MXsukDkAFlBFNSc67SgpZrKRTkWwSh2YtA9zsgT gi+eoipfR6lzA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D1FB869045; Mon, 5 Jan 2026 11:31: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 10026) with ESMTP id P8IG8x-gGMBm; Mon, 5 Jan 2026 11:31:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637880; bh=uHXK0s72cDWj8IZa+ldb1gpDjd2j6Lu2OWyA2C2TMsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JJClfvdOmKJGPztejtPhOn3AkULjJbA4N1sKVkH9TeyIxhXvoJ9SSepj8OyVWd+Z/ sycTiDWlu2Nk6/OgBIxSfWFuskktnGqiA7lfatk0uZgCJhyxD678BS/7GyBWzpa6em myZrLLtb27DGwlFSUW6r6Jw0Dl7fCJi85Pa2bKzv6mTu0dH5b+1kAcd+f2eUWwW/Ta UkcrqtJi1hsffz/580MBdfRy5xHiR4ix2/qivdNWV0fZyr4onNLl5ftHsQRdjMHc6X q2Ed2v2W16w2tOvwKpl2NCcFHNcYS63lw+jcB5bcCT4NpahW8lOqwqBzSb9Raem+LL a+qz2O0voARcg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 32B2969103; Mon, 5 Jan 2026 11:31:20 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:23 -0700 Message-ID: <20260105183030.1487468-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YNQNI76KTAMNQSKLF4O7IFBW2S4Z2KPF X-Message-ID-Hash: YNQNI76KTAMNQSKLF4O7IFBW2S4Z2KPF 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 08/11] buildman: Extract _write_toolchain_result() from _write_result() 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 toolchain-result-writing logic from the 'if result.toolchain:' block in _write_result() into a separate _write_toolchain_result() method. This improves readability and reduces the complexity of _write_result() The new method handles: - Writing the done file with the return code - Writing toolchain information (gcc, path, cross, arch) - Writing environment and command list files - Running nm, objdump, and size on ELF files - Extracting and copying the U-Boot environment - Writing image sizes file Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 179 +++++++++++++++++--------------- 1 file changed, 97 insertions(+), 82 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 8420698023a..1855e2cc2cb 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -684,6 +684,101 @@ class BuilderThread(threading.Thread): result.out_dir = out_dir return result, do_config + def _write_toolchain_result(self, result, done_file, build_dir, + maybe_aborted, work_in_output): + """Write build result and toolchain information + + Args: + result (CommandResult): Result to write + done_file (str): Path to the 'done' file + build_dir (str): Build directory path + maybe_aborted (bool): True if the build may have been aborted + work_in_output (bool): Use the output directory as the work + directory and don't write to a separate output directory + """ + # Write the build result and toolchain information. + with open(done_file, 'w', encoding='utf-8') as outf: + if maybe_aborted: + # Special code to indicate we need to retry + outf.write(f'{RETURN_CODE_RETRY}') + else: + outf.write(f'{result.return_code}') + with open(os.path.join(build_dir, 'toolchain'), 'w', + encoding='utf-8') as outf: + print('gcc', result.toolchain.gcc, file=outf) + print('path', result.toolchain.path, file=outf) + print('cross', result.toolchain.cross, file=outf) + print('arch', result.toolchain.arch, file=outf) + outf.write(f'{result.return_code}') + + # Write out the image and function size information and an objdump + env = self.builder.make_environment(self.toolchain) + with open(os.path.join(build_dir, 'out-env'), 'wb') as outf: + for var in sorted(env.keys()): + outf.write(b'%s="%s"' % (var, env[var])) + + with open(os.path.join(build_dir, 'out-cmd'), 'w', + encoding='utf-8') as outf: + for cmd in result.cmd_list: + print(' '.join(cmd), file=outf) + + lines = [] + for fname in BASE_ELF_FILENAMES: + cmd = [f'{self.toolchain.cross}nm', '--size-sort', fname] + nm_result = command.run_one(*cmd, capture=True, + capture_stderr=True, + cwd=result.out_dir, + raise_on_error=False, env=env) + if nm_result.stdout: + nm_fname = self.builder.get_func_sizes_file( + result.commit_upto, result.brd.target, fname) + with open(nm_fname, 'w', encoding='utf-8') as outf: + print(nm_result.stdout, end=' ', file=outf) + + cmd = [f'{self.toolchain.cross}objdump', '-h', fname] + dump_result = command.run_one(*cmd, capture=True, + capture_stderr=True, + cwd=result.out_dir, + raise_on_error=False, env=env) + rodata_size = '' + if dump_result.stdout: + objdump = self.builder.get_objdump_file(result.commit_upto, + result.brd.target, fname) + with open(objdump, 'w', encoding='utf-8') as outf: + print(dump_result.stdout, end=' ', file=outf) + for line in dump_result.stdout.splitlines(): + fields = line.split() + if len(fields) > 5 and fields[1] == '.rodata': + rodata_size = fields[2] + + cmd = [f'{self.toolchain.cross}size', fname] + size_result = command.run_one(*cmd, capture=True, + capture_stderr=True, + cwd=result.out_dir, + raise_on_error=False, env=env) + if size_result.stdout: + lines.append(size_result.stdout.splitlines()[1] + ' ' + + rodata_size) + + # Extract the environment from U-Boot and dump it out + cmd = [f'{self.toolchain.cross}objcopy', '-O', 'binary', + '-j', '.rodata.default_environment', + 'env/built-in.o', 'uboot.env'] + command.run_one(*cmd, capture=True, capture_stderr=True, + cwd=result.out_dir, raise_on_error=False, env=env) + if not work_in_output: + copy_files(result.out_dir, build_dir, '', ['uboot.env']) + + # Write out the image sizes file. This is similar to the output + # of binutil's 'size' utility, but it omits the header line and + # adds an additional hex value at the end of each line for the + # rodata size + if lines: + sizes = self.builder.get_sizes_file(result.commit_upto, + result.brd.target) + with open(sizes, 'w', encoding='utf-8') as outf: + print('\n'.join(lines), file=outf) + def _write_result(self, result, keep_outputs, work_in_output): """Write a built result to the output directory. @@ -729,88 +824,8 @@ class BuilderThread(threading.Thread): done_file = self.builder.get_done_file(result.commit_upto, result.brd.target) if result.toolchain: - # Write the build result and toolchain information. - with open(done_file, 'w', encoding='utf-8') as outf: - if maybe_aborted: - # Special code to indicate we need to retry - outf.write(f'{RETURN_CODE_RETRY}') - else: - outf.write(f'{result.return_code}') - with open(os.path.join(build_dir, 'toolchain'), 'w', - encoding='utf-8') as outf: - print('gcc', result.toolchain.gcc, file=outf) - print('path', result.toolchain.path, file=outf) - print('cross', result.toolchain.cross, file=outf) - print('arch', result.toolchain.arch, file=outf) - outf.write(f'{result.return_code}') - - # Write out the image and function size information and an objdump - env = self.builder.make_environment(self.toolchain) - with open(os.path.join(build_dir, 'out-env'), 'wb') as outf: - for var in sorted(env.keys()): - outf.write(b'%s="%s"' % (var, env[var])) - - with open(os.path.join(build_dir, 'out-cmd'), 'w', - encoding='utf-8') as outf: - for cmd in result.cmd_list: - print(' '.join(cmd), file=outf) - - lines = [] - for fname in BASE_ELF_FILENAMES: - cmd = [f'{self.toolchain.cross}nm', '--size-sort', fname] - nm_result = command.run_one(*cmd, capture=True, - capture_stderr=True, - cwd=result.out_dir, - raise_on_error=False, env=env) - if nm_result.stdout: - nm_fname = self.builder.get_func_sizes_file( - result.commit_upto, result.brd.target, fname) - with open(nm_fname, 'w', encoding='utf-8') as outf: - print(nm_result.stdout, end=' ', file=outf) - - cmd = [f'{self.toolchain.cross}objdump', '-h', fname] - dump_result = command.run_one(*cmd, capture=True, - capture_stderr=True, - cwd=result.out_dir, - raise_on_error=False, env=env) - rodata_size = '' - if dump_result.stdout: - objdump = self.builder.get_objdump_file(result.commit_upto, - result.brd.target, fname) - with open(objdump, 'w', encoding='utf-8') as outf: - print(dump_result.stdout, end=' ', file=outf) - for line in dump_result.stdout.splitlines(): - fields = line.split() - if len(fields) > 5 and fields[1] == '.rodata': - rodata_size = fields[2] - - cmd = [f'{self.toolchain.cross}size', fname] - size_result = command.run_one(*cmd, capture=True, - capture_stderr=True, - cwd=result.out_dir, - raise_on_error=False, env=env) - if size_result.stdout: - lines.append(size_result.stdout.splitlines()[1] + ' ' + - rodata_size) - - # Extract the environment from U-Boot and dump it out - cmd = [f'{self.toolchain.cross}objcopy', '-O', 'binary', - '-j', '.rodata.default_environment', - 'env/built-in.o', 'uboot.env'] - command.run_one(*cmd, capture=True, capture_stderr=True, - cwd=result.out_dir, raise_on_error=False, env=env) - if not work_in_output: - copy_files(result.out_dir, build_dir, '', ['uboot.env']) - - # Write out the image sizes file. This is similar to the output - # of binutil's 'size' utility, but it omits the header line and - # adds an additional hex value at the end of each line for the - # rodata size - if lines: - sizes = self.builder.get_sizes_file(result.commit_upto, - result.brd.target) - with open(sizes, 'w', encoding='utf-8') as outf: - print('\n'.join(lines), file=outf) + self._write_toolchain_result(result, done_file, build_dir, + maybe_aborted, work_in_output) else: # Indicate that the build failure due to lack of toolchain tools.write_file(done_file, '2\n', binary=False) From patchwork Mon Jan 5 18:30: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: 1279 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=1767637888; bh=TAz4sJdqJQTO4dX6qo4jHJjXCauQ6wDJckrauSYVI0Q=; 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=naAbRKc3RaBzXTt0Dv6Ut+W+cE8WJcIon7AhSx3ipqyGRNdKu6IqX6IE3zmaalUWu KGEW36FOdy5Rj2Gb07eJpWHhkfy8isEymUoJdDYiWMMdifttRYhXfcHxDoZritdnTW WdfliT94fWWt25HCLsoWx5oQhpLT6f/aYZAw2y72RhFMORqGz+eQ4Mp+9rqTJzQKFb /tfDhlcXeIRNltY3SmxWDgIMNYc85zYcFNiYT9W2slrlZEjCwr3qDXO99mP4eCd3ZJ 8WwysvBW8UZ1N+CIb91DgdQRRQr7iXIvzgbc1ewIiscBu/eRTKY9A8fE2ErUc4zDQh Y8MqrFOFk65mA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 26EA469118 for ; Mon, 5 Jan 2026 11:31: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 10024) with ESMTP id ger-uZC1gK0M for ; Mon, 5 Jan 2026 11:31:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637888; bh=TAz4sJdqJQTO4dX6qo4jHJjXCauQ6wDJckrauSYVI0Q=; 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=naAbRKc3RaBzXTt0Dv6Ut+W+cE8WJcIon7AhSx3ipqyGRNdKu6IqX6IE3zmaalUWu KGEW36FOdy5Rj2Gb07eJpWHhkfy8isEymUoJdDYiWMMdifttRYhXfcHxDoZritdnTW WdfliT94fWWt25HCLsoWx5oQhpLT6f/aYZAw2y72RhFMORqGz+eQ4Mp+9rqTJzQKFb /tfDhlcXeIRNltY3SmxWDgIMNYc85zYcFNiYT9W2slrlZEjCwr3qDXO99mP4eCd3ZJ 8WwysvBW8UZ1N+CIb91DgdQRRQr7iXIvzgbc1ewIiscBu/eRTKY9A8fE2ErUc4zDQh Y8MqrFOFk65mA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 132636911B for ; Mon, 5 Jan 2026 11:31:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637886; bh=ZGg4Q+UPjTm2sCitzqOb/dDetlUan0lmM0auY1rXKfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U6B+HSzxMHZ5UTMz/OPTXC5rBc0j2BkhNyjvB7D5jCTUknxERawI7SB0e+CyXke9z vx++F2RSZViFtI51BAfPo156MFlmYWxCLv3AN4Z9U9vjI06LN/0hclEDms7sdIVGNR MVJusjHy8l8VPeYEmfNTCCYK5kXjIaxSLaeuuxDFAQe5fhNIbcgFtSVwJi2eM3x9tb dZgPB3C+nRE6ZJpvE1Sw+828K35iv3Rt0v09Zvo3Jmidb5Z8r/XwzpDdayvPTguc2s wfyYyk2eRxF5POij/MTCNV/29aXnaDqkcZoSrUq5NWf+vfu6CJI9S5DRef7NYa8Z0V r1JLVVW8F1yZw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1620C6911F; Mon, 5 Jan 2026 11:31:26 -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 aTJhz7gXZDRZ; Mon, 5 Jan 2026 11:31:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637881; bh=j3oafw5rFOMQcHAYyGxovPbXspBw0iqdUlnVeXPoKCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FdTgLEmmiZXyMFBOCZ2sDlUnLFIjDr7X3AVdNM7UEqtUt99UhYpotYSYoj3+5a2nV vEFIqYQPSDCpm2lS94Z6KjiupQMPvHTNyVLBOqS3MMjYkf20EB/NluepATSRuUUqi3 7B5uBUZzMC8AF8EVQyKIc2MULQ9YcYBPIpfw8/Ds0WobIJpXU4QoW/3t7KUL0qNP/N KPUHuYaZn5JZFVp5ZbudGgBpl7Su8Q7LsdDhYWAX+6bhGl0v5oVLkxKTTojV3bWGeY OQ6EDDDIZ4NgBiuB1PoIaTAubG8ddXfqDw3K4lPhaFephhM8FjKq8LwCk9MFF/BrsC ukBVEE0GdShfQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3BA3969118; Mon, 5 Jan 2026 11:31:21 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:24 -0700 Message-ID: <20260105183030.1487468-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: Z5GJARRABZOD6YENBRDBU2VWXQFKI5JE X-Message-ID-Hash: Z5GJARRABZOD6YENBRDBU2VWXQFKI5JE 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 09/11] buildman: Extract _process_elf_file() from _write_toolchain_result() 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 ELF file processing logic from the for loop in _write_toolchain_result() into a separate _process_elf_file() method. The new method handles processing a single ELF file: - Running nm to get function sizes - Running objdump to get section headers and rodata size - Running size to get overall sizes - Writing output to appropriate files Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 88 ++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 35 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 1855e2cc2cb..d5c8c6141eb 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -684,6 +684,56 @@ class BuilderThread(threading.Thread): result.out_dir = out_dir return result, do_config + def _process_elf_file(self, result, fname, env): + """Process an ELF file to extract size information + + Runs nm, objdump, and size on the ELF file and writes the output + to appropriate files. + + Args: + result (CommandResult): Result containing build information + fname (str): ELF filename to process + env (dict): Environment variables for the commands + + Returns: + str: Size line with rodata size appended, or None if size failed + """ + cmd = [f'{self.toolchain.cross}nm', '--size-sort', fname] + nm_result = command.run_one(*cmd, capture=True, + capture_stderr=True, + cwd=result.out_dir, + raise_on_error=False, env=env) + if nm_result.stdout: + nm_fname = self.builder.get_func_sizes_file( + result.commit_upto, result.brd.target, fname) + with open(nm_fname, 'w', encoding='utf-8') as outf: + print(nm_result.stdout, end=' ', file=outf) + + cmd = [f'{self.toolchain.cross}objdump', '-h', fname] + dump_result = command.run_one(*cmd, capture=True, + capture_stderr=True, + cwd=result.out_dir, + raise_on_error=False, env=env) + rodata_size = '' + if dump_result.stdout: + objdump = self.builder.get_objdump_file(result.commit_upto, + result.brd.target, fname) + with open(objdump, 'w', encoding='utf-8') as outf: + print(dump_result.stdout, end=' ', file=outf) + for line in dump_result.stdout.splitlines(): + fields = line.split() + if len(fields) > 5 and fields[1] == '.rodata': + rodata_size = fields[2] + + cmd = [f'{self.toolchain.cross}size', fname] + size_result = command.run_one(*cmd, capture=True, + capture_stderr=True, + cwd=result.out_dir, + raise_on_error=False, env=env) + if size_result.stdout: + return size_result.stdout.splitlines()[1] + ' ' + rodata_size + return None + def _write_toolchain_result(self, result, done_file, build_dir, maybe_aborted, work_in_output): """Write build result and toolchain information @@ -724,41 +774,9 @@ class BuilderThread(threading.Thread): lines = [] for fname in BASE_ELF_FILENAMES: - cmd = [f'{self.toolchain.cross}nm', '--size-sort', fname] - nm_result = command.run_one(*cmd, capture=True, - capture_stderr=True, - cwd=result.out_dir, - raise_on_error=False, env=env) - if nm_result.stdout: - nm_fname = self.builder.get_func_sizes_file( - result.commit_upto, result.brd.target, fname) - with open(nm_fname, 'w', encoding='utf-8') as outf: - print(nm_result.stdout, end=' ', file=outf) - - cmd = [f'{self.toolchain.cross}objdump', '-h', fname] - dump_result = command.run_one(*cmd, capture=True, - capture_stderr=True, - cwd=result.out_dir, - raise_on_error=False, env=env) - rodata_size = '' - if dump_result.stdout: - objdump = self.builder.get_objdump_file(result.commit_upto, - result.brd.target, fname) - with open(objdump, 'w', encoding='utf-8') as outf: - print(dump_result.stdout, end=' ', file=outf) - for line in dump_result.stdout.splitlines(): - fields = line.split() - if len(fields) > 5 and fields[1] == '.rodata': - rodata_size = fields[2] - - cmd = [f'{self.toolchain.cross}size', fname] - size_result = command.run_one(*cmd, capture=True, - capture_stderr=True, - cwd=result.out_dir, - raise_on_error=False, env=env) - if size_result.stdout: - lines.append(size_result.stdout.splitlines()[1] + ' ' + - rodata_size) + line = self._process_elf_file(result, fname, env) + if line: + lines.append(line) # Extract the environment from U-Boot and dump it out cmd = [f'{self.toolchain.cross}objcopy', '-O', 'binary', From patchwork Mon Jan 5 18:30: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: 1280 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=1767637892; bh=+zLEeHrjvn0yRr1zeBrElqMOe+H7TbkulzXGh+/HZF4=; 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=qaS59BEwW5ZOqDOS2lv65Xmm4vxMlDUzdCrWhLfG1x/jfJXA/qxy7HZK/9s8dks0u kPBSLPnTBmCepSHB8QEx/Yd7kUPaIEpa5K9JffwElCUoaV+a9lCt9Ccvt947yvnfx5 uYa7KxjQhqVi/R2cPDWcrX8Q1sH/L6qjU9Kmu+8T+8dJRxGnkCv0nOYCzTCChEZJD2 GTzn0PPvVlYt37mts9DhnXtxryPMgzBoyZV2YvagTvNZkVFvKjZwXJYnV1QS0GjJeR XnZuEvFliyRXUo0SBybfwy57eqcDBn5jjo3YTkChQ1HtFc5rLtvvLRW8l67zR7pODC lMqpgA176INMQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D3F9C6911F for ; Mon, 5 Jan 2026 11:31: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 A5pQlSUTVWFk for ; Mon, 5 Jan 2026 11:31:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637892; bh=+zLEeHrjvn0yRr1zeBrElqMOe+H7TbkulzXGh+/HZF4=; 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=qaS59BEwW5ZOqDOS2lv65Xmm4vxMlDUzdCrWhLfG1x/jfJXA/qxy7HZK/9s8dks0u kPBSLPnTBmCepSHB8QEx/Yd7kUPaIEpa5K9JffwElCUoaV+a9lCt9Ccvt947yvnfx5 uYa7KxjQhqVi/R2cPDWcrX8Q1sH/L6qjU9Kmu+8T+8dJRxGnkCv0nOYCzTCChEZJD2 GTzn0PPvVlYt37mts9DhnXtxryPMgzBoyZV2YvagTvNZkVFvKjZwXJYnV1QS0GjJeR XnZuEvFliyRXUo0SBybfwy57eqcDBn5jjo3YTkChQ1HtFc5rLtvvLRW8l67zR7pODC lMqpgA176INMQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C17916911B for ; Mon, 5 Jan 2026 11:31:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637890; bh=kRvlZH2MJ04jzHqBWM8Rl23yNI3YFDsjil3x35VsIqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pvXy5vhVq0HGDVO9/XHSvpgNW7UGlNN4B1Hy0tEdzyWU4Xt9v0EooPwflX7XQLLmL uMzweC1TQulRBo9qh2KxplGi7eA8vI2of7Tu7ESH8gbNvv1Uw6zfzw2DerZ7jqLAia /SQmXcwK6Hxqaz5h/lDDiBrDUmpBv/ckyT/X/DXA/qbzNAO3Ss5RlrQFbTIV6CEAjn GeA9m1z5cNsU92wkZjchl8y1kBoLIqQPI9EeOlgxwsne8Hu5jAjdSPiUOSAwO6h8V4 kVaxFlR/p1tf1zcTGLD7MB3VtrvgQYMbd5/pd6jkT++/7CNoM0liXz66kLR4tFEJ02 QpN+gedoO9n5A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B82A16911C; Mon, 5 Jan 2026 11:31: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 10026) with ESMTP id E5oomjhCnU4h; Mon, 5 Jan 2026 11:31:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637886; bh=vqluGaOkDD2Ap72TJAqQ2w46KNEJtKlyL1yswkBv0zQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kLn2ZSOMuV7b1wLjKzuvb34wM4DfuHWaUJ755rktpVH1FbZX0jEJrVwQk8rybt09o 9baWXbBNSKcQydLH8HOWYMiVaURebGj9hOkSQUoHw4tuqiFFsggkE5bsC49yTxo6bQ spmt8frin+0Y9bZGL/+xu/FvgzGpM9a7nNmeQnMMhVh+qj9xS//XsDu3rXJqdH9r9D diAVyaX50z7oxj70QWVTEx99hN+8cncEASTNusdXRTNP4hYXgo0U4evSlDqDTfj92R S8NpRceMbpFwtGio/r+HKXB9+/jTZsT3RtgmIWoVS2lIy2qVGw/+bOab1cJKsprV/Z +EAXx86Rbmv0Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EE29F69112; Mon, 5 Jan 2026 11:31:25 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:25 -0700 Message-ID: <20260105183030.1487468-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: X24PUMEWI2YJ7RMQCNVLNFF7G56U2V2T X-Message-ID-Hash: X24PUMEWI2YJ7RMQCNVLNFF7G56U2V2T X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/11] buildman: Silence too-many-arguments 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 Many functions in builderthread have too many arguments, but it seems easier to keep it that way. Silence the warnings. Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index d5c8c6141eb..bcebae5f327 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -221,6 +221,7 @@ class BuilderThread(threading.Thread): toolchain: Toolchain object to use for building, or None if not yet selected """ + # pylint: disable=R0913 def __init__(self, builder, thread_num, mrproper, per_board_out_dir, test_exception=False): """Set up a new builder thread""" From patchwork Mon Jan 5 18:30: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: 1281 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=1767637896; bh=fo1cCj84DEJp5EVg1GcmB8PjG9hg0BXv4PorVkZhmsE=; 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=QRg0fN5ayW8yFpYCpfHN5b2NPm+Yf7G+FTvGOElJZiw0/hNfP5jiChBa12AyEyZ39 S/8y4ugidp59QTWgqjJkDiKNL7woelI7qQEC1FbRO7naHSMPdNggIHSuSW4EyY41vx 4kyqn75TUOmaEQqEwzmMWedErbXbCKshQdel+DSvzqPjLoEqgxbGMvErM88We/AwAR pMh9VNrxLiqDPPkOriyB4BUdexoCQ+biIi1rboppv11JLfe5u7IZOIujfCxf2/qvc3 K8I/Q+vs6piy5d/mhFUJYLCfTiOD41OewylKi5WMZn+Fzyk/qyQzcBRqnq4YgS8V/5 WCZYFEVbshVKA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4A7116911C for ; Mon, 5 Jan 2026 11:31: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 pGhjYm0jYhZb for ; Mon, 5 Jan 2026 11:31:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637896; bh=fo1cCj84DEJp5EVg1GcmB8PjG9hg0BXv4PorVkZhmsE=; 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=QRg0fN5ayW8yFpYCpfHN5b2NPm+Yf7G+FTvGOElJZiw0/hNfP5jiChBa12AyEyZ39 S/8y4ugidp59QTWgqjJkDiKNL7woelI7qQEC1FbRO7naHSMPdNggIHSuSW4EyY41vx 4kyqn75TUOmaEQqEwzmMWedErbXbCKshQdel+DSvzqPjLoEqgxbGMvErM88We/AwAR pMh9VNrxLiqDPPkOriyB4BUdexoCQ+biIi1rboppv11JLfe5u7IZOIujfCxf2/qvc3 K8I/Q+vs6piy5d/mhFUJYLCfTiOD41OewylKi5WMZn+Fzyk/qyQzcBRqnq4YgS8V/5 WCZYFEVbshVKA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 394F06911B for ; Mon, 5 Jan 2026 11:31:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637895; bh=SLDwYAYaFwYGTvwwTCYajzE3Cv9W7F5QHFlpgwKD454=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l3tEqRyMHVApAnvkGD5gHoELCajlcqAlDlRZ4Ei+1fvVrXkw98wdNzwboXefPdria KP79XtbZnRAaySVW7woBijWU6YmpGbPeSKuQafxhdazEKtDufWXeSKoygmcDlQptq7 3TwNE34YuFeTRLIhkeA57kaHllx6N0IEjGrflGsiRgeMoH6r4HE+NqrzsSpsGRstUd AJwMzy4yRQmDa4VUPqKb3ORXGMs56WysYlHgs0MlZ00Zw34pS/C8SIc7Uw1N1MMzYd glF9INsONWyZpuibqzuFXR9TBu80POIuclKgqIXaKhvm6ROW0D+Tze6Dh50skarEvV 2qbiOiDhLu68g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3853269112; Mon, 5 Jan 2026 11:31:35 -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 6Sp1MUyH48tn; Mon, 5 Jan 2026 11:31:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637890; bh=bVGD1Bqkzao8h/yjtjnSbEH99Xp9vi32qr/6TwuDU44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gfyVL6o2as2avE0NGHvTS5knfWVsRilSz/N287hNLtLPFcdqEb6geR29Qjk2e6uHw WmpF1F88WeHHAtIXF7NUujUrMzroTjpu65Zk1Qhd2xYAjFPqptcRM9DA4R7P7Jd8f6 zcuWqWl8GLpy34dfRUDcztxw+bqVfitK1zzmRH4AhtGuKjFa5q84lsgA83rfKLRePN Ygqg3u5Cyx0lk7vPwIjjojJEt8xd5dL1xz8sj5QT6hz/dva9RpJJAk9R9CJba+ts4J D83hyPqKy93G19jK5zErZYgmf53hAj7Mdz7xX8eOxaA2Maq9eyDpw3r04ToncN3B5T l25J3ayC2FtQA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9518369118; Mon, 5 Jan 2026 11:31:30 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:26 -0700 Message-ID: <20260105183030.1487468-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VHEV2VMK22RPTIZPZEVEJDPHQKENW4I3 X-Message-ID-Hash: VHEV2VMK22RPTIZPZEVEJDPHQKENW4I3 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 11/11] buildman: Fix return type documentation in builderthread.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 Update the return type documentation format in make() and run_commit() to satisfy pylint's missing-return-type-doc check. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index bcebae5f327..dee31972e4b 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -252,7 +252,7 @@ class BuilderThread(threading.Thread): command.run_one() Returns: - CommandResult object + CommandResult: Result of the make operation """ return self.builder.do_make(commit, brd, stage, cwd, *args, **kwargs) @@ -661,9 +661,9 @@ class BuilderThread(threading.Thread): showed failure Returns: - tuple containing: - - CommandResult object containing the results of the build - - boolean indicating whether 'make config' is still needed + tuple: + CommandResult: Results of the build + bool: Indicates whether 'make config' is still needed """ # Create a default result - it will be overwritte by the call to # self.make() below, in the event that we do a build.