[poky] [PATCH 2/3] bitbake: Introduce stamp-extra-info into build stamp file

Xu, Dongxiao dongxiao.xu at intel.com
Mon Jan 10 00:44:15 PST 2011


Xu, Dongxiao wrote:
> Richard Purdie wrote:
>> On Sat, 2011-01-08 at 23:53 +0800, Dongxiao Xu wrote:
>>> For certain tasks, we need additional information in build stamp
>>> file except the task name and file name. stamp-extra-info is
>>> introduced as an flag adding to the end of stamp file name.
>>> 
>>> We also implement a blacklist, in which extra stamp information will
>>> not be added.
>> 
>> To be honest I much preferred the original version of this patch. The
>> problem with this approach is that the data dictionary you're storing
>> in the siggen code is just the global config data dict. This means
>> that if any recipe customises BB_STAMP_EXTRA or the stamp-extra-into
>> flag, those changes will not be seen by this code. This is why your
>> original of extracting the flag at parse time and caching it was
>> better.
> 
> Hi Richard,
> 
> I used the new method to handle stamp in bitbake because I could not
> avoid adding extra info for native stamps with previous
> implementation.  
> 
> I noticed an strange issue with the previous code that, if I set:
> 
> do_populate_sysroot[stamp-extra-info] = "${MACHINE}" in
> staging.bbclass. 
> 
> and set:
> 
> do_populate_sysroot[stamp-extra-info] = "" in native.bbclass.
> 
> The above code will not work. For native recipes, what stored in the
> data cache was tagged with the "${MACHINE}" info. 
> 
> Is it because the cache data parsing is handled before the inherit of
> native bbclass? 

Hi Richard,

It seems that the above issue I met before disappeared when translated the original stamp extra info logic against latest bitbake. 
I will send out a v3 patchset after the test is passed.

Thanks,
Dongxiao

> 
> Thanks,
> Dongxiao
> 
>> 
>> I appreciate the code in those areas has changed but the original
>> patch should translate relatively easily.
>> 
>> Also note that re.compile is expensive so you'd do that at init
>> time, not for each stampfile. 
>> 
>> Cheers,
>> 
>> Richard
>> 
>>> Signed-off-by: Dongxiao Xu <dongxiao.xu at intel.com>
>>> ---
>>>  bitbake/lib/bb/siggen.py |   14 +++++++++++++-
>>>  1 files changed, 13 insertions(+), 1 deletions(-)
>>> 
>>> diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
>>> index 4dc09b3..6c5a227 100644 --- a/bitbake/lib/bb/siggen.py
>>> +++ b/bitbake/lib/bb/siggen.py
>>> @@ -43,7 +43,17 @@ class SignatureGenerator(object):          return
>>> 
>>>      def stampfile(self, stampbase, file_name, taskname):
>>> -        return "%s.%s" % (stampbase, taskname)
>>> +        stamp_extra_info = (self.data.getVarFlag(taskname,
>>> + 'stamp-extra-info', True) or self.data.getVar('BB_STAMP_EXTRA', +
>>> True) or "") + +        if self.stampblacklist:
>>> +            self.sbl = re.compile(self.stampblacklist) +
>>> else: +            self.sbl = None
>>> +
>>> +        if self.sbl and self.sbl.search(file_name):
>>> +            return "%s.%s" % (stampbase, taskname) +
>>> +        return ("%s.%s.%s" % (stampbase, taskname,
>>> + stamp_extra_info)).rstrip('.')
>>> 
>>>  class SignatureGeneratorBasic(SignatureGenerator):      """
>>> @@ -59,6 +69,8 @@ class SignatureGeneratorBasic(SignatureGenerator):
>>>          self.lookupcache = {}
>>>          self.basewhitelist = (data.getVar("BB_HASHBASE_WHITELIST",
>>>          True) or "").split() self.taskwhitelist =
>>> data.getVar("BB_HASHTASK_WHITELIST",
>>> True) or None
>>> +        self.stampblacklist = data.getVar("BB_STAMPTASK_BLACKLIST",
>>> True) or None +        self.data = data
>>> 
>>>          if self.taskwhitelist:
>>>              self.twl = re.compile(self.taskwhitelist)




More information about the poky mailing list