python3native, pythonnative: Separate definition and export of PYTHON_LIBRARY and PYTHON_INCLUDE_DIR

Submitted by Khem Raj on Sept. 9, 2019, 3:16 a.m. | Patch ID: 164766

Details

Message ID 20190909031607.1806186-1-raj.khem@gmail.com
State New
Headers show

Commit Message

Khem Raj Sept. 9, 2019, 3:16 a.m.
This helps recipes where they need to explicitly pass the variable and
does not entertain the ones from environment

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/python3native.bbclass | 6 ++++--
 meta/classes/pythonnative.bbclass  | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/python3native.bbclass b/meta/classes/python3native.bbclass
index d98fb4c758..bed04bd941 100644
--- a/meta/classes/python3native.bbclass
+++ b/meta/classes/python3native.bbclass
@@ -14,8 +14,8 @@  export STAGING_LIBDIR
 # find_package(PythonLibs REQUIRED)
 # which ends up using libs/includes from build host
 # Therefore pre-empt that effort
-export PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so"
-export PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
+PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so"
+PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
 
 export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
 
@@ -24,3 +24,5 @@  export PYTHONNOUSERSITE = "1"
 
 # autoconf macros will use their internal default preference otherwise
 export PYTHON
+export PYTHON_LIBRARY
+export PYTHON_INCLUDE_DIR
diff --git a/meta/classes/pythonnative.bbclass b/meta/classes/pythonnative.bbclass
index 0e9019d1e2..5fa42aaeff 100644
--- a/meta/classes/pythonnative.bbclass
+++ b/meta/classes/pythonnative.bbclass
@@ -17,11 +17,13 @@  export STAGING_LIBDIR
 # find_package(PythonLibs REQUIRED)
 # which ends up using libs/includes from build host
 # Therefore pre-empt that effort
-export PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so"
-export PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
+PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so"
+PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
 
 # suppress host user's site-packages dirs.
 export PYTHONNOUSERSITE = "1"
 
 # autoconf macros will use their internal default preference otherwise
 export PYTHON
+export PYTHON_LIBRARY
+export PYTHON_INCLUDE_DIR

Comments

Richard Purdie Sept. 9, 2019, 7:44 a.m.
On Sun, 2019-09-08 at 20:16 -0700, Khem Raj wrote:
> This helps recipes where they need to explicitly pass the variable
> and
> does not entertain the ones from environment
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/python3native.bbclass | 6 ++++--
>  meta/classes/pythonnative.bbclass  | 6 ++++--
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/classes/python3native.bbclass
> b/meta/classes/python3native.bbclass
> index d98fb4c758..bed04bd941 100644
> --- a/meta/classes/python3native.bbclass
> +++ b/meta/classes/python3native.bbclass
> @@ -14,8 +14,8 @@ export STAGING_LIBDIR
>  # find_package(PythonLibs REQUIRED)
>  # which ends up using libs/includes from build host
>  # Therefore pre-empt that effort
> -export
> PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so"
> -export
> PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
> +PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so"
> +PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
>  
>  export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
>  
> @@ -24,3 +24,5 @@ export PYTHONNOUSERSITE = "1"
>  
>  # autoconf macros will use their internal default preference
> otherwise
>  export PYTHON
> +export PYTHON_LIBRARY
> +export PYTHON_INCLUDE_DIR

I'm confused as this makes no difference to bitbake and is equivalent.
exported variables are always set in the datastore...

Cheers,

Richard
Khem Raj Sept. 9, 2019, 2:21 p.m.
On Mon, Sep 9, 2019 at 12:44 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Sun, 2019-09-08 at 20:16 -0700, Khem Raj wrote:
> > This helps recipes where they need to explicitly pass the variable
> > and
> > does not entertain the ones from environment
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> >  meta/classes/python3native.bbclass | 6 ++++--
> >  meta/classes/pythonnative.bbclass  | 6 ++++--
> >  2 files changed, 8 insertions(+), 4 deletions(-)
> >
> > diff --git a/meta/classes/python3native.bbclass
> > b/meta/classes/python3native.bbclass
> > index d98fb4c758..bed04bd941 100644
> > --- a/meta/classes/python3native.bbclass
> > +++ b/meta/classes/python3native.bbclass
> > @@ -14,8 +14,8 @@ export STAGING_LIBDIR
> >  # find_package(PythonLibs REQUIRED)
> >  # which ends up using libs/includes from build host
> >  # Therefore pre-empt that effort
> > -export
> > PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so"
> > -export
> > PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
> > +PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so"
> > +PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
> >
> >  export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
> >
> > @@ -24,3 +24,5 @@ export PYTHONNOUSERSITE = "1"
> >
> >  # autoconf macros will use their internal default preference
> > otherwise
> >  export PYTHON
> > +export PYTHON_LIBRARY
> > +export PYTHON_INCLUDE_DIR
>
> I'm confused as this makes no difference to bitbake and is equivalent.
> exported variables are always set in the datastore...
>

I was still seeing it unset on am ARM builder, I, however, did a
composite change where this change along with another change where
this was used went in together so I need to test this separately

second reeason was to make it adhere to same convention in the
bbclass like other variable e.g. PYTHON which inself could be reeason
good for this change even if it is a nop

> Cheers,
>
> Richard
>