Skip to contentSkip to conversation

meta/classes/meson.bbclass: Add inherit setuptools3

PATCH In review Aníbal Limón 4 participants 12 messages Dec 3, 2019 – Jan 8, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meta/classes/meson.bbclass: Add inherit setuptools3

Fixes,

...

| 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.

...

---
 meta/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/meson.bbclass +1 -1
index efa6234078..90868963b7 100644
@@ -1,4 +1,4 @@
-inherit siteinfo python3native
+inherit siteinfo python3native setuptools3
 
 DEPENDS_append = " meson-native ninja-native"
 
Signature · 1 line
2.24.0
#1 lore raw
Quoted 15 lines · Aníbal Limón

Fixes,

...
| 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.
...

I wonder if it’s better to add this inherit to waffle recipe alone I doubt that all meson using recipes are building python modules

Quoted 19 lines
---
 meta/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/meson.bbclass +1 -2
index efa6234078..90868963b7 100644
@@ -1,4 +1,4 @@
-inherit siteinfo python3native
+inherit siteinfo python3native setuptools3
 
 DEPENDS_append = " meson-native ninja-native"
 
--

2.24.0

#2 lore raw
Quoted 21 lines · Khem Raj
Quoted 15 lines · Aníbal Limón

Fixes,

...
| 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.
...

Quoted 3 lines

I wonder if it’s better to add this inherit to waffle recipe alone I doubt that all meson using recipes are building python modules

This issue is triggered from waffle [1] but the actual meson code looks for setuptools [2].

Anibal

[1] https://gitlab.freedesktop.org/mesa/waffle/blob/master/meson.build#L36
[2]
https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/python.py#L578

Quoted 21 lines
Quoted 21 lines
---
 meta/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/meson.bbclass +1 -2
index efa6234078..90868963b7 100644
@@ -1,4 +1,4 @@
-inherit siteinfo python3native
+inherit siteinfo python3native setuptools3
 
 DEPENDS_append = " meson-native ninja-native"
 
--

2.24.0

#3 lore raw

I tend to agree with Khem; this change will pull in target python as build and runtime dependency to all meson-using recipes, even those that have nothing to do with python.

I'd suggest you fix the broken recipes individually by adding python3 to DEPENDS. Yes, the "not a valid python" message is not helpful; suggestions how to improve this are welcome.

Alex

Quoted 60 lines · Anibal Limon
Quoted 21 lines · Khem Raj
Quoted 15 lines · Aníbal Limón

Fixes,

...
| 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.
...

Quoted 3 lines

I wonder if it’s better to add this inherit to waffle recipe alone I doubt that all meson using recipes are building python modules

This issue is triggered from waffle [1] but the actual meson code looks for setuptools [2].

Anibal

[1] https://gitlab.freedesktop.org/mesa/waffle/blob/master/meson.build#L36
[2]
https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/python.py#L578

Quoted 21 lines
Quoted 21 lines
---
 meta/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/meson.bbclass +1 -2
index efa6234078..90868963b7 100644
@@ -1,4 +1,4 @@
-inherit siteinfo python3native
+inherit siteinfo python3native setuptools3
 
 DEPENDS_append = " meson-native ninja-native"
 
--

2.24.0

#4 lore raw
Quoted 4 lines · Alexander Kanavin

I tend to agree with Khem; this change will pull in target python as build and runtime dependency to all meson-using recipes, even those that have nothing to do with python.

Ok, it depends on python3-setuptools-native I will add this inherit on waffle recipe.

Regards,
Anibal

Quoted 70 lines

I'd suggest you fix the broken recipes individually by adding python3 to DEPENDS. Yes, the "not a valid python" message is not helpful; suggestions how to improve this are welcome.

Alex

Quoted 61 lines · Anibal Limon
Quoted 21 lines · Khem Raj
Quoted 15 lines · Aníbal Limón

Fixes,

...
| 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.
...

Quoted 3 lines

I wonder if it’s better to add this inherit to waffle recipe alone I doubt that all meson using recipes are building python modules

This issue is triggered from waffle [1] but the actual meson code looks for setuptools [2].

Anibal

[1]
https://gitlab.freedesktop.org/mesa/waffle/blob/master/meson.build#L36
[2]
https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/python.py#L578

Quoted 21 lines
Quoted 21 lines
---
 meta/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/meson.bbclass +1 -2
index efa6234078..90868963b7 100644
@@ -1,4 +1,4 @@
-inherit siteinfo python3native
+inherit siteinfo python3native setuptools3
 
 DEPENDS_append = " meson-native ninja-native"
 
--

2.24.0

#5 lore raw
Quoted 5 lines · Anibal Limon

On Wed, 4 Dec 2019 at 04:20, Alexander Kanavin <[email protected]> wrote:

Quoted 8 lines
Quoted 4 lines

I tend to agree with Khem; this change will pull in target python as build and runtime dependency to all meson-using recipes, even those that have nothing to do with python.

Ok, it depends on python3-setuptools-native I will add this inherit on waffle recipe.

Do test this change; I believe you actually need a dependency on target python3.

Alex

Quoted 75 lines

Regards,
Anibal

Quoted 71 lines

