From patchwork Sun Mar 29 11:10:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2069 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=1774782715; bh=B7auIZB9W7myj6jwN8kMUlLY+mKxv3DTfUwqQMMKB+0=; 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=eLpP/uNBOW/pMinlZKjGCJgjxHwei/B8MsstNZnIhX5vPA5UDZHrP+Jd9AbkebrQW 8KxsBmvVENe84lQ9Erirt7lK9azZ3Kx7rtR5eGEpue9xAz+nUOP8aJLc1uke+lpcAy hG+dnoBlxqxGkIkHts21jV3vhNpUuQtgKJoXX0qln/PfDIrefE/BZP4ZxLZHh7lGll hzNnbu2YClEhH6ws6GfGQ3uQ2CPBMwy185b5kcMqD3tJZ8iChKLZhc/YvTK9AL6Bdw WVXvpOcC7YOhJfBLFa+xcS/8IEO3gLav8Lm+crga1CXwvvZVyMDMZLlyba0FMw4Ggp bVjYqBod58R9Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 26FD26A2D6 for ; Sun, 29 Mar 2026 05:11:55 -0600 (MDT) 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 WW6EuSmqbqqJ for ; Sun, 29 Mar 2026 05:11:55 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774782713; bh=B7auIZB9W7myj6jwN8kMUlLY+mKxv3DTfUwqQMMKB+0=; 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=KbCiNztrOA03MiXEK3oMe4V3ddKZj0T0bF2otK/YomOjgPLE6iBiR7LAy7Z4Iz797 eN64i6jkT1VlnHjeDWzpzxLWnM7IgShMtcKao5Ixf63DqbuLwdHfp5wfQ/dk6Fpzg/ VlpzUzPQ1inPKSEcDCavf0yv4vNkYBRpGOfD5mzsIpjm7XjM4SzcRaq0Mvl9drIJd9 pnqbHIu4Ebg5Tb/O23MfPOkF+M9bKiHZXVTsejM7BgAHu83W59lMwYVnAGX8Xt0hIn w8TC4meV8DF59S5KzvDzMT0chMA3P3ptS/5PVtRSo6O6076N8K/6ak+dBAV44Sk06W S2hfGwF71UJUQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 740056A2C5 for ; Sun, 29 Mar 2026 05:11:53 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774782709; bh=CZvYQkPYzLBCVIrJa3IfUSqqsgWWIDL+MlW9TlYL4HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bEFKo9l4Rm3HNRWefB52W2hsjRrIpEjo0+H6NaY4MrzWzmCYztCOrPaGvgyxBK71j 5zGkmd/JzlKwfMF0R5IijXrSWwe3ONiqWnRYb70wLHjnpOcDaTgHvDLGXMVi9ctXuP WIV4swskiiAOuKV0VKSua5VN50hy/FHGZRqXvQv/btDYKzdT+tjnvRzz8UDPYbUIDi r5V2fPA0XJc2HbtfP8PTeLW5yJzx1+FsaLNTwsBPbsJBTEtnSJLAgfMgkg91Zb6Dc5 Acz8g40oyOpIhM30aQ+ImZskXD/qh7Gc5frnUhk4e7sOkS4+uOnxPQMFdOJM9x9FXm Oh3EOVWVl/S6A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 659326A2BE; Sun, 29 Mar 2026 05:11:49 -0600 (MDT) 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 fycsByCjA_VC; Sun, 29 Mar 2026 05:11:49 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774782708; bh=4vHZ8apzn15MYEKYcYqxS/XRSdoHJP/MmdznnCRwWlU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O/C4uqFpffFTYsYrRxTJhiTBXW2B0y8BK7OKkd+f34I8n68rhwK/U5eAt1paq0p0a 3ge9qE46gxHB3h5p96w/5FBJWJ6Vl9f2Vo0pEsLJxVVR0RxNJINh8RIepfICWeclyx 8dsPJdfHcuvbI70iw7RrL0KxcAob0JL9HpQqusSeiMPgc0YuuJH0KKIp21aOCIaqHx BI0l2VEr7ndr1EsBE+/VlDeZB1mG871Q0ErUoORb42rAtHRWKJ0d55fi7f27oorJyD C+VV9AXO0ghKafdFDTRo6MwxK50NW0PQBzkMjZCJlg00VUH7ByCUbNUWkeQ4/8NyO1 IwgjIqXOGRrZw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B93916A2BC; Sun, 29 Mar 2026 05:11:48 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sun, 29 Mar 2026 05:10:31 -0600 Message-ID: <20260329111037.1352652-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260329111037.1352652-1-sjg@u-boot.org> References: <20260329111037.1352652-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: C7VDPIJ3HBTMJ7XE46GZ3KGHIMVIXQ36 X-Message-ID-Hash: C7VDPIJ3HBTMJ7XE46GZ3KGHIMVIXQ36 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 6/7] qconfig: Remove dead database-build code from move_config() 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 Now that -b uses do_build_db() and -s uses do_sync_defconfigs(), move_config() is only reached for -s -r (sync with git-ref). The build_db branch in Slot.poll(), do_add_to_db(), DatabaseThread, and the db_queue plumbing are all dead code in that path. Remove them, along with the now-unused queue and threading imports. Signed-off-by: Simon Glass --- tools/qconfig.py | 73 ++++++++---------------------------------------- 1 file changed, 12 insertions(+), 61 deletions(-) diff --git a/tools/qconfig.py b/tools/qconfig.py index c0215978319..443223cf9f4 100755 --- a/tools/qconfig.py +++ b/tools/qconfig.py @@ -18,13 +18,11 @@ import fnmatch import glob import multiprocessing import os -import queue import re import shutil import subprocess import sys import tempfile -import threading import time import unittest @@ -714,32 +712,6 @@ class KconfigParser: return arch -class DatabaseThread(threading.Thread): - """This thread processes results from Slot threads. - - It collects the data in the master config directary. There is only one - result thread, and this helps to serialise the build output. - """ - def __init__(self, config_db, db_queue): - """Set up a new result thread - - Args: - builder: Builder which will be sent each result - """ - threading.Thread.__init__(self) - self.config_db = config_db - self.db_queue= db_queue - - def run(self): - """Called to start up the result thread. - - We collect the next result job and pass it on to the build. - """ - while True: - defconfig, configs = self.db_queue.get() - self.config_db[defconfig] = configs - self.db_queue.task_done() - class Slot: @@ -751,19 +723,18 @@ class Slot: """ def __init__(self, toolchains, args, progress, devnull, make_cmd, - reference_src_dir, db_queue): + reference_src_dir): """Create a new process slot. Args: toolchains: Toolchains object containing toolchains. - args: Program arguments; this class uses build_db, verbose, + args: Program arguments; this class uses verbose, force_sync, dry_run, exit_on_error progress: A progress indicator. devnull: A file object of '/dev/null'. make_cmd: command name of GNU Make. reference_src_dir: Determine the true starting config state from this source tree. - db_queue: output queue to write config info for the database col (terminal.Color): Colour object """ self.toolchains = toolchains @@ -773,7 +744,6 @@ class Slot: self.devnull = devnull self.make_cmd = (make_cmd, 'O=' + self.build_dir) self.reference_src_dir = reference_src_dir - self.db_queue = db_queue self.col = progress.col self.parser = KconfigParser(self.build_dir) self.state = STATE_IDLE @@ -853,8 +823,6 @@ class Slot: if self.current_src_dir: self.current_src_dir = None self.do_defconfig() - elif self.args.build_db: - self.do_add_to_db() else: self.do_savedefconfig() elif self.state == STATE_SAVEDEFCONFIG: @@ -908,16 +876,6 @@ class Slot: cwd=self.current_src_dir) self.state = STATE_AUTOCONF - def do_add_to_db(self): - """Add the board to the database""" - configs = {} - for line in read_file(os.path.join(self.build_dir, AUTO_CONF_PATH)): - if line.startswith('CONFIG'): - config, value = line.split('=', 1) - configs[config] = value.rstrip() - self.db_queue.put([self.defconfig, configs]) - self.finish(True) - def do_savedefconfig(self): """Update the .config and run 'make savedefconfig'.""" if not self.args.force_sync: @@ -995,17 +953,16 @@ class Slot: class Slots: """Controller of the array of subprocess slots.""" - def __init__(self, toolchains, args, progress, reference_src_dir, db_queue): + def __init__(self, toolchains, args, progress, reference_src_dir): """Create a new slots controller. Args: toolchains (Toolchains): Toolchains object containing toolchains - args (Namespace): Program arguments; this class uses build_db, + args (Namespace): Program arguments; this class uses verbose, force_sync, dry_run, exit_on_error, jobs, progress (Progress): A progress indicator. reference_src_dir (str): Determine the true starting config state from this source tree (None for none) - db_queue (Queue): output queue to write config info for the database """ self.args = args self.slots = [] @@ -1015,7 +972,7 @@ class Slots: make_cmd = get_make_cmd() for _ in range(args.jobs): self.slots.append(Slot(toolchains, args, progress, devnull, - make_cmd, reference_src_dir, db_queue)) + make_cmd, reference_src_dir)) def add(self, defconfig): """Add a new subprocess if a vacant slot is found. @@ -1102,27 +1059,22 @@ class ReferenceSource: return self.src_dir def move_config(args): - """Build database or sync config options to defconfig files. + """Sync config options to defconfig files using make (legacy path). + + This is only used with -r (git-ref), which needs to build against a + different source tree. The normal -s path uses do_sync_defconfigs(). Args: - args (Namespace): Program arguments; this class uses build_db, + args (Namespace): Program arguments; this class uses verbose, force_sync, dry_run, exit_on_error, jobs, git_ref, defconfigs, defconfiglist, nocolour Returns: tuple: - config_db (dict of configs for each defconfig): - key: defconfig name, e.g. "MPC8548CDS_legacy_defconfig" - value: dict: - key: CONFIG option - value: Value of option + config_db (dict): Always empty (database build uses do_build_db()) Progress: Progress indicator """ config_db = {} - db_queue = queue.Queue() - dbt = DatabaseThread(config_db, db_queue) - dbt.daemon = True - dbt.start() check_clean_directory() bsettings.setup('') @@ -1148,7 +1100,7 @@ def move_config(args): col = terminal.Color(terminal.COLOR_NEVER if args.nocolour else terminal.COLOR_IF_TERMINAL) progress = Progress(col, len(defconfigs)) - slots = Slots(toolchains, args, progress, reference_src_dir, db_queue) + slots = Slots(toolchains, args, progress, reference_src_dir) # Main loop to process defconfig files: # Add a new subprocess into a vacant slot. @@ -1164,7 +1116,6 @@ def move_config(args): time.sleep(SLEEP_TIME) slots.write_failed_boards() - db_queue.join() progress.completed() return config_db, progress