From patchwork Sat Jan 10 20:08:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 96 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=1768075721; bh=Hjo6AWG1x8pTfSsd1s/Pz+bvlJj3TrsJ8DG/xjvsFjI=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=KMrJvu53FU4+P0PswCE0Jdq0cg6GozFpE/LLZLsdaD6ZmfvMP0gmzynej7FbYzMQV L7/lJYMaNoMN85FScdnn4n9dVGJcwKTUv7rrxOtOZbg5JYbseuj0n2RhYfmRxCa4I2 PSEWanWJW0x83K/1OEqQhj+lWR1FKWIJvjclcEr4UYx6WUjNRjoxkbkkn8OUIe6C39 lU47unGUZ0KUBBkLKhJiLx+1j5Rsk0EcNI43PAOJpufTmYgpP96wMiQbmhUpqVpb83 787m88nzfSG9hklZXdKWaUPe3ErQUaD9rjDtLwZ7YMNnTP112Y0W+pzfrHtPeV7lR7 NAVMjc8nJri2g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 64DFB69277 for ; Sat, 10 Jan 2026 13:08:41 -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 4ckF3OdkqpkU for ; Sat, 10 Jan 2026 13:08:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768075721; bh=Hjo6AWG1x8pTfSsd1s/Pz+bvlJj3TrsJ8DG/xjvsFjI=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=KMrJvu53FU4+P0PswCE0Jdq0cg6GozFpE/LLZLsdaD6ZmfvMP0gmzynej7FbYzMQV L7/lJYMaNoMN85FScdnn4n9dVGJcwKTUv7rrxOtOZbg5JYbseuj0n2RhYfmRxCa4I2 PSEWanWJW0x83K/1OEqQhj+lWR1FKWIJvjclcEr4UYx6WUjNRjoxkbkkn8OUIe6C39 lU47unGUZ0KUBBkLKhJiLx+1j5Rsk0EcNI43PAOJpufTmYgpP96wMiQbmhUpqVpb83 787m88nzfSG9hklZXdKWaUPe3ErQUaD9rjDtLwZ7YMNnTP112Y0W+pzfrHtPeV7lR7 NAVMjc8nJri2g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4E02169221 for ; Sat, 10 Jan 2026 13:08:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768075719; bh=VXuOqzVdbQVeWx5y6ShQw6LzvZptRTgbG5/nRY8ud0I=; h=From:To:Cc:Subject:Date:From; b=sJMFpvJwg7xDTv9vrUpU7y2DH68PrixFxrA45st5hoEY82Ry7Vm41+D3PfhHHcfY5 3iu6ezDDo3KY+MMX7cu20DUySJJeZM9OaeMOi4rEo18bbQ/5Koia4H7Wvr4HANrYMN aqEngxbJ/LIuX6BRMljXbVH6yZvFjdI/NKisOSr03RFnOUFBNm+xs+CemHSY27674E wihpXeobo/SpCA5WZebTCeJ6KICpnpnXsINwZt1jogzOxduO8jl0qjG36acJlPNL5S 65LRBrz4kPk3qeMm2b70LTqrZsg8xgBEDanN49PeeVeZO4REiKJtumKXKEl3VDmQR6 3AAxoZnz/6ihQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 32DF369221; Sat, 10 Jan 2026 13:08: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 10026) with ESMTP id HapsQDyWbbLD; Sat, 10 Jan 2026 13:08:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768075714; bh=rsNdELx1vmLXbFeBMQ82+UNaWt7MPOuyCASZHhIPWcM=; h=From:To:Cc:Subject:Date:From; b=kJr8iYkKLN00ehYCe52C/etZyZDjPOpvDmSmNk52em/JrPPyI3b1Wk2KeYIWXijIK 4GqPQsZTpzfjVLnwLXzPyubCDKW+L1Go4MGrgZ/b1KXL2o4JskkgtcF6xTNMCgBa0Y FiVUlalgjvd0ts+z9bmnO2Vww1glchUpU8u14Rp1igYieacHmE12zOzJJS8k8mngKD IzEUbmK5C5OHBeecBPyCIO2vIsfbkNQyM7j43X/IE5y6kul/jW7FVw0Q+67bKjm668 xCXI/NiTm+ogdXqXknA1G5yez9r2sYJyA6oTDkkkq7ESvoE9sC0eq0DZ3WAUoMfkM2 JKURA3/ASHowA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B4011690E7; Sat, 10 Jan 2026 13:08:34 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 10 Jan 2026 13:08:03 -0700 Message-ID: <20260110200828.168672-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: P2V4CASBBFXRD2LDT4GZHYPFPEUXT6T5 X-Message-ID-Hash: P2V4CASBBFXRD2LDT4GZHYPFPEUXT6T5 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 00/18] buildman: Split up the enormous Builder class 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 This series extracts the ~800 lines of result-display code from builder.py into a new ResultHandler class. Builder handles building and file I/O, while ResultHandler handles all display of build results, progress, errors, sizes, and config changes. This is a complex and tedious refactor which is why have not done it for the past 5 years, but the time is now. Along the way, this: - Creates a DisplayOptions namedtuple for result-display settings - Adds col (terminal.Color) as a required Builder parameter - Creates a ResultHandler class with all display-related methods - Cleans up naming conventions with underscore prefixes for private members After this series, builder.py is reduced from ~2200 to ~1200 lines, making it more focused and maintainable. Unsurprisingly resulthandler.py ends up at just over 1000 lines. Simon Glass (18): buildman: Move Config class to cfgutil buildman: Move process_config() function to cfgutil buildman: Move cfgutil tests to test_cfgutil.py buildman: Move Outcome class to its own module buildman: Move OUTCOME_* constants to outcome module buildman: Move BoardStatus and ErrLine to outcome module buildman: Add a namedtuple for result-display settings buildman: Add col parameter to Builder buildman: Create a class for handling results buildman: Move size-display methods to ResultHandler buildman: Move error/warning display methods to ResultHandler buildman: Move board classification methods to ResultHandler buildman: Move error delta calculation to ResultHandler buildman: Move result summary methods to ResultHandler buildman: Move print_build_summary() to ResultHandler buildman: Move show_summary() and produce_result_summary() to ResultHandler buildman: Use underscore prefix for private methods buildman: Use underscore prefix for private member variables tools/buildman/builder.py | 1230 +++---------------------------- tools/buildman/cfgutil.py | 70 +- tools/buildman/control.py | 35 +- tools/buildman/main.py | 5 +- tools/buildman/outcome.py | 68 ++ tools/buildman/resulthandler.py | 1028 ++++++++++++++++++++++++++ tools/buildman/test.py | 290 ++------ tools/buildman/test_builder.py | 155 ++-- tools/buildman/test_cfgutil.py | 234 ++++++ 9 files changed, 1655 insertions(+), 1460 deletions(-) create mode 100644 tools/buildman/outcome.py create mode 100644 tools/buildman/resulthandler.py create mode 100644 tools/buildman/test_cfgutil.py