From patchwork Sat Jan 3 20:32:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1256 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=1767472419; bh=LHUoeZveE7MaeWpKTVcGpBcCBDUtsZ2ktA50tSF+5pE=; 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=pIIx5Mov5ie81q3VKjfhHFS5ggTJLUuqgHQcMiRtKJhEHU3RHXy7YxUuAfE0qjcwm UTaJEmZMBL3tfwOP1lmh5XMjYNmgKogxih0s/zo9CcO6P2F4GYE4LziFf6N/h3ANj4 xyCMBcMib5fEvF0nMsZ9WEyn09SgqulNWNqDke8D4n+7yubmf8UTMHBmDoYDZJFj8s l2CK3yO4iGqHqiNb/uaOEy4WDNdfWP/EKzLXl9b56TNe5+DsDS84gNVswvw3GD8sn1 ipTWqMV640KGKpByik+xvF8M1DMvYXlcnMv7qVRlHh6KsJbPKjanoHjTGC7+cfY0RG aqos0cc6P3mOg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 56A4E690C0 for ; Sat, 3 Jan 2026 13:33:39 -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 QktagOPPJc2g for ; Sat, 3 Jan 2026 13:33:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472419; bh=LHUoeZveE7MaeWpKTVcGpBcCBDUtsZ2ktA50tSF+5pE=; 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=pIIx5Mov5ie81q3VKjfhHFS5ggTJLUuqgHQcMiRtKJhEHU3RHXy7YxUuAfE0qjcwm UTaJEmZMBL3tfwOP1lmh5XMjYNmgKogxih0s/zo9CcO6P2F4GYE4LziFf6N/h3ANj4 xyCMBcMib5fEvF0nMsZ9WEyn09SgqulNWNqDke8D4n+7yubmf8UTMHBmDoYDZJFj8s l2CK3yO4iGqHqiNb/uaOEy4WDNdfWP/EKzLXl9b56TNe5+DsDS84gNVswvw3GD8sn1 ipTWqMV640KGKpByik+xvF8M1DMvYXlcnMv7qVRlHh6KsJbPKjanoHjTGC7+cfY0RG aqos0cc6P3mOg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 447D8690B2 for ; Sat, 3 Jan 2026 13:33:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472417; bh=65etRMyXyLPypVErrGtx6FhjPQz+abSlfdv4ZN1Ux2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NQ0MTliQH1nb2jxsR4iLO3t6YwHAWs34AxE8TuSp/qC0cEFRjjnbt7A0qzOUiHxpl KGSBKCF23XSzRvIiu1cvLbtOPB5CYHXP93Hq2DwzV0L8CEFsZVAQ6vqLC169ZoZN92 HkSOylxYPgkz5wOHRCn8mvOrodKh0aFPlQ8DbqzMjCgdbFLSMZUZnKSe3qeUFJJv/e MKaHh/BLBKO6IYnswN4dfpeblcIRuPFsc+2LZyrQce+BfupVxiPGXqVYBa6VYVwl5o lGF/4WUZ5eowji+iMqULTgE6NjJgvKhvDycd7NIvFKBn/v8OGvdwWyJDdw0br6GFuR Nd2+ZO9yaWh2w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9E99C68F35; Sat, 3 Jan 2026 13:33:37 -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 sgKYA2vNaidP; Sat, 3 Jan 2026 13:33:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767472413; bh=AY++wEfDd5cWRsBqw7lkSd04yLAJ0HBjy00BBUkTBqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pgxTHkxTAuotXJYIPWXk1JBYZj1QZwwWoDCiu1lHAemHvvJoj4hAJPjqEJOBLu4qw TTewOZHaiWH7X2rwXAfowyqmad7vpytDl7+YYDehVERfwJYYS017NH4sX6/22qagFU wTqC39SSzcVOPDwXrvs6TcqWIpzFK5g+bZZ3XfL3FIPgStuebQFhnIBjNE0Wfz6v/J VK0e0pe6GTDFQGoa+ydExm4z8/wAylfYXFZ3o41ip1tbKS7L2QQqrVlUsaoYVb6vX8 kGvnGzjP1vIRHszgrW/xGcAdksYk6Lt+Vo+ETosQFWmQImx31iIay21Z+ISK/9AZaU GDvvZsChdk9WA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 077B168FC8; Sat, 3 Jan 2026 13:33:32 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:32:35 -0700 Message-ID: <20260103203243.3727493-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103203243.3727493-1-sjg@u-boot.org> References: <20260103203243.3727493-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UCMRTPAWWGYZJDTT2ME6KZJOD2MQBJYD X-Message-ID-Hash: UCMRTPAWWGYZJDTT2ME6KZJOD2MQBJYD 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/12] buildman: Split _start_defconfig_scans() into two functions 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 Split the setup logic into _collect_defconfigs() for gathering defconfig file paths and _start_scanners() for spawning the parallel scan processes. This reduces complexity and eliminates the too-many-locals warning. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/boards.py | 60 ++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 36e9ba1f549..46e78b55809 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -785,25 +785,15 @@ class Boards: params_list.append(params) warnings.update(warn) - def scan_defconfigs(self, config_dir, srcdir, jobs=1, warn_targets=False): - """Collect board parameters for all defconfig files. - - This function invokes multiple processes for faster processing. + @staticmethod + def _collect_defconfigs(config_dir): + """Collect all defconfig files from a directory Args: config_dir (str): Directory containing the defconfig files - srcdir (str): Directory containing source code (Kconfig files) - jobs (int): The number of jobs to run simultaneously - warn_targets (bool): True to warn about missing or duplicate - CONFIG_TARGET options Returns: - tuple: - list of dict: List of board parameters, each a dict: - key: 'arch', 'cpu', 'soc', 'vendor', 'board', 'target', - 'config' - value: string value of the key - list of str: List of warnings recorded + list of str: Paths to all defconfig files found """ all_defconfigs = [] for (dirpath, _, filenames) in os.walk(config_dir): @@ -811,7 +801,23 @@ class Boards: if fnmatch.fnmatch(filename, '.*'): continue all_defconfigs.append(os.path.join(dirpath, filename)) + return all_defconfigs + + def _start_scanners(self, all_defconfigs, srcdir, jobs, warn_targets): + """Start parallel defconfig scanning processes + + Args: + all_defconfigs (list of str): Paths to defconfig files to scan + srcdir (str): Directory containing source code (Kconfig files) + jobs (int): The number of jobs to run simultaneously + warn_targets (bool): True to warn about missing or duplicate + CONFIG_TARGET options + Returns: + tuple: + list of Process: Running scanner processes + list of Queue: Queues for receiving results + """ total_boards = len(all_defconfigs) processes = [] queues = [] @@ -826,6 +832,32 @@ class Boards: processes.append(proc) queues.append(que) + return processes, queues + + def scan_defconfigs(self, config_dir, srcdir, jobs=1, warn_targets=False): + """Collect board parameters for all defconfig files. + + This function invokes multiple processes for faster processing. + + Args: + config_dir (str): Directory containing the defconfig files + srcdir (str): Directory containing source code (Kconfig files) + jobs (int): The number of jobs to run simultaneously + warn_targets (bool): True to warn about missing or duplicate + CONFIG_TARGET options + + Returns: + tuple: + list of dict: List of board parameters, each a dict: + key: 'arch', 'cpu', 'soc', 'vendor', 'board', 'target', + 'config' + value: string value of the key + list of str: List of warnings recorded + """ + all_defconfigs = self._collect_defconfigs(config_dir) + processes, queues = self._start_scanners(all_defconfigs, srcdir, jobs, + warn_targets) + # The resulting data should be accumulated to these lists params_list = [] warnings = set()