I'd suggest you fix the broken recipes individually by adding python3 to DEPENDS. Yes, the "not a valid python" message is not helpful; suggestions how to improve this are welcome.

Alex

Quoted 61 lines · Anibal Limon
Quoted 21 lines · Khem Raj
Quoted 15 lines · Aníbal Limón

Fixes,

...
| 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.
...

Quoted 3 lines

I wonder if it’s better to add this inherit to waffle recipe alone I doubt that all meson using recipes are building python modules

This issue is triggered from waffle [1] but the actual meson code looks for setuptools [2].

Anibal

[1]
https://gitlab.freedesktop.org/mesa/waffle/blob/master/meson.build#L36
[2]
https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/python.py#L578

Quoted 21 lines
Quoted 21 lines
---
 meta/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/meson.bbclass +1 -2
index efa6234078..90868963b7 100644
@@ -1,4 +1,4 @@
-inherit siteinfo python3native
+inherit siteinfo python3native setuptools3
 
 DEPENDS_append = " meson-native ninja-native"
 
--

2.24.0

#6 lore raw
Quoted 12 lines · Alexander Kanavin

On Wed, 4 Dec 2019 at 19:35, Anibal Limon <[email protected] <mailto:[email protected]>> wrote:

On Wed, 4 Dec 2019 at 04:20, Alexander Kanavin <[email protected] <mailto:[email protected]>> wrote:

I tend to agree with Khem; this change will pull in target python as build and runtime dependency to all meson-using recipes, even those that have nothing to do with python.

Quoted 5 lines

Ok, it depends on python3-setuptools-native I will add this inherit on waffle recipe.

Do test this change; I believe you actually need a dependency on target python3.

I'd say that if the true dependency is just python3-setuptools-native, we can just add that to meson.bbclass as it's not really invasive. If it was a target dependency that is different of course.

Ross

#7 lore raw
Quoted 18 lines · Ross Burton
Quoted 17 lines · Alexander Kanavin

On Wed, 4 Dec 2019 at 19:35, Anibal Limon <[email protected] <mailto:[email protected]>> wrote:

On Wed, 4 Dec 2019 at 04:20, Alexander Kanavin <[email protected] <mailto:[email protected]>> wrote:

I tend to agree with Khem; this change will pull in target python as build and runtime dependency to all meson-using recipes, even those that have nothing to do with python.

Ok, it depends on python3-setuptools-native I will add this inherit on waffle recipe.

Quoted 6 lines
Quoted 2 lines

Do test this change; I believe you actually need a dependency on target python3.

I'd say that if the true dependency is just python3-setuptools-native, we can just add that to meson.bbclass as it's not really invasive. If it was a target dependency that is different of course.

I think so too late if meson is demanding for setup tools then it should be in meson bbclass I was thinking that it’s a outlier but seems not

Quoted 5 lines

Ross

#8 lore raw
In reply to Aníbal Limón
Quoted 3 lines · Aníbal Limón

+inherit siteinfo python3native setuptools3

DEPENDS_append = " meson-native ninja-native"

Considering setuptools3 inherits distutil3 which adds a load of tasks, shouldn't this just be a DEPENDS += python3-setuptools3-native?

Ross

#9 lore raw
Quoted 9 lines · Ross Burton
Quoted 3 lines · Aníbal Limón

+inherit siteinfo python3native setuptools3

DEPENDS_append = " meson-native ninja-native"

Considering setuptools3 inherits distutil3 which adds a load of tasks, shouldn't this just be a DEPENDS += python3-setuptools3-native?

right, we dont need the tasks so class is unnecessary

Quoted 1 line

Ross

#10 lore raw
In reply to Aníbal Limón
Quoted 9 lines · Aníbal Limón

Fixes,

...

| 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.

Going back to this...

Without this patch I get a different result:

Program python3 found: YES (/data/poky-tmp/master/work/corei7-64-poky-linux/waffle/1.6.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3) Run-time dependency threads found: YES
[ continues fine ]

So what is the meson-log.txt saying?

Ross

#11 lore raw
Quoted 19 lines · Ross Burton
Quoted 4 lines · Aníbal Limón

Fixes,

...
| 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)

Quoted 2 lines

|
| 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

Quoted 2 lines

|
| 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

Quoted 1 line

| WARNING: exit code 1 from a shell command.

Going back to this...

Without this patch I get a different result:

Quoted 8 lines

Program python3 found: YES

(/data/poky-tmp/master/work/corei7-64-poky-linux/waffle/1.6.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3) Run-time dependency threads found: YES
[ continues fine ]

So what is the meson-log.txt saying?

Hi,

I'm debugging this issue again and found the root cause that is missing _sysconfigdata module, in python3-native.bbclass is set (_PYTHON_SYSCONFIGDATA_NAME) and fails if no python3 isn't available so it relais on python3 target being added.

Reviewing python3 recipe _sysconfig_data thera are two possible fixes,

- Copy _sysconfig_data from /usr/lib/python-sysconfig to /usr/lib/pythonVER (I will go for this one)

...
+
+do_install_append_class-native() {
+ cp ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py
${D}/${libdir}/python${PYTHON_MAJMIN}
+}
+
...

- Find right _sysconfig_data in python3native.bbclass because the library name is based on os-machine.

Regards,
Anibal

Quoted 3 lines

Ross