From 6061deba555d148786ca2fd8193df7d6d6e1d0fc Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Mon, 7 Apr 2025 16:51:59 +1000 Subject: [PATCH] doc: gen_boards_catalog: fix crash for OOT boards Fix a crash when `list_boards.find_v2_boards` finds boards not under `ZEPHYR_BASE`. Signed-off-by: Jordan Yates --- doc/_scripts/gen_boards_catalog.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/_scripts/gen_boards_catalog.py b/doc/_scripts/gen_boards_catalog.py index 0c44f13412e..40b516a2a88 100755 --- a/doc/_scripts/gen_boards_catalog.py +++ b/doc/_scripts/gen_boards_catalog.py @@ -361,10 +361,15 @@ def get_catalog(generate_hw_features=False): except Exception as e: logger.error(f"Error parsing twister file {twister_file}: {e}") + if doc_page and doc_page.is_relative_to(ZEPHYR_BASE): + doc_page_path = doc_page.relative_to(ZEPHYR_BASE).as_posix() + else: + doc_page_path = None + board_catalog[board.name] = { "name": board.name, "full_name": full_name, - "doc_page": doc_page.relative_to(ZEPHYR_BASE).as_posix() if doc_page else None, + "doc_page": doc_page_path, "vendor": vendor, "archs": list(archs), "socs": list(socs),