Disables allowing the python argparse library from automatically
shortening command line arguments, this prevents issues whereby
a new command is added and code that wrongly uses the shortened
command of an existing argument which is the same as the new
command being added will silently change script behaviour.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Remove ZEPHYR_BASE as default root in list_boards.py.
This allows list_boards.py to be used to only print boards at given
root(s) without printing Zephyr default boards.
Secondly it remove the need in list_boards.py to have any knowledge of
ZEPHYR_BASE.
The `west boards` command already has ZEPHYR_BASE knowledge and can
easily add ZEPHYR_BASE to the list of roots it is already constructing,
thus removing the need for knowing that ZEPHYR_BASE is always added.
Update boards.cmake to pass ZEPHYR_BASE as an additional arch root, as
arch.cmake has not yet been processed,which means ZEPHYR_BASE is missing
in ARCH_ROOT list at this point in time.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Out-of-tree boards directory is likely to have boards within subset of
architectures (e.g. only 'arm' boards) that are supported by Zephyr.
Currently script iterates over all architectures and tries to list
contents of boards/<arch>/, which might not be existing. This results in
'FileNotFoundError' exception:
Traceback (most recent call last):
File "/project/zephyr/scripts/list_boards.py", line 113, in <module>
dump_boards(find_arch2boards(parse_args()))
File "/project/zephyr/scripts/list_boards.py", line 32, in \
find_arch2boards
arch2board_set = find_arch2board_set(args)
File "/project/zephyr/scripts/list_boards.py", line 45, in \
find_arch2board_set
for arch, boards in find_arch2board_set_in(root, arches).items():
File "/project/zephyr/scripts/list_boards.py", line 78, in \
find_arch2board_set_in
for maybe_board in (boards / arch).iterdir():
File "/usr/lib/python3.9/pathlib.py", line 1149, in iterdir
for name in self._accessor.listdir(self):
FileNotFoundError: [Errno 2] No such file or directory: \
'/project/app/boards/arc'
Simply ignore missing boards/<arch>/ directories and skip to the next
arch.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This script is essentially a Python rewrite of the CMake code we're
using to print boards in cmake/boards.cmake, plus some extra features.
Having this in Python will simplify some later adjustments to our
'usage' build system target in ways that will make its output easier
to read, while simultaneously making 'west boards' more useful.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>