All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata
@ 2019-09-04 18:10 Khem Raj
  2019-09-04 18:10 ` [PATCH 2/2] python3native: export PYTHON_LIBRARY and PYTHON_INCLUDE_DIR Khem Raj
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Khem Raj @ 2019-09-04 18:10 UTC (permalink / raw)
  To: openembedded-core

packages can use

find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)

while we control PYTHON pointing to native py3 the libs and include
directories will then point to build host version, which can result in
unexpected combination and if we are lucky we get errors if its quite
different e.g. py2 libs/includes and py3 executable

This variable can be then used to export PYTHON_LIBRARY and
PYTHON_INCLUDE_DIR so that above find_packages can work correctly

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/conf/distro/include/tcmode-default.inc   | 3 +++
 meta/recipes-devtools/python/python3_3.7.4.bb | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
index 5c28386c4f..bcc5a14d4a 100644
--- a/meta/conf/distro/include/tcmode-default.inc
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -30,6 +30,9 @@ GOVERSION ?= "1.12%"
 # llvm version being used, so always bump it with llvm recipe version bump
 LLVMVERSION ?= "8.0.1"
 
+# This should be bumped when python3 recipe's MIN_VER is bumped e.g. 3.7 -> 3.8
+PYTHON_BINABI = "3.7m"
+
 PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
 PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
 PREFERRED_VERSION_gcc-cross-initial-${TARGET_ARCH} ?= "${GCCVERSION}"
diff --git a/meta/recipes-devtools/python/python3_3.7.4.bb b/meta/recipes-devtools/python/python3_3.7.4.bb
index 80c9b2919e..b2014e2bcf 100644
--- a/meta/recipes-devtools/python/python3_3.7.4.bb
+++ b/meta/recipes-devtools/python/python3_3.7.4.bb
@@ -47,7 +47,6 @@ UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
 CVE_PRODUCT = "python"
 
 PYTHON_MAJMIN = "3.7"
-PYTHON_BINABI = "${PYTHON_MAJMIN}m"
 
 S = "${WORKDIR}/Python-${PV}"
 
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] python3native: export PYTHON_LIBRARY and PYTHON_INCLUDE_DIR
  2019-09-04 18:10 [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata Khem Raj
@ 2019-09-04 18:10 ` Khem Raj
  2019-09-04 18:16   ` Alexander Kanavin
  2019-09-04 18:14 ` [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata Alexander Kanavin
  2019-09-04 18:49 ` Richard Purdie
  2 siblings, 1 reply; 9+ messages in thread
From: Khem Raj @ 2019-09-04 18:10 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/python3native.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/python3native.bbclass b/meta/classes/python3native.bbclass
index a3acaf61bb..b056378f69 100644
--- a/meta/classes/python3native.bbclass
+++ b/meta/classes/python3native.bbclass
@@ -9,6 +9,9 @@ DEPENDS_append = " python3-native "
 export STAGING_INCDIR
 export STAGING_LIBDIR
 
+export PYTHON_LIBRARY="${STAGING_LIBDIR}/${PYTHON_BINABI}"
+export PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_BINABI}"
+
 export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
 
 # suppress host user's site-packages dirs.
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata
  2019-09-04 18:10 [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata Khem Raj
  2019-09-04 18:10 ` [PATCH 2/2] python3native: export PYTHON_LIBRARY and PYTHON_INCLUDE_DIR Khem Raj
@ 2019-09-04 18:14 ` Alexander Kanavin
  2019-09-04 18:41   ` Khem Raj
  2019-09-04 18:50   ` Khem Raj
  2019-09-04 18:49 ` Richard Purdie
  2 siblings, 2 replies; 9+ messages in thread
From: Alexander Kanavin @ 2019-09-04 18:14 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

On Wed, 4 Sep 2019 at 20:10, Khem Raj <raj.khem@gmail.com> wrote:

>  # llvm version being used, so always bump it with llvm recipe version bump
>  LLVMVERSION ?= "8.0.1"
>
> +# This should be bumped when python3 recipe's MIN_VER is bumped e.g. 3.7
> -> 3.8
> +PYTHON_BINABI = "3.7m"
> +
>

This is already set in python3-dir.bbclass, so please use the values from
there.

Alex

[-- Attachment #2: Type: text/html, Size: 812 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] python3native: export PYTHON_LIBRARY and PYTHON_INCLUDE_DIR
  2019-09-04 18:10 ` [PATCH 2/2] python3native: export PYTHON_LIBRARY and PYTHON_INCLUDE_DIR Khem Raj
@ 2019-09-04 18:16   ` Alexander Kanavin
  2019-09-04 18:53     ` Khem Raj
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Kanavin @ 2019-09-04 18:16 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

On Wed, 4 Sep 2019 at 20:10, Khem Raj <raj.khem@gmail.com> wrote:

> +export PYTHON_LIBRARY="${STAGING_LIBDIR}/${PYTHON_BINABI}"
> +export PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_BINABI}
>

You need to explain why this is needed. Where are these variables used?

Also, python3-dir.bbclass already has all the needed settings, so please
use it.

Alex

[-- Attachment #2: Type: text/html, Size: 708 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata
  2019-09-04 18:14 ` [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata Alexander Kanavin
@ 2019-09-04 18:41   ` Khem Raj
  2019-09-04 18:50   ` Khem Raj
  1 sibling, 0 replies; 9+ messages in thread
From: Khem Raj @ 2019-09-04 18:41 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

On Wed, Sep 4, 2019 at 11:15 AM Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
>
> On Wed, 4 Sep 2019 at 20:10, Khem Raj <raj.khem@gmail.com> wrote:
>>
>>  # llvm version being used, so always bump it with llvm recipe version bump
>>  LLVMVERSION ?= "8.0.1"
>>
>> +# This should be bumped when python3 recipe's MIN_VER is bumped e.g. 3.7 -> 3.8
>> +PYTHON_BINABI = "3.7m"
>> +
>
>
> This is already set in python3-dir.bbclass, so please use the values from there.
>

hmm thanks somehow I missed it. I guess defining then in terms of the
values from python3-dir and python-dir should be good.

> Alex


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata
  2019-09-04 18:10 [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata Khem Raj
  2019-09-04 18:10 ` [PATCH 2/2] python3native: export PYTHON_LIBRARY and PYTHON_INCLUDE_DIR Khem Raj
  2019-09-04 18:14 ` [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata Alexander Kanavin
@ 2019-09-04 18:49 ` Richard Purdie
  2019-09-04 18:51   ` Khem Raj
  2 siblings, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2019-09-04 18:49 UTC (permalink / raw)
  To: Khem Raj, openembedded-core

On Wed, 2019-09-04 at 11:10 -0700, Khem Raj wrote:
> packages can use
> 
> find_package(PythonInterp REQUIRED)
> find_package(PythonLibs REQUIRED)
> 
> while we control PYTHON pointing to native py3 the libs and include
> directories will then point to build host version, which can result
> in
> unexpected combination and if we are lucky we get errors if its quite
> different e.g. py2 libs/includes and py3 executable
> 
> This variable can be then used to export PYTHON_LIBRARY and
> PYTHON_INCLUDE_DIR so that above find_packages can work correctly
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/conf/distro/include/tcmode-default.inc   | 3 +++
>  meta/recipes-devtools/python/python3_3.7.4.bb | 1 -
>  2 files changed, 3 insertions(+), 1 deletion(-)

Putting this into the global namespace seems like a really bad idea.
Can we not use a class like Alex mentions? I thought we already had
one?

Cheers,

Richard



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata
  2019-09-04 18:14 ` [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata Alexander Kanavin
  2019-09-04 18:41   ` Khem Raj
@ 2019-09-04 18:50   ` Khem Raj
  1 sibling, 0 replies; 9+ messages in thread
From: Khem Raj @ 2019-09-04 18:50 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

On Wed, Sep 4, 2019 at 11:15 AM Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
>
> On Wed, 4 Sep 2019 at 20:10, Khem Raj <raj.khem@gmail.com> wrote:
>>
>>  # llvm version being used, so always bump it with llvm recipe version bump
>>  LLVMVERSION ?= "8.0.1"
>>
>> +# This should be bumped when python3 recipe's MIN_VER is bumped e.g. 3.7 -> 3.8
>> +PYTHON_BINABI = "3.7m"
>> +
>
>
> This is already set in python3-dir.bbclass, so please use the values from there.
>

we can ignore this patch

> Alex


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata
  2019-09-04 18:49 ` Richard Purdie
@ 2019-09-04 18:51   ` Khem Raj
  0 siblings, 0 replies; 9+ messages in thread
From: Khem Raj @ 2019-09-04 18:51 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

On Wed, Sep 4, 2019 at 11:49 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Wed, 2019-09-04 at 11:10 -0700, Khem Raj wrote:
> > packages can use
> >
> > find_package(PythonInterp REQUIRED)
> > find_package(PythonLibs REQUIRED)
> >
> > while we control PYTHON pointing to native py3 the libs and include
> > directories will then point to build host version, which can result
> > in
> > unexpected combination and if we are lucky we get errors if its quite
> > different e.g. py2 libs/includes and py3 executable
> >
> > This variable can be then used to export PYTHON_LIBRARY and
> > PYTHON_INCLUDE_DIR so that above find_packages can work correctly
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> >  meta/conf/distro/include/tcmode-default.inc   | 3 +++
> >  meta/recipes-devtools/python/python3_3.7.4.bb | 1 -
> >  2 files changed, 3 insertions(+), 1 deletion(-)
>
> Putting this into the global namespace seems like a really bad idea.
> Can we not use a class like Alex mentions? I thought we already had
> one?
>

yeah I think we have what is needed to form the needed vars via PYTHON_DIR
I have sent a v2, this patch can be ignored

> Cheers,
>
> Richard
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] python3native: export PYTHON_LIBRARY and PYTHON_INCLUDE_DIR
  2019-09-04 18:16   ` Alexander Kanavin
@ 2019-09-04 18:53     ` Khem Raj
  0 siblings, 0 replies; 9+ messages in thread
From: Khem Raj @ 2019-09-04 18:53 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

On Wed, Sep 4, 2019 at 11:17 AM Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
>
> On Wed, 4 Sep 2019 at 20:10, Khem Raj <raj.khem@gmail.com> wrote:
>>
>> +export PYTHON_LIBRARY="${STAGING_LIBDIR}/${PYTHON_BINABI}"
>> +export PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_BINABI}
>
>
> You need to explain why this is needed. Where are these variables used?
>
> Also, python3-dir.bbclass already has all the needed settings, so please use it.
>

sent v2

> Alex


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-09-04 18:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-04 18:10 [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata Khem Raj
2019-09-04 18:10 ` [PATCH 2/2] python3native: export PYTHON_LIBRARY and PYTHON_INCLUDE_DIR Khem Raj
2019-09-04 18:16   ` Alexander Kanavin
2019-09-04 18:53     ` Khem Raj
2019-09-04 18:14 ` [PATCH 1/2] python3: Expose PYTHON_BINABI in global config metadata Alexander Kanavin
2019-09-04 18:41   ` Khem Raj
2019-09-04 18:50   ` Khem Raj
2019-09-04 18:49 ` Richard Purdie
2019-09-04 18:51   ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.