diff mbox series

[yocto-patches,meta-zephyr,master,6/9] zephyr-kernel-src.inc: Conditionally add python3-jsonschema-native

Message ID 20260307044353.1936182-7-sandeep.gundlupet-raju@amd.com
State New
Headers show
Series Update to v4.3.0 | expand

Commit Message

Gundlupet Raju, Sandeep March 7, 2026, 4:43 a.m. UTC
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 <module>
|       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 <sandeep.gundlupet-raju@amd.com>
---
 .../recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc       | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

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 ''} \
+    "