Today, there is a build target is added for each runner: flash, debug, debugserver, attach. And those runners will have a dependency to Zephyr logical target that is built before invoking `west <runner>`. This design has some flaws, mainly that additional dependencies directly on the target will not be built when running `west <runner>` directly. That generator expressions cannot be used for the DEPENDS argument. Instead, the build target `<runner>` will not have any dependencies, and will raise a build error if a dependency is added to the target. Due to how `add_dependencies()` work, this must be done as a build time check, and not configure time check. `west <runner>` will invoke a build before executing the runner, and this way ensure the build target is up-to-date, which again removes the need for a dedicated `west_<runner>_target`. It also minimizes the risk of developer errors, as developers no longer need to consider the need for adding additional dependencies. If a custom target is part of the default `all` build, then it's ensured to be up-to-date. Fixes: Issue reported on slack. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no> |
||
---|---|---|
.. | ||
completion | ||
runners | ||
tests | ||
boards.py | ||
build.py | ||
build_helpers.py | ||
completion.py | ||
debug.py | ||
export.py | ||
flash.py | ||
mypy.ini | ||
README.txt | ||
run_common.py | ||
run_tests.py | ||
sign.py | ||
zcmake.py | ||
zephyr_ext_common.py |
This directory contains implementations for west commands which are tightly coupled to the zephyr tree. This includes the build, flash, and debug commands. Before adding more here, consider whether you might want to put new extensions in upstream west. For example, any commands which operate on the multi-repo need to be in upstream west, not here. Try to limit what goes in here to Zephyr-specific features. When extending this code, please keep the unit tests (in tests/) up to date. The mypy static type checker is also run on the runners package. To run these tests locally on Windows, run: py -3 run_tests.py On macOS and Linux: ./run_tests.py Note that these tests are run as part of Zephyr's CI when submitting an upstream pull request, and pull requests which break the tests cannot be merged. Thanks!