Patchwork boost: Convert ??= weaker assingment to weak ?= assignment

login
register
mail settings
Submitter Khem Raj
Date Dec. 7, 2013, 1:42 a.m.
Message ID <1386380546-13936-1-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/63007/
State New
Headers show

Comments

Khem Raj - Dec. 7, 2013, 1:42 a.m.
??= does not react at all with
BOOST_LIBS += "${@base_contains('PACKAGECONFIG', 'python', 'python', '', d)}"

even though we have

PACKAGECONFIG ??= "" it does not honor it and always add python to
BOOST_LIBS but the dependency is not added so it fails to build
complaining for missing python headers which is a understood outcome

When converted to ?= it works as expected and only add --with-python
in bjam when python is specified in PACKAGECONFIG otherwise not.

Is it a bitbake bug ? in anycase ?= should be enough of loose rope
to let user/distro configure the packageconfig policy

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-support/boost/boost.inc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Lukas Bulwahn - Dec. 8, 2013, 9:36 p.m.
Hi Khem,

On 12/07/2013 02:42 AM, Khem Raj wrote:
> ??= does not react at all with
> BOOST_LIBS += "${@base_contains('PACKAGECONFIG', 'python', 'python', '', d)}"
>
> even though we have
>
> PACKAGECONFIG ??= "" it does not honor it and always add python to
> BOOST_LIBS but the dependency is not added so it fails to build
> complaining for missing python headers which is a understood outcome
I tried bitbaking boost and all the recipes in the meta-ros layer (which 
uses boost heavily) with
1.) only the boost setup in OE-core and no boost.bbappend, and then also
2.) with a boost.bbappend with PACKAGECONFIG = "python" (as currently 
set in meta-ros).

However, I could not reproduce the problem you are reporting.
With the current state, everything works on my own machine.

I did the builds on fresh directories, and with the current HEADs:
BB_VERSION        = "1.21.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-18"
TARGET_SYS        = "x86_64-oe-linux"
MACHINE           = "qemux86-64"
DISTRO            = "nodistro"
DISTRO_VERSION    = "nodistro.0"
TUNE_FEATURES     = "m64"
TARGET_FPU        = ""
meta              = "master:4a562fd2614bb6ccce1222d47b9268d6980cf315"
meta-oe           = "master:9b3e284c58bce673801ca3649b53bc53797ce2e9"

and my bitbake repository is at 73ddf1a3d1c516ad3bc785e0413483e616ce07a8.

What's your configuration and how does it differs from mine?

Lukas
Richard Purdie - Dec. 9, 2013, 11:48 a.m.
On Fri, 2013-12-06 at 17:42 -0800, Khem Raj wrote:
> ??= does not react at all with
> BOOST_LIBS += "${@base_contains('PACKAGECONFIG', 'python', 'python', '', d)}"
> 
> even though we have
> 
> PACKAGECONFIG ??= "" it does not honor it and always add python to
> BOOST_LIBS but the dependency is not added so it fails to build
> complaining for missing python headers which is a understood outcome
> 
> When converted to ?= it works as expected and only add --with-python
> in bjam when python is specified in PACKAGECONFIG otherwise not.
> 
> Is it a bitbake bug ? in anycase ?= should be enough of loose rope
> to let user/distro configure the packageconfig policy
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-support/boost/boost.inc |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This needs more investigation as there is something missing from the
description above.

To illustrate why I'm struggling to follow this, "bitbake boost -e |
grep BOOST_LIBS" on OE-Core does not show python in the list...

Cheers,

Richard
Khem Raj - Dec. 9, 2013, 5:34 p.m.
On Mon, Dec 9, 2013 at 3:48 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> To illustrate why I'm struggling to follow this, "bitbake boost -e |
> grep BOOST_LIBS" on OE-Core does not show python in the list...
>


I can see it. Its on debian python is 2.7.3

