All of lore.kernel.org
 help / color / mirror / Atom feed
* eo_filter_out not working
@ 2013-05-23  6:59 Johan Thelin
  2013-05-23 11:04 ` Paul Eggleton
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Thelin @ 2013-05-23  6:59 UTC (permalink / raw)
  To: yocto

Hi,

I'm trying to build the packagegroup-core-p1 from the meta-ivi layer,
but I would like to remove the RRECOMMENDS as I don't want X11. To do
this, I've added a packagegroup-core-p1.bbappend to my own layer. In
this file I've tried the following options:

Attempt #1

RRECOMMENDS_packagegroup-core-p1 :=
"${@oe_filter_out('packagegroup-xserver-ivi',
'${RRECOMMENDS_packagegroup-core-p1}', d)}"

ERROR: ExpansionError during parsing
/home/e8johan/work/yocto/pelagicore-bsp/sources/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-p1.bb:
Failure expanding variable RRECOMMENDS_packagegroup-core-p1[:=],
expression was ${@oe_filter_out('packagegroup-xserver-ivi',
'${RRECOMMENDS_packagegroup-core-p1}', d)} which triggered exception
SyntaxError: EOL while scanning string literal
(RRECOMMENDS_packagegroup-core-p1[:=], line 1)


I read this as RECOMMENDS_packagegroup-core-p1 is not yet set, so the
oe_filter_out part fails.



Attempt #2

RRECOMMENDS_packagegroup-core-p1 := "foo"

WARNING: Variable key RRECOMMENDS_${PN} (    packagegroup-xserver-ivi
   ) replaces original key RRECOMMENDS_packagegroup-core-p1 (foo).


This sort of explains why attempt #1 fails, as it seems that the bb is
evaluated after the bbappend.



So this leads me to my question. Why is the bb apparently evaluated
after the bbappend? Running bitbake with -DDD does not indicate this
(see below), so I smell something fishy (or I don't fully grasp how
things are meant to work)

$ bitbake -DDD packagegroup-core-p1 | grep core-p1
DEBUG: BB /home/e8johan/work/yocto/pelagicore-bsp/sources/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-p1.bb:
handle(data)
DEBUG: LOAD /home/e8johan/work/yocto/pelagicore-bsp/sources/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-p1.bb
DEBUG: BB /home/e8johan/work/yocto/pelagicore-bsp/sources/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-p1.bb:6:
inheriting /home/e8johan/work/yocto/pelagicore-bsp/sources/poky/meta/classes/packagegroup.bbclass
DEBUG: Appending .bbappend file
/home/e8johan/work/yocto/pelagicore-bsp/sources/meta-pelagicore/meta-pelagicore/recipes-yocto-ivi/packagegroups/packagegroup-core-p1.bbappend
to /home/e8johan/work/yocto/pelagicore-bsp/sources/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-p1.bb
DEBUG: BB /home/e8johan/work/yocto/pelagicore-bsp/sources/meta-pelagicore/meta-pelagicore/recipes-yocto-ivi/packagegroups/packagegroup-core-p1.bbappend:
handle(data, include)
DEBUG: LOAD /home/e8johan/work/yocto/pelagicore-bsp/sources/meta-pelagicore/meta-pelagicore/recipes-yocto-ivi/packagegroups/packagegroup-core-p1.bbappend
WARNING: Variable key RRECOMMENDS_${PN} (    packagegroup-xserver-ivi
   ) replaces original key RRECOMMENDS_packagegroup-core-p1 (foo).
DEBUG: Cache: /home/e8johan/work/yocto/pelagicore-bsp/sources/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-p1.bb
is not cached

So, what am I doing wrong?

Best regards,

Johan Thelin   ヨハン  テリン
M.Sc.E.E.
System Architect

Pelagicore AB
Ekelundsgatan 4, 6tr, SE-411 18 Gothenburg, Sweden
Mobile: +46 (0)700 900 250
Skype: jothpelagicore
E-Mail: johan.thelin@pelagicore.com


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

* Re: eo_filter_out not working
  2013-05-23  6:59 eo_filter_out not working Johan Thelin
@ 2013-05-23 11:04 ` Paul Eggleton
  2013-05-23 11:32   ` Johan Thelin
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggleton @ 2013-05-23 11:04 UTC (permalink / raw)
  To: Johan Thelin; +Cc: yocto

Hi Johan,

On Thursday 23 May 2013 08:59:03 Johan Thelin wrote:
> I'm trying to build the packagegroup-core-p1 from the meta-ivi layer,
> but I would like to remove the RRECOMMENDS as I don't want X11. To do
> this, I've added a packagegroup-core-p1.bbappend to my own layer. In
> this file I've tried the following options:
> 
> Attempt #1
> 
> RRECOMMENDS_packagegroup-core-p1 :=
> "${@oe_filter_out('packagegroup-xserver-ivi',
> '${RRECOMMENDS_packagegroup-core-p1}', d)}"
> 
> ERROR: ExpansionError during parsing
> /home/e8johan/work/yocto/pelagicore-bsp/sources/meta-ivi/recipes-yocto-ivi/p
> ackagegroups/packagegroup-core-p1.bb: Failure expanding variable
> RRECOMMENDS_packagegroup-core-p1[:=],
> expression was ${@oe_filter_out('packagegroup-xserver-ivi',
> '${RRECOMMENDS_packagegroup-core-p1}', d)} which triggered exception
> SyntaxError: EOL while scanning string literal
> (RRECOMMENDS_packagegroup-core-p1[:=], line 1)
> 
> 
> I read this as RECOMMENDS_packagegroup-core-p1 is not yet set, so the
> oe_filter_out part fails.
> 
> 
> 
> Attempt #2
> 
> RRECOMMENDS_packagegroup-core-p1 := "foo"
> 
> WARNING: Variable key RRECOMMENDS_${PN} (    packagegroup-xserver-ivi
>    ) replaces original key RRECOMMENDS_packagegroup-core-p1 (foo).
> 
> 
> This sort of explains why attempt #1 fails, as it seems that the bb is
> evaluated after the bbappend.

It's not specifically about the order of evaluation between the bb and the 
bbappend, what this is saying is assignment statements where the variable name 
on the LHS contains references to other variables will be evaluated after 
assignment statements that don't. 

Unfortunately I think this means this kind of expression can't work, because 
at the time of the immediate evaluation, RDEPENDS_packagegroup-core-p1 (which 
is what RDEPENDS_${PN} is later expanded to) isn't available. I tried to get 
the value specifically of RDEPENDS_${PN} in an anonymous python function but 
that doesn't seem to work either.

I think for this case you're probably better off just setting the value as 
desired rather than trying to mangle the original value. When this kind of 
situation arises it usually indicates the recipe being appended needs to be 
changed to be more flexible instead of trying to work around its inflexibility 
in the bbappend.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: eo_filter_out not working
  2013-05-23 11:04 ` Paul Eggleton
@ 2013-05-23 11:32   ` Johan Thelin
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Thelin @ 2013-05-23 11:32 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: yocto

Hi Paul,

On 23 May 2013 13:04, Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> Hi Johan,
>
> On Thursday 23 May 2013 08:59:03 Johan Thelin wrote:
>> I'm trying to build the packagegroup-core-p1 from the meta-ivi layer,
>> but I would like to remove the RRECOMMENDS as I don't want X11. To do
>> this, I've added a packagegroup-core-p1.bbappend to my own layer. In
>> this file I've tried the following options:
>>
>> Attempt #1
>>
>> RRECOMMENDS_packagegroup-core-p1 :=
>> "${@oe_filter_out('packagegroup-xserver-ivi',
>> '${RRECOMMENDS_packagegroup-core-p1}', d)}"
>>
>> ERROR: ExpansionError during parsing
>> /home/e8johan/work/yocto/pelagicore-bsp/sources/meta-ivi/recipes-yocto-ivi/p
>> ackagegroups/packagegroup-core-p1.bb: Failure expanding variable
>> RRECOMMENDS_packagegroup-core-p1[:=],
>> expression was ${@oe_filter_out('packagegroup-xserver-ivi',
>> '${RRECOMMENDS_packagegroup-core-p1}', d)} which triggered exception
>> SyntaxError: EOL while scanning string literal
>> (RRECOMMENDS_packagegroup-core-p1[:=], line 1)
>>
>>
>> I read this as RECOMMENDS_packagegroup-core-p1 is not yet set, so the
>> oe_filter_out part fails.
>>
>>
>>
>> Attempt #2
>>
>> RRECOMMENDS_packagegroup-core-p1 := "foo"
>>
>> WARNING: Variable key RRECOMMENDS_${PN} (    packagegroup-xserver-ivi
>>    ) replaces original key RRECOMMENDS_packagegroup-core-p1 (foo).
>>
>>
>> This sort of explains why attempt #1 fails, as it seems that the bb is
>> evaluated after the bbappend.
>
> It's not specifically about the order of evaluation between the bb and the
> bbappend, what this is saying is assignment statements where the variable name
> on the LHS contains references to other variables will be evaluated after
> assignment statements that don't.
>
> Unfortunately I think this means this kind of expression can't work, because
> at the time of the immediate evaluation, RDEPENDS_packagegroup-core-p1 (which
> is what RDEPENDS_${PN} is later expanded to) isn't available. I tried to get
> the value specifically of RDEPENDS_${PN} in an anonymous python function but
> that doesn't seem to work either.

I was actually able to make it work (thanks to a friendly colleague)
with an anonymous python function:

python () {
    rrec = bb.data.getVar('RRECOMMENDS_packagegroup-core-p1', d, 1)
    if rrec:
        rrec = rrec.replace("packagegroup-xserver-ivi", "")
        bb.data.setVar('RRECOMMENDS_packagegroup-core-p1', rrec, d)
}

I don't know why the original oe_filter_out didn't work, but this does
the trick for me, so I'm good.

Cheers,

Johan

> I think for this case you're probably better off just setting the value as
> desired rather than trying to mangle the original value. When this kind of
> situation arises it usually indicates the recipe being appended needs to be
> changed to be more flexible instead of trying to work around its inflexibility
> in the bbappend.
>
> Cheers,
> Paul
>
> --
>
> Paul Eggleton
> Intel Open Source Technology Centre


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

end of thread, other threads:[~2013-05-23 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-23  6:59 eo_filter_out not working Johan Thelin
2013-05-23 11:04 ` Paul Eggleton
2013-05-23 11:32   ` Johan Thelin

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.