[Concept,00/11] buildman: Refactor control and builderthread

Message ID 20260105183030.1487468-1-sjg@u-boot.org
Headers
Series buildman: Refactor control and builderthread |

Message

Simon Glass Jan. 5, 2026, 6:30 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

This series refactors builderthread.py to improve code organisation and
reduce complexity. The main changes are:

- Fix pylint warnings in control.py and builderthread.py
- Document the toolchain member in BuilderThread
- Introduce RunRequest named tuple to group parameters that don't change
  during a job, reducing run_commit() from 11 to 7 parameters
- Split _config_and_build() into three methods: _setup_build(),
  _reconfig_if_needed(), and _build_and_get_result()
- Add BuildSetup named tuple for _setup_build() return value
- Extract _do_build() from run_commit()
- Extract _write_toolchain_result() and _process_elf_file() from
  _write_result()

These changes make the code easier to understand and maintain without
changing functionality.


Simon Glass (11):
  buildman: Fix pylint warnings in control.py
  buildman: Fix some pylint warnings in builderthread.py
  buildman: Document toolchain member in BuilderThread
  buildman: Add RunRequest named tuple for run_commit() parameters
  buildman: Split _config_and_build() into three methods
  buildman: Add BuildSetup named tuple for _setup_build() return value
  buildman: Extract _do_build() from run_commit()
  buildman: Extract _write_toolchain_result() from _write_result()
  buildman: Extract _process_elf_file() from _write_toolchain_result()
  buildman: Silence too-many-arguments warnings
  buildman: Fix return type documentation in builderthread.py

 tools/buildman/builderthread.py | 548 ++++++++++++++++++++------------
 tools/buildman/control.py       |  94 +++---
 2 files changed, 391 insertions(+), 251 deletions(-)