kraj@builder:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"
Richard Purdie - Dec. 9, 2013, 9:51 p.m.
On Mon, 2013-12-09 at 09:34 -0800, Khem Raj wrote:
> On Mon, Dec 9, 2013 at 3:48 AM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> >
> > To illustrate why I'm struggling to follow this, "bitbake boost -e |
> > grep BOOST_LIBS" on OE-Core does not show python in the list...
> >
> 
> 
> I can see it. Its on debian python is 2.7.3
> 
> kraj@builder:~$ cat /etc/os-release
> PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
> NAME="Debian GNU/Linux"
> VERSION_ID="7"
> VERSION="7 (wheezy)"
> ID=debian
> ANSI_COLOR="1;31"
> HOME_URL="http://www.debian.org/"
> SUPPORT_URL="http://www.debian.org/support/"
> BUG_REPORT_URL="http://bugs.debian.org/"

I doubt its host OS that is causing this, more likely something to do
with the configuration you have (I'm using python 2.7.5+ on Ubuntu
13.10). Which DISTRO is this? Which layers are enabled? Which version of
bitbake?

What does the history of PACKAGECONFIG show in bitbake boost -e?

Cheers,

Richard
Khem Raj - Dec. 9, 2013, 11:11 p.m.
On Mon, Dec 9, 2013 at 1:51 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Mon, 2013-12-09 at 09:34 -0800, Khem Raj wrote:
>> On Mon, Dec 9, 2013 at 3:48 AM, Richard Purdie
>> <richard.purdie@linuxfoundation.org> wrote:
>> >
>> > To illustrate why I'm struggling to follow this, "bitbake boost -e |
>> > grep BOOST_LIBS" on OE-Core does not show python in the list...
>> >
>>
>>
>> I can see it. Its on debian python is 2.7.3
>>
>> kraj@builder:~$ cat /etc/os-release
>> PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
>> NAME="Debian GNU/Linux"
>> VERSION_ID="7"
>> VERSION="7 (wheezy)"
>> ID=debian
>> ANSI_COLOR="1;31"
>> HOME_URL="http://www.debian.org/"
>> SUPPORT_URL="http://www.debian.org/support/"
>> BUG_REPORT_URL="http://bugs.debian.org/"
>
> I doubt its host OS that is causing this, more likely something to do
> with the configuration you have (I'm using python 2.7.5+ on Ubuntu
> 13.10). Which DISTRO is this? Which layers are enabled? Which version of
> bitbake?
>

all is latest from yesterday config wise I am building angstrom. now I did both
with angstrom and with OE-Core only and you are right it appears to
work with OE-Core alone

see

http://paste.ubuntu.com/6548349/

for angstrom version see

http://paste.ubuntu.com/6548360/


I will dig more into it a bit and see how PACKAGECONFIG can be bad in
angstrom's case

> What does the history of PACKAGECONFIG show in bitbake boost -e?
>
> Cheers,
>
> Richard
>
>
>
Richard Purdie - Dec. 10, 2013, 10:32 a.m.
On Mon, 2013-12-09 at 15:11 -0800, Khem Raj wrote:
> On Mon, Dec 9, 2013 at 1:51 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Mon, 2013-12-09 at 09:34 -0800, Khem Raj wrote:
> >> On Mon, Dec 9, 2013 at 3:48 AM, Richard Purdie
> >> <richard.purdie@linuxfoundation.org> wrote:
> >> >
> >> > To illustrate why I'm struggling to follow this, "bitbake boost -e |
> >> > grep BOOST_LIBS" on OE-Core does not show python in the list...
> >> >
> >>
> >>
> >> I can see it. Its on debian python is 2.7.3
> >>
> >> kraj@builder:~$ cat /etc/os-release
> >> PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
> >> NAME="Debian GNU/Linux"
> >> VERSION_ID="7"
> >> VERSION="7 (wheezy)"
> >> ID=debian
> >> ANSI_COLOR="1;31"
> >> HOME_URL="http://www.debian.org/"
> >> SUPPORT_URL="http://www.debian.org/support/"
> >> BUG_REPORT_URL="http://bugs.debian.org/"
> >
> > I doubt its host OS that is causing this, more likely something to do
> > with the configuration you have (I'm using python 2.7.5+ on Ubuntu
> > 13.10). Which DISTRO is this? Which layers are enabled? Which version of
> > bitbake?
> >
> 
> all is latest from yesterday config wise I am building angstrom. now I did both
> with angstrom and with OE-Core only and you are right it appears to
> work with OE-Core alone
> 
> see
> 
> http://paste.ubuntu.com/6548349/
> 
> for angstrom version see
> 
> http://paste.ubuntu.com/6548360/
> 
> 
> I will dig more into it a bit and see how PACKAGECONFIG can be bad in
> angstrom's case

Looking at those pastebins, it shows up as a python function since the
"python" flag is set. That shouldn't do anything too bad to the variable
though:

python PACKAGECONFIG () {
}

In one case it has the value python, in the other it does not. Its all
very odd. I wonder if "bitbake -e" shows it taking any value? There has
to be something in the Angstrom setup which is triggering this...

Cheers,

Richard
Khem Raj - Jan. 23, 2014, 1:16 a.m.
On Friday, December 06, 2013 05:42:26 PM Khem Raj wrote:
> ??= does not react at all with
> BOOST_LIBS += "${@base_contains('PACKAGECONFIG', 'python', 'python', '',
> d)}"
> 
> even though we have
> 
> PACKAGECONFIG ??= "" it does not honor it and always add python to
> BOOST_LIBS but the dependency is not added so it fails to build
> complaining for missing python headers which is a understood outcome
> 
> When converted to ?= it works as expected and only add --with-python
> in bjam when python is specified in PACKAGECONFIG otherwise not.
> 
> Is it a bitbake bug ? in anycase ?= should be enough of loose rope
> to let user/distro configure the packageconfig policy
>

OK so the problem is that I have meta-ros in my layer-mix and in that layer
it defines PACKAGECONFIG ?= "python" IMO it should have appended instead of
redefining. Thats why I was seeing what I was seeing. 
 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-support/boost/boost.inc |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-support/boost/boost.inc
> b/meta/recipes-support/boost/boost.inc index f13051c..f0f9eb8 100644
> --- a/meta/recipes-support/boost/boost.inc
> +++ b/meta/recipes-support/boost/boost.inc
> @@ -19,7 +19,7 @@ BOOST_LIBS = "\
>  	"
> 
>  # optional boost-python library
> -PACKAGECONFIG ??= ""
> +PACKAGECONFIG ?= ""
>  PACKAGECONFIG[python] = ",,python"
>  BOOST_LIBS += "${@base_contains('PACKAGECONFIG', 'python', 'python', '',
> d)}" inherit python-dir
Chris Larson - Jan. 23, 2014, 4:31 p.m.
On Wed, Jan 22, 2014 at 6:16 PM, Khem Raj <raj.khem@gmail.com> wrote:

> On Friday, December 06, 2013 05:42:26 PM Khem Raj wrote:
> > ??= does not react at all with
> > BOOST_LIBS += "${@base_contains('PACKAGECONFIG', 'python', 'python', '',
> > d)}"
> >
> > even though we have
> >
> > PACKAGECONFIG ??= "" it does not honor it and always add python to
> > BOOST_LIBS but the dependency is not added so it fails to build
> > complaining for missing python headers which is a understood outcome
> >
> > When converted to ?= it works as expected and only add --with-python
> > in bjam when python is specified in PACKAGECONFIG otherwise not.
> >
> > Is it a bitbake bug ? in anycase ?= should be enough of loose rope
> > to let user/distro configure the packageconfig policy
> >
>
> OK so the problem is that I have meta-ros in my layer-mix and in that layer
> it defines PACKAGECONFIG ?= "python" IMO it should have appended instead of
> redefining. Thats why I was seeing what I was seeing.


It's worth noting that recipes, in general, should use ?= rather than ??=,
but config files, in general, should use ??=. Otherwise it becomes
impossible for the config metadata to define an overriding default -- the
last ??= wins, after all, and that would always be the recipe. IMO default
values in the recipe are there to give sane behavior when there's no
configuration coming in from elsewhere, not to override configuration
defaults.
Khem Raj - Jan. 23, 2014, 4:43 p.m.
On Thursday, January 23, 2014 09:31:47 AM Chris Larson wrote:
> On Wed, Jan 22, 2014 at 6:16 PM, Khem Raj <raj.khem@gmail.com> wrote:
> > On Friday, December 06, 2013 05:42:26 PM Khem Raj wrote:
> > > ??= does not react at all with
> > > BOOST_LIBS += "${@base_contains('PACKAGECONFIG', 'python', 'python', '',
> > > d)}"
> > > 
> > > even though we have
> > > 
> > > PACKAGECONFIG ??= "" it does not honor it and always add python to
> > > BOOST_LIBS but the dependency is not added so it fails to build
> > > complaining for missing python headers which is a understood outcome
> > > 
> > > When converted to ?= it works as expected and only add --with-python
> > > in bjam when python is specified in PACKAGECONFIG otherwise not.
> > > 
> > > Is it a bitbake bug ? in anycase ?= should be enough of loose rope
> > > to let user/distro configure the packageconfig policy
> > 
> > OK so the problem is that I have meta-ros in my layer-mix and in that
> > layer
> > it defines PACKAGECONFIG ?= "python" IMO it should have appended instead
> > of
> > redefining. Thats why I was seeing what I was seeing.
> 
> It's worth noting that recipes, in general, should use ?= rather than ??=,
> but config files, in general, should use ??=. Otherwise it becomes
> impossible for the config metadata to define an overriding default -- the
> last ??= wins, after all, and that would always be the recipe. IMO default
> values in the recipe are there to give sane behavior when there's no
> configuration coming in from elsewhere, not to override configuration
> defaults.

yes I think thats a good point. so lets consider this patch for inclusion
now we know the reason, I can resubmit with proper subject and patch header
Richard Purdie - Jan. 28, 2014, 12:31 p.m.
On Thu, 2014-01-23 at 08:43 -0800, Khem Raj wrote:
> On Thursday, January 23, 2014 09:31:47 AM Chris Larson wrote:
> > On Wed, Jan 22, 2014 at 6:16 PM, Khem Raj <raj.khem@gmail.com> wrote:
> > > On Friday, December 06, 2013 05:42:26 PM Khem Raj wrote:
> > > > ??= does not react at all with
> > > > BOOST_LIBS += "${@base_contains('PACKAGECONFIG', 'python', 'python', '',
> > > > d)}"
> > > > 
> > > > even though we have
> > > > 
> > > > PACKAGECONFIG ??= "" it does not honor it and always add python to
> > > > BOOST_LIBS but the dependency is not added so it fails to build
> > > > complaining for missing python headers which is a understood outcome
> > > > 
> > > > When converted to ?= it works as expected and only add --with-python
> > > > in bjam when python is specified in PACKAGECONFIG otherwise not.
> > > > 
> > > > Is it a bitbake bug ? in anycase ?= should be enough of loose rope
> > > > to let user/distro configure the packageconfig policy
> > > 
> > > OK so the problem is that I have meta-ros in my layer-mix and in that
> > > layer
> > > it defines PACKAGECONFIG ?= "python" IMO it should have appended instead
> > > of
> > > redefining. Thats why I was seeing what I was seeing.
> > 
> > It's worth noting that recipes, in general, should use ?= rather than ??=,
> > but config files, in general, should use ??=. Otherwise it becomes
> > impossible for the config metadata to define an overriding default -- the
> > last ??= wins, after all, and that would always be the recipe. IMO default
> > values in the recipe are there to give sane behavior when there's no
> > configuration coming in from elsewhere, not to override configuration
> > defaults.
> 
> yes I think thats a good point. so lets consider this patch for inclusion
> now we know the reason, I can resubmit with proper subject and patch header

It might be worth trying to standardise this in OE-Core rather that pick
off the recipes one by one. Most new PACKAGECONFIGs are cut and paste
from others so the problem will spread until we fix them consistently.

Cheers,

Richard

Patch

diff --git a/meta/recipes-support/boost/boost.inc b/meta/recipes-support/boost/boost.inc
index f13051c..f0f9eb8 100644
--- a/meta/recipes-support/boost/boost.inc
+++ b/meta/recipes-support/boost/boost.inc
@@ -19,7 +19,7 @@  BOOST_LIBS = "\
 	"
 
 # optional boost-python library
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ?= ""
 PACKAGECONFIG[python] = ",,python"
 BOOST_LIBS += "${@base_contains('PACKAGECONFIG', 'python', 'python', '', d)}"
 inherit python-dir