check_branch_conventions.py used a static 'AP_Compass:' example when a
commit message subject had no subsystem prefix. Add
BuildScriptBase.subsystem_for_commit(), which resolves a commit's changed
files through allowed_subsystems.py and returns the subsystem they share,
and name that subsystem in the suggestion instead. Fall back to the
static example when the files do not resolve to one subsystem.
Also reword the message so it is clear the missing prefix is on the git
commit message, not on the pull request title, and say how to amend it.
Working out the blacklist parses every ChibiOS hwdef, which takes a
third of a second, and both build_boards.py and
size_compare_branches.py did it while starting up whether or not the
run would build a bootloader.
Make it a property filled in on first use. All three places which
consult it already do so only for the bootloader vehicle, so a run
which does not build one now never parses a hwdef for this.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A board which takes another board's bootloader says so in its own
hwdef, so there is no need to name it in the blacklist as well; 23 of
the 42 entries were doing that, and each new such board had to be
added here by hand.
Read the directive with board_list's hwdef_for_board() rather than by
matching the hwdef text, so that undefs, overrides and includes are
handled the way the build handles them. This became affordable when
hwdef processing got faster: parsing all 443 ChibiOS hwdefs takes
0.33s, against the minutes or hours of building which follow.
Note that this deliberately does not treat a missing hwdef-bl.dat as
meaning a board has no bootloader. A board which needs one but is
missing one must fail, not be silently skipped, so those boards stay
listed explicitly.
The returned set is unchanged: 89 boards, the same 89 as before.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The loop which blacklists boards by HAL predates the addition of the
QURT HAL, so ModalAI-VOXL2 and ModalAI-VOXL3 were neither excluded by
HAL nor named in the explicit blacklist. A bootloader build task was
therefore generated for them, which fails; QURT has no bootloader and
no hwdef-bl.dat.
No QURT board was named in the explicit blacklist, so nothing is
removed from there.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
canzero and t3-gem-o1 are AP_HAL_Linux boards, not ChibiOS boards, so
they are already added to the bootloader blacklist by the loop which
excludes every board whose hal is Linux, ESP32 or SITL.
No functional change; the returned set is unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
test scripts / build (astyle-cleanliness) (push) Canceled after 0s
test scripts / build (check_autotest_options) (push) Canceled after 0s
test scripts / build (logger_metadata) (push) Canceled after 0s
test scripts / build (param-file-validation) (push) Canceled after 0s
test scripts / build (param_parse) (push) Canceled after 0s
test scripts / build (python-cleanliness) (push) Canceled after 0s
test scripts / build (shellcheck) (push) Canceled after 0s
test scripts / build (validate_board_list) (push) Canceled after 0s
size_compare_branches wrote its progress CSV to the hardcoded path
/tmp/some.csv; make the destination a command-line option, and write
no progress file at all when the option is not given. The write
helper lives in the shared base class, and build_boards gains the
same option, writing task counts, remaining tasks and failures as
builds complete (in both parallel and sequential modes).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add check_commit_subsystems() to check_branch_conventions.py, which uses
the allowed_subsystems library to verify, for every commit on the branch,
that:
- the declared subsystem prefix is an allowed subsystem (a libraries/
directory, a directory the commit creates, or a curated extra), and
- every file changed in the commit belongs to that subsystem.
When a file does not belong to the declared subsystem the error lists the
subsystem(s) it could be part of; when the prefix itself is unknown the
error suggests the closest allowed name ("did you mean ...?"). Revert and
fixup! commits are skipped (handled by the existing checks). This runs in
the existing test_branch_conventions.yml workflow; no CI configuration
change is required.
The generic git helpers get_added_paths_for_commit() and
created_library_dirs() live on BuildScriptBase so other build scripts can
reuse them. Register allowed_subsystems as a known-first-party module in
pyproject.toml so the new import sorts correctly under ruff/isort.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
this prevent linter to trigger on none existing progress_prefix on the base class
Child class will now have TypeError if they don't implement progress_prefix
mixing the progress with stdout is causing problems for tools trying to consume stdout:
[update.py]: feature EF: Running (arm-none-eabi-nm --demangle --print-size /home/autotest/build/tmp/binaries.build/ZeroOneX6_Air/bin/blimp) in (.) (ZeroOneX6_Air,Blimp) not in build_options.py
[update.py]: feature EF: Running (strings /home/autotest/build/tmp/binaries.build/ZeroOneX6_Air/bin/blimp) in (.) (ZeroOneX6_Air,Blimp) not in build_options.py
Create a base class for build scripts that provides common utilities extracted from size_compare_branches.py:
- run_program(): Execute commands with output handling
- run_waf(): Run waf with consistent build environment
- run_git(): Run git commands
- find_current_git_branch_or_sha1(): Get current branch/SHA
- find_git_branch_merge_base(): Find merge base
Refactor size_compare_branches.py to use the base class, reducing duplicated code.
Other scripts with similar patterns can be refactored in the future:
- build_binaries.py
- build_bootloaders.py
- build_iofirmware.py
- build_peripherals.py
- configure_all.py