commit | 761d3f95d198a6dde0af1d402a98feaaf7b02ea5 | [log] [tgz] |
---|---|---|
author | Rob Mohr <mohrr@google.com> | Tue Jan 03 18:59:35 2023 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Jan 03 18:59:35 2023 +0000 |
tree | c16da41af8600d8e84ca5bdb79ae771de25aa63a | |
parent | 1d8cc6f7cef513cd9b81f2d2ddd6a3512a3a194e [diff] |
pw_presubmit: Add substep support Add support for substeps to pw_presubmit. Steps can now define substeps which will be listed in the output of --only-list-steps and can be read by recipe code (or other automated tooling). Much of this logic is handled by the new SubStepCheck subclass of Check. Example --only-list-steps output is below. [ { "name": "gn_combined_build_check", "paths": [...], "substeps": [ "gn gen", "ninja stm32f429i_debug stm32f429i_size_optimized stm32f429i_speed_optimiz..." ] } ] Substeps can be run with a new '--substep' argument: 'pw presubmit --step <step> --substep <substep>'. The '--substep' argument is only valid when there is only one step. Running substeps out of order is not prevented. Step names are shown in the output as they are executed. $ pw presubmit --step gn_combined_build_check <...> 1/1 gn_combined_build_check 4 files 20221227 07:43:03 INF gn gen 20221227 07:43:07 INF ninja stm32f429i_debug stm32f429i_size_optimized stm32f429i_speed_optimiz... PASSED gn_combined_build_check 0:36.7 $ pw presubmit --step gn_combined_build_check --substep 'gn gen' <...> 1/1 gn_combined_build_check 4 files 20221227 07:43:03 INF gn gen PASSED gn_combined_build_check 0:03.9 Implement GnGenNinja subclass of SubStepCheck that has substeps for installing packages, running gn gen, and running ninja (possibly with a context manager). Since gn args sometime require details from the PresubmitContext, values can be expressed as a str or as a lambda that takes a PresubmitContext object. dir_pw_third_party_nanopb=lambda ctx: '"{}"'.format( ctx.package_root / 'nanopb' ) Convert the gn_combined_build_check and gn_nanopb_build presubmit checks to use GnGenNinja. (Other steps will follow.) Bug: b/253021172 Change-Id: If091f070edd76bb20b7ad9c19e888913fbf0c76e Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/125510 Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Wyatt Hepler <hepler@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.