From 3f49e50f7be2672bd5e56d28cd0cb195d6471154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Fri, 3 Oct 2025 22:32:10 +0000 Subject: [PATCH 1/2] scripts: list_boards: add fast path for --board flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Speed up the execution time of find_v2_boards() if the board name is already known and avoid call to rglob. This change both reduces memory used and also IO activity on the file system. On my machine I see the execution time drop from ~1.6 seconds to ~0.5 seconds. When sysbuild is enabled, the time savings are doubled. Signed-off-by: Guðni Már Gilbert --- scripts/list_boards.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/list_boards.py b/scripts/list_boards.py index b6c827e212334..6294417be01df 100755 --- a/scripts/list_boards.py +++ b/scripts/list_boards.py @@ -315,7 +315,21 @@ def find_v2_boards(args): board_files = [] if args.board_dir: board_files = [d / BOARD_YML for d in args.board_dir] - else: + elif args.board: + # Fast path for HWMv2: boards///board.yml + for root in unique_paths(args.board_roots): + boards_root = root / 'boards' + if not boards_root.is_dir(): + continue + for vendor_dir in boards_root.iterdir(): # boards/ + if not vendor_dir.is_dir(): + continue + board_yml = vendor_dir / args.board / BOARD_YML + if board_yml.is_file(): + board_files.append(board_yml) + break + + if not board_files: for root in unique_paths(args.board_roots): board_files.extend((root / 'boards').rglob(BOARD_YML)) From c74eba0f9d8505540d787c0c565f6b216a4b3227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Fri, 3 Oct 2025 23:53:29 +0000 Subject: [PATCH 2/2] tests: rename board native_sim_extend to native_sim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The board directory is expected to follow this convention: boards///board.yml This test is extending native_sim board and so the folder path should use 'native_sim' for and not 'native_sim_extend'. Signed-off-by: Guðni Már Gilbert --- .../boards/native/{native_sim_extend => native_sim}/Kconfig | 0 .../native/{native_sim_extend => native_sim}/Kconfig.defconfig | 0 .../boards/native/{native_sim_extend => native_sim}/board.yml | 0 .../native_sim_native_64_two.dts | 0 .../native_sim_native_64_two.yaml | 0 .../native_sim_native_64_two_defconfig | 0 .../{native_sim_extend => native_sim}/native_sim_native_one.dts | 0 .../{native_sim_extend => native_sim}/native_sim_native_one.yaml | 0 .../native_sim_native_one_defconfig | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename tests/cmake/hwm/board_extend/oot_root/boards/native/{native_sim_extend => native_sim}/Kconfig (100%) rename tests/cmake/hwm/board_extend/oot_root/boards/native/{native_sim_extend => native_sim}/Kconfig.defconfig (100%) rename tests/cmake/hwm/board_extend/oot_root/boards/native/{native_sim_extend => native_sim}/board.yml (100%) rename tests/cmake/hwm/board_extend/oot_root/boards/native/{native_sim_extend => native_sim}/native_sim_native_64_two.dts (100%) rename tests/cmake/hwm/board_extend/oot_root/boards/native/{native_sim_extend => native_sim}/native_sim_native_64_two.yaml (100%) rename tests/cmake/hwm/board_extend/oot_root/boards/native/{native_sim_extend => native_sim}/native_sim_native_64_two_defconfig (100%) rename tests/cmake/hwm/board_extend/oot_root/boards/native/{native_sim_extend => native_sim}/native_sim_native_one.dts (100%) rename tests/cmake/hwm/board_extend/oot_root/boards/native/{native_sim_extend => native_sim}/native_sim_native_one.yaml (100%) rename tests/cmake/hwm/board_extend/oot_root/boards/native/{native_sim_extend => native_sim}/native_sim_native_one_defconfig (100%) diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/Kconfig b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/Kconfig similarity index 100% rename from tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/Kconfig rename to tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/Kconfig diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/Kconfig.defconfig b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/Kconfig.defconfig similarity index 100% rename from tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/Kconfig.defconfig rename to tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/Kconfig.defconfig diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/board.yml b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/board.yml similarity index 100% rename from tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/board.yml rename to tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/board.yml diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_64_two.dts b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_64_two.dts similarity index 100% rename from tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_64_two.dts rename to tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_64_two.dts diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_64_two.yaml b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_64_two.yaml similarity index 100% rename from tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_64_two.yaml rename to tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_64_two.yaml diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_64_two_defconfig b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_64_two_defconfig similarity index 100% rename from tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_64_two_defconfig rename to tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_64_two_defconfig diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.dts b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_one.dts similarity index 100% rename from tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.dts rename to tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_one.dts diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.yaml b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_one.yaml similarity index 100% rename from tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.yaml rename to tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_one.yaml diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one_defconfig b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_one_defconfig similarity index 100% rename from tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one_defconfig rename to tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim/native_sim_native_one_defconfig