Commit Graph

2 Commits

Author SHA1 Message Date
Marcin Niestroj 35c882d18f scripts: list_boards: handle boards dirs with subset of architectures
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>
2021-06-11 16:26:30 +02:00
Martí Bolívar 8bd6d08b0b scripts: add list_boards.py
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>
2021-01-15 15:07:49 -05:00