meta/classes/menson.bbclass: Add python3 dependency

Submitted by Aníbal Limón on Jan. 9, 2020, 1:43 a.m. | Patch ID: 168724

Details

Message ID 20200109014307.37924-1-anibal.limon@linaro.org
State New
Headers show

Commit Message

Aníbal Limón Jan. 9, 2020, 1:43 a.m.
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

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
---
 meta/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index 5c0139f02a..203efaf8ed 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -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"

Comments

Alexander Kanavin Jan. 9, 2020, 11:22 a.m.
On Thu, 9 Jan 2020 at 02:43, Aníbal Limón <anibal.limon@linaro.org> wrote:

> -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
Aníbal Limón Jan. 9, 2020, 2:51 p.m.
On Thu, 9 Jan 2020 at 05:23, Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> On Thu, 9 Jan 2020 at 02:43, Aníbal Limón <anibal.limon@linaro.org> wrote:
>
>> -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.
>

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


>
> Alex
>