From patchwork Tue Jan 6 22:03:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1324 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737158; bh=RFhgl+QjJWMPgFqHcC/Htoiv5jBI3lJqEDhK5zU0qwg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=iEgVWMryfqsa86ndKNcPYHMit2DP/NLT4vyOj/bmYueDNTiG9sU6SGC+BNdTx+7nL OzsmozpQwyUxmA3maJPgV0m3V3MNKx+YiCgiwpbFU+YBgLeQVk7PYRo/MFNgifV3il kVTot+2Ca/tX6xzZ+ekXnImOs2lWf2E30jkhgNDtyVV6TlzM+yms8cDR3/o8vm+Y07 HltqJINLqhdQKmA65H79sks5R2jMoIyly1kDntGHSkjqRNMeUOEHS/kC5SfFpV/y7f io72u+vHf5eGnBO++DzW2FQ0Pmrdup13jcNMr/dmdTuqg9Yi5uhp/+GDIqSK0dnA1T KnlvGTqPwPkmg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DE87A6916C for ; Tue, 6 Jan 2026 15:05:58 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 6zJknsGEjqmT for ; Tue, 6 Jan 2026 15:05:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737158; bh=RFhgl+QjJWMPgFqHcC/Htoiv5jBI3lJqEDhK5zU0qwg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=iEgVWMryfqsa86ndKNcPYHMit2DP/NLT4vyOj/bmYueDNTiG9sU6SGC+BNdTx+7nL OzsmozpQwyUxmA3maJPgV0m3V3MNKx+YiCgiwpbFU+YBgLeQVk7PYRo/MFNgifV3il kVTot+2Ca/tX6xzZ+ekXnImOs2lWf2E30jkhgNDtyVV6TlzM+yms8cDR3/o8vm+Y07 HltqJINLqhdQKmA65H79sks5R2jMoIyly1kDntGHSkjqRNMeUOEHS/kC5SfFpV/y7f io72u+vHf5eGnBO++DzW2FQ0Pmrdup13jcNMr/dmdTuqg9Yi5uhp/+GDIqSK0dnA1T KnlvGTqPwPkmg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CD5EB69146 for ; Tue, 6 Jan 2026 15:05:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737157; bh=wCDSVyUReUSd32AQvhPYnngap7z03DzqV62maDOzGBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=abRdNbnQ8JG/te9KAXk+EDkWbKCcJlN4esWh/iYLL7P/G6gUFVTxUKrcJbaN/aGym 7DDOOrszR22GTNLeOz9q7DzZK0Tfm/jNdzOGlAl2HQC7sZ4SMZZB882Us3S1H5aPKN 1B9Yo9vlNw/4Nq1u4bL6i9MB2Fr3pnNQmWW21/ErscEhg36Tea/4x5z21NcO8HCwIn vwmKftC7zpQKaRwg9Sx4yPoh4/GEYb7fv2Ec64uSe6ayRf9ygIoDIPHCP549u/nFKU L8ZLrwmAOD1IFeSwBLoQaMOY43sq5+OsP9kV3srAIjI4HNNDW2oN4a1iO/5aybhlRQ Wplzm9ahrtL7g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0D2B35FF82; Tue, 6 Jan 2026 15:05:57 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id obH8eVXQ--yK; Tue, 6 Jan 2026 15:05:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767737152; bh=+5DiaqOWkMJM8PF3U1heobdwCdQ9vaTEg6JuTlosDW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B6egOYtbYDO3vQI8aXKG61zQSdnOaeh226Qn5Z0fwooz/QbFgbY0hnJAWkA9X5hGn qZmehbrKtyi4U/UJmIXkaB0YmcxjkPnh2rFJJYxWzyRLpfV1sAHr68AGWK7AcotYwG G6nNa8s9i0F11pDglWvI1aGF6Biyj7mF5xkEO2B5oW/cvZGRyL/uHdzo3xn1q/GnQw ZVson2HmLtwc6jW+/BZA1TNVDQibhMl8XQVYd5ORU3gcBUUx0Tlf4IgtUuSi9tpZSe SF5eBcj1spcyBHNbG4W8RwMyf6+dOIZ5kNQuym7nUSRdrIz8M6vzX0/LzGharickHK EiZIqWUI5UDhA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 93456690CB; Tue, 6 Jan 2026 15:05:52 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 15:03:39 -0700 Message-ID: <20260106220403.2915630-22-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260106220403.2915630-1-sjg@u-boot.org> References: <20260106220403.2915630-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: OPYLO7GUAILXBM4NN6EOULWKX46UBSBO X-Message-ID-Hash: OPYLO7GUAILXBM4NN6EOULWKX46UBSBO X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 21/29] buildman: Split out target loop in _show_config_changes() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Extract the per-target config calculation loop into _calc_config_changes() to improve readability and reduce complexity. Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/buildman/builder.py | 98 +++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 39 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index a632a6a6ade..723d65bc76d 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1532,6 +1532,62 @@ class Builder: environment_minus, environment_change) self._output_config_info(lines) + def _calc_config_changes(self, target, arch, config, arch_config_plus, + arch_config_minus, arch_config_change): + """Calculate configuration changes for a single target + + Args: + target (str): Target board name + arch (str): Architecture name + config (dict): Dict of config changes, keyed by board.target + arch_config_plus (dict): Dict to update with added configs by + arch + arch_config_minus (dict): Dict to update with removed configs by + arch + arch_config_change (dict): Dict to update with changed configs by + arch + + Returns: + str: Summary of config changes for this target + """ + all_config_plus = {} + all_config_minus = {} + all_config_change = {} + tbase = self._base_config[target] + tconfig = config[target] + lines = [] + for name in self.config_filenames: + if not tconfig.config[name]: + continue + config_plus = {} + config_minus = {} + config_change = {} + base = tbase.config[name] + for key, value in tconfig.config[name].items(): + if key not in base: + config_plus[key] = value + all_config_plus[key] = value + for key, value in base.items(): + if key not in tconfig.config[name]: + config_minus[key] = value + all_config_minus[key] = value + for key, value in base.items(): + new_value = tconfig.config.get(key) + if new_value and value != new_value: + desc = f'{value} -> {new_value}' + config_change[key] = desc + all_config_change[key] = desc + + arch_config_plus[arch][name].update(config_plus) + arch_config_minus[arch][name].update(config_minus) + arch_config_change[arch][name].update(config_change) + + self._add_config(lines, name, config_plus, config_minus, + config_change) + self._add_config(lines, 'all', all_config_plus, + all_config_minus, all_config_change) + return '\n'.join(lines) + def _show_config_changes(self, board_selected, board_dict, config): """Show changes in configuration @@ -1567,46 +1623,10 @@ class Builder: for target in board_dict: if target not in board_selected: continue - arch = board_selected[target].arch - - all_config_plus = {} - all_config_minus = {} - all_config_change = {} - tbase = self._base_config[target] - tconfig = config[target] - lines = [] - for name in self.config_filenames: - if not tconfig.config[name]: - continue - config_plus = {} - config_minus = {} - config_change = {} - base = tbase.config[name] - for key, value in tconfig.config[name].items(): - if key not in base: - config_plus[key] = value - all_config_plus[key] = value - for key, value in base.items(): - if key not in tconfig.config[name]: - config_minus[key] = value - all_config_minus[key] = value - for key, value in base.items(): - new_value = tconfig.config.get(key) - if new_value and value != new_value: - desc = f'{value} -> {new_value}' - config_change[key] = desc - all_config_change[key] = desc - - arch_config_plus[arch][name].update(config_plus) - arch_config_minus[arch][name].update(config_minus) - arch_config_change[arch][name].update(config_change) - - self._add_config(lines, name, config_plus, config_minus, - config_change) - self._add_config(lines, 'all', all_config_plus, - all_config_minus, all_config_change) - summary[target] = '\n'.join(lines) + summary[target] = self._calc_config_changes( + target, arch, config, arch_config_plus, arch_config_minus, + arch_config_change) lines_by_target = {} for target, lines in summary.items():