From 8e83b7a4d760ca9d597a1b2d0cccd51bb44ce9a4 Mon Sep 17 00:00:00 2001 From: Sandeep Gundlupet Raju Date: Fri, 6 Mar 2026 21:43:50 -0700 Subject: [PATCH] zephyr-kernel-src.inc: Conditionally add python3-jsonschema-native python3-jsonschema-native is only required for Zephyr 4.3.0 and later to fix below errors. | DEBUG: Python function extend_recipe_sysroot finished | DEBUG: Executing shell function do_configure | Loading Zephyr default modules (Zephyr base (cached)). | -- Application: /scratch/sandeep/yocto/yp-master/build-zep/tmp/work/qemu-cortex-a9-zephyr/zephyr-helloworld/4.3.0+git/sources/zephyr-helloworld-4.3.0+git/zephyr/samples/hello_world | -- CMake version: 4.2.3 | -- Found Python3: /scratch/sandeep/yocto/yp-master/build-zep/tmp/work/qemu-cortex-a9-zephyr/zephyr-helloworld/4.3.0+git/recipe-sysroot-native/usr/bin/python3-native/python3 (found suitable version "3.14.3", minimum required is "3.10") found components: Interpreter | -- Cache files will be written to: /scratch/sandeep/yocto/yp-master/build-zep/tmp/work/qemu-cortex-a9-zephyr/zephyr-helloworld/4.3.0+git/build/.cache | -- Zephyr version: 4.3.0 (/scratch/sandeep/yocto/yp-master/build-zep/tmp/work/qemu-cortex-a9-zephyr/zephyr-helloworld/4.3.0+git/sources/zephyr-helloworld-4.3.0+git/zephyr) | CMake Error at /scratch/sandeep/yocto/yp-master/build-zep/tmp/work/qemu-cortex-a9-zephyr/zephyr-helloworld/4.3.0+git/sources/zephyr-helloworld-4.3.0+git/zephyr/cmake/modules/boards.cmake:195 (message): | Error finding board: qemu_cortex_a9 | | Error message: Traceback (most recent call last): | | File "/scratch/sandeep/yocto/yp-master/build-zep/tmp/work/qemu-cortex-a9-zephyr/zephyr-helloworld/4.3.0+git/sources/zephyr-helloworld-4.3.0+git/zephyr/scripts/list_boards.py", line 13, in | import jsonschema | | ModuleNotFoundError: No module named 'jsonschema' | | Call Stack (most recent call first): | /scratch/sandeep/yocto/yp-master/build-zep/tmp/work/qemu-cortex-a9-zephyr/zephyr-helloworld/4.3.0+git/sources/zephyr-helloworld-4.3.0+git/zephyr/cmake/modules/zephyr_default.cmake:131 (include) | /scratch/sandeep/yocto/yp-master/build-zep/tmp/work/qemu-cortex-a9-zephyr/zephyr-helloworld/4.3.0+git/sources/zephyr-helloworld-4.3.0+git/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include) | /scratch/sandeep/yocto/yp-master/build-zep/tmp/work/qemu-cortex-a9-zephyr/zephyr-helloworld/4.3.0+git/sources/zephyr-helloworld-4.3.0+git/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate) | CMakeLists.txt:5 (find_package) | | | -- Configuring incomplete, errors occurred! Use bb.utils.vercmp_string() to conditionally add it to DEPENDS based on the configured PREFERRED_VERSION_zephyr-kernel. Signed-off-by: Sandeep Gundlupet Raju Signed-off-by: Lee Chee Yang --- .../recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc index 34b2cbe..a1ee973 100644 --- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc +++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc @@ -11,3 +11,8 @@ inherit cmake FILESEXTRAPATHS:prepend := "${THISDIR}/files:" require recipes-kernel/zephyr-kernel/zephyr-kernel-src-${PREFERRED_VERSION_zephyr-kernel}.inc + +# python3-jsonschema-native is required starting from Zephyr 4.3.0 +DEPENDS += "\ + ${@'python3-jsonschema-native' if bb.utils.vercmp_string(d.getVar('PREFERRED_VERSION_zephyr-kernel'), '4.3.0') >= 0 else ''} \ + "