From patchwork Sat Jan 10 20:08:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1432 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=1768075747; bh=57y0ytv7V94VnKlyHTvV1i1wY2S0fu8nMAO1lfuCc+8=; 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=wFR2lOSUJx7v75O77aqNhXblJZgQru0cC3dL1/ArCAlzy2HUSJjHaFFKUBeCgcjqc mtj3uQTiwymla60VN/gIjGvd2OLZQLH3Xu/Wld3AN07GhTQUzee0EHYJ+eCKe5xEYj qN32ULqJbP1Szb8kHETsj8GqWUYBlqIYdLeZRX4l1HMHu50aPGSrfEeYtpV8QWympp gJTDDHKelhjDiYCTvkHGeOLxq7n4/uVHagGFti54AC+YQF5wIEaJ0mK9MLyiTUkkMp +vXVpFafboNUKEQHBCkkXQtLO+nDhFm2aRewTvFnvojrwAH2CBlcGr8DmdjRbXjlSU fepr/znJWGU2A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C923369281 for ; Sat, 10 Jan 2026 13:09:07 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id wy3Cja9tLCC5 for ; Sat, 10 Jan 2026 13:09:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768075747; bh=57y0ytv7V94VnKlyHTvV1i1wY2S0fu8nMAO1lfuCc+8=; 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=wFR2lOSUJx7v75O77aqNhXblJZgQru0cC3dL1/ArCAlzy2HUSJjHaFFKUBeCgcjqc mtj3uQTiwymla60VN/gIjGvd2OLZQLH3Xu/Wld3AN07GhTQUzee0EHYJ+eCKe5xEYj qN32ULqJbP1Szb8kHETsj8GqWUYBlqIYdLeZRX4l1HMHu50aPGSrfEeYtpV8QWympp gJTDDHKelhjDiYCTvkHGeOLxq7n4/uVHagGFti54AC+YQF5wIEaJ0mK9MLyiTUkkMp +vXVpFafboNUKEQHBCkkXQtLO+nDhFm2aRewTvFnvojrwAH2CBlcGr8DmdjRbXjlSU fepr/znJWGU2A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B429C69275 for ; Sat, 10 Jan 2026 13:09:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768075746; bh=s5DuVxStfBo/z3YY7yg7gIyw+XNP7XyuHu4DC5z/Yyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mxv1YkjNZ8a4k6n4XeJ9EuTPXkfM7oUFg+pQ1Xw0usRU+FeYT58RCFDwKXmWaWBjZ Wx3beFXsXURTr8I+SnyuHsuU3LGBqXAA4ff+wEvfyHQL2bVLur91nnzd09kErwZtgh 76ngI5u7pFU33Sl3Bhb1vh3H48KczwOnW5QE5EZYzL2ebd/2NTw1EiAP7/GIQHWeb7 ADQ+ilAi6HvHOISNK1nf7c/k22pyumbPji7WPWEsAbxU4KrJ/7rgS9eEyDM6SLVN4y AO/TcLNY8G5q+zOK0vJCXt5p1J3YKIA74AB4xoa0SkyzRUwSXVf2lmG3H222toziGR 9PxZucIIqfSjg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A816C69275; Sat, 10 Jan 2026 13:09:06 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Qb0mk5gteMVf; Sat, 10 Jan 2026 13:09:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768075741; bh=zqJCaOrHGzikiwjqKVGBdyj4JPHDXtLEdmZVNZacV3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X/Q9wUr2LTL+xfnxvKPLWegz0nzkAs63KODKjCLLWMrXsqGOed0k8MGZWOSXovyns mi08Qz9BaH3tpd78KMyehmtZVMHiiUpuZGoRjy/cm0ZARZT9FZf76C26OE/fNqaZcI bRFp6vQ8aNWuLPuLbdvc8zGgSdGIEtRhvHiX1uiBdZO6rkx9GHLEzWeMDqZQbResUp X9bwf9dUBZRPLIeOgfjCG/ehduSaIgr/6EoaUP8nUUycAvv761yIYdTfQXJ86r2wlw lWbTmXNJ8eVby05pCvEjlFxLZkVDNwcgeO3r2+LJRrjcCC6T5UUby42kJlRT2+I0f4 zejGiXy51mF9A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B1FB6690E7; Sat, 10 Jan 2026 13:09:00 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 10 Jan 2026 13:08:07 -0700 Message-ID: <20260110200828.168672-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260110200828.168672-1-sjg@u-boot.org> References: <20260110200828.168672-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: I54GCWBMBMBCJQR3BCN6Z32BXHE525H4 X-Message-ID-Hash: I54GCWBMBMBCJQR3BCN6Z32BXHE525H4 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/18] buildman: Move Outcome class to its own module List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Extract the Outcome class from Builder to a new outcome.py module. This class records build outcomes (return code, errors, sizes, config, etc.) and is independent of the Builder class. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builder.py | 38 +++++--------------------------------- tools/buildman/outcome.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 tools/buildman/outcome.py diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 33ac9ab6e0a..94552bf62ca 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -21,6 +21,7 @@ import threading from buildman import builderthread from buildman.cfgutil import Config, process_config +from buildman.outcome import Outcome from u_boot_pylib import command from u_boot_pylib import gitutil from u_boot_pylib import terminal @@ -230,35 +231,6 @@ class Builder: _ide: Produce output suitable for an Integrated Development Environment i.e. don't emit progress information and put errors on stderr """ - class Outcome: - """Records a build outcome for a single make invocation - - Public Members: - rc: Outcome value (OUTCOME_...) - err_lines: List of error lines or [] if none - sizes: Dictionary of image size information, keyed by filename - - Each value is itself a dictionary containing - values for 'text', 'data' and 'bss', being the integer - size in bytes of each section. - func_sizes: Dictionary keyed by filename - e.g. 'u-boot'. Each - value is itself a dictionary: - key: function name - value: Size of function in bytes - config: Dictionary keyed by filename - e.g. '.config'. Each - value is itself a dictionary: - key: config name - value: config value - environment: Dictionary keyed by environment variable, Each - value is the value of environment variable. - """ - def __init__(self, rc, err_lines, sizes, func_sizes, config, - environment): - self.rc = rc - self.err_lines = err_lines - self.sizes = sizes - self.func_sizes = func_sizes - self.config = config - self.environment = environment def __init__(self, toolchains, base_dir, git_dir, num_threads, num_jobs, gnu_make='make', checkout=True, show_unknown=True, step=1, @@ -951,10 +923,10 @@ class Builder: fname = os.path.join(output_dir, 'uboot.env') environment = self._process_environment(fname) - return Builder.Outcome(rc, err_lines, sizes, func_sizes, config, + return Outcome(rc, err_lines, sizes, func_sizes, config, environment) - return Builder.Outcome(OUTCOME_UNKNOWN, [], {}, {}, {}, {}) + return Outcome(OUTCOME_UNKNOWN, [], {}, {}, {}, {}) @staticmethod def _add_line(lines_summary, lines_boards, line, brd): @@ -1027,7 +999,7 @@ class Builder: tuple: Tuple containing: Dict containing boards which built this commit: key: board.target - value: Builder.Outcome object + value: Outcome object List containing a summary of error lines Dict keyed by error line, containing a list of the Board objects with that error @@ -1135,7 +1107,7 @@ class Builder: """ self._base_board_dict = {} for brd in board_selected: - self._base_board_dict[brd] = Builder.Outcome(0, [], [], {}, {}, {}) + self._base_board_dict[brd] = Outcome(0, [], [], {}, {}, {}) self._base_err_lines = [] self._base_warn_lines = [] self._base_err_line_boards = {} diff --git a/tools/buildman/outcome.py b/tools/buildman/outcome.py new file mode 100644 index 00000000000..4f8bc9a0bae --- /dev/null +++ b/tools/buildman/outcome.py @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2013 The Chromium OS Authors. + +"""Outcome class for buildman build results""" + + +class Outcome: + """Records a build outcome for a single make invocation + + Public Members: + rc: Outcome value (OUTCOME_...) + err_lines: List of error lines or [] if none + sizes: Dictionary of image size information, keyed by filename + - Each value is itself a dictionary containing + values for 'text', 'data' and 'bss', being the integer + size in bytes of each section. + func_sizes: Dictionary keyed by filename - e.g. 'u-boot'. Each + value is itself a dictionary: + key: function name + value: Size of function in bytes + config: Dictionary keyed by filename - e.g. '.config'. Each + value is itself a dictionary: + key: config name + value: config value + environment: Dictionary keyed by environment variable, Each + value is the value of environment variable. + """ + def __init__(self, rc, err_lines, sizes, func_sizes, config, + environment): + self.rc = rc + self.err_lines = err_lines + self.sizes = sizes + self.func_sizes = func_sizes + self.config = config + self.environment = environment