meta/classes/menson.bbclass: Add python3 dependency
PATCH 1/1 meta/classes/menson.bbclass: Add python3 dependency
The python3native.bbclass set PYTHON_{LIBRARY, INCLUDE_DIR} pointing to python target build, a patch was add to use target _sysconfigdata too [1] but is not available without python3 dependency.
Fixes waffle build when trying to find _sysconfigdata module,
...
| Program python3 found: YES (/home/anibal.limon/linaro/oe-rpb-master/build-410c/tmp-rpb-glibc/work/aarch64-linaro-linux/waffle/1.6.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3) | | meson.build:36:0: ERROR: <ExternalProgram 'python3' -> ['/home/anibal.limon/linaro/oe-rpb-master/build-410c/tmp-rpb-glibc/work/aarch64-linaro-linux/waffle/1.6.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3']> is not a valid python or it is missing setuptools | | A full log can be found at /home/anibal.limon/linaro/oe-rpb-master/build-410c/tmp-rpb-glibc/work/aarch64-linaro-linux/waffle/1.6.0-r0/build/meson-logs/meson-log.txt | WARNING: exit code 1 from a shell command.
...
[1] http://git.openembedded.org/openembedded-core/commit/?id=02714c105426b0d687620913c1a7401b386428b6
--- meta/classes/meson.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/meson.bbclass +1 -1
@@ -1,6 +1,6 @@ inherit siteinfo python3native -DEPENDS_append = " meson-native ninja-native" +DEPENDS_append = " meson-native ninja-native python3" # As Meson enforces out-of-tree builds we can just use cleandirs B = "${WORKDIR}/build"
Signature · 1 line
2.24.1
meta/classes/meson.bbclass line 3
Quoted 3 lines · Aníbal Limón
meta/classes/meson.bbclass +1
-1-DEPENDS_append = " meson-native ninja-native" +DEPENDS_append = " meson-native ninja-native python3"
Apologies, but I cannot accept this. Not all meson-based components even ask for python, and this adds a non-trivial (built time wise) target dependency to them all. There is also the potential to create circular dependencies some time in the future if something required by target python switches over to meson.
I suggest you rather patch meson itself, so that the python probe implemented there does not import a target module.
Alex
Quoted 12 lines · Alexander Kanavin
meta/classes/meson.bbclass line 3
Quoted 3 lines · Aníbal Limón
meta/classes/meson.bbclass +1
-1-DEPENDS_append = " meson-native ninja-native" +DEPENDS_append = " meson-native ninja-native python3"Apologies, but I cannot accept this. Not all meson-based components even ask for python, and this adds a non-trivial (built time wise) target dependency to them all. There is also the potential to create circular dependencies some time in the future if something required by target python switches over to meson.
Quoted 3 lines
I suggest you rather patch meson itself, so that the python probe implemented there does not import a target module.
This issue comes from python3native.bbclass when use python target library and include dirs and set _sysconfigdata too.
...
export PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so" export PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
...
Menson python module uses it to get python interpreter information to build [1], I agree that not all recipes uses menson + python but it is a single point to patch.
I understand the implications of build time being increase so the other option is to add the dependency only on waffle.
Comments?
Regards,
Anibal
[1]
https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/python.py#L262
Quoted 3 lines
Alex