[bitbake-devel] python function used in variable expansion called multiple times per recipe

Daniel Lazzari dlazzari at leapfrog.com
Wed Apr 18 23:57:24 UTC 2012

>-----Original Message-----
>From: Chris Larson [mailto:kergoth at gmail.com]
>Sent: Wednesday, April 18, 2012 4:42 PM
>To: Daniel Lazzari
>Cc: 'bitbake-devel at lists.openembedded.org' (bitbake-
>devel at lists.openembedded.org)
>Subject: Re: [bitbake-devel] python function used in variable expansion called
>multiple times per recipe
>On Wed, Apr 18, 2012 at 4:39 PM, Daniel Lazzari <dlazzari at leapfrog.com>
>> I think immediate expansion is what I’ll need to use, thanks for the tip.
>> That at least brings the invocation down to once per run. Unfortunately, the
>> variable doesn’t seem to get filled in when I change to immediate
>> def testFunc(bb, d):
>>                 print( bb.data.getVar("PN", d, True) )
>>                 return "e1"
>> EXTERNPV := "${@testFunc(bb, d)}"
>> Now only prints the package name once, but using –e, I don’t see the
>> variable EXTERNPV at all.
>Don't know what to tell you. It does work, so it's something wrong on
>your end. Either it's returning an empty string, which will result in
>-e only showing the commented out definition, or it's raising an
>exception, or something else in your setup. Aside: you don't need to
>pass 'bb' in. That namespace is always accessible, even from def'd
>python functions.
>Christopher Larson

Ah, I was doing -e on the wrong recipe... time to get some more caffeine. The test case is now working. My code is not, but I can debug that pretty easily. Thanks for all of your help!

More information about the bitbake-devel mailing list