* [PATCH] cooker: Ensure bbappend files are processed in a determistic order
@ 2015-03-30 12:29 Richard Purdie
2015-03-31 15:28 ` Christopher Larson
0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2015-03-30 12:29 UTC (permalink / raw)
To: bitbake-devel
self.appendlist is a dict and as such unordered. This can lead to cases
where appends with different names (e.g. x_%.bbappend vs. x_123.bbappend)
can be reordered in application which in turn reorders the variables
that those bbappend files might touch. Reorderd variables changes the sstate
cache signatures causing real world issues.
To avoid this, use a list for the append files instead.
This patch is conservative and just adds a new data structure alongside
the existing one and uses it to resolve the core issue. Later patches
(post release) can handle some of the wider but less problematic ones
(e.g. issues in bitbake-layers flatten).
[YOCTO #7511]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 68aa532..b0f4e4b 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1576,6 +1576,7 @@ class CookerExit(bb.event.Event):
class CookerCollectFiles(object):
def __init__(self, priorities):
self.appendlist = {}
+ self.bbappends = []
self.appliedappendlist = []
self.bbfile_config_priorities = priorities
@@ -1670,6 +1671,7 @@ class CookerCollectFiles(object):
# Build a list of .bbappend files for each .bb file
for f in bbappend:
base = os.path.basename(f).replace('.bbappend', '.bb')
+ self.bbappends.append((base, f))
if not base in self.appendlist:
self.appendlist[base] = []
if f not in self.appendlist[base]:
@@ -1695,11 +1697,11 @@ class CookerCollectFiles(object):
"""
filelist = []
f = os.path.basename(fn)
- for bbappend in self.appendlist:
+ for b in self.bbappends:
+ (bbappend, filename) = b
if (bbappend == f) or ('%' in bbappend and bbappend.startswith(f[:bbappend.index('%')])):
self.appliedappendlist.append(bbappend)
- for filename in self.appendlist[bbappend]:
- filelist.append(filename)
+ filelist.append(filename)
return filelist
def collection_priorities(self, pkgfns, d):
@@ -1719,10 +1721,10 @@ class CookerCollectFiles(object):
unmatched.add(regex)
def findmatch(regex):
- for bbfile in self.appendlist:
- for append in self.appendlist[bbfile]:
- if regex.match(append):
- return True
+ for b in self.bbappends:
+ (bbfile, append) = b
+ if regex.match(append):
+ return True
return False
for unmatch in unmatched.copy():
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] cooker: Ensure bbappend files are processed in a determistic order
2015-03-30 12:29 [PATCH] cooker: Ensure bbappend files are processed in a determistic order Richard Purdie
@ 2015-03-31 15:28 ` Christopher Larson
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Larson @ 2015-03-31 15:28 UTC (permalink / raw)
To: Richard Purdie; +Cc: bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 1203 bytes --]
On Mon, Mar 30, 2015 at 5:29 AM, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:
> self.appendlist is a dict and as such unordered. This can lead to cases
> where appends with different names (e.g. x_%.bbappend vs. x_123.bbappend)
> can be reordered in application which in turn reorders the variables
> that those bbappend files might touch. Reorderd variables changes the
> sstate
> cache signatures causing real world issues.
>
> To avoid this, use a list for the append files instead.
>
> This patch is conservative and just adds a new data structure alongside
> the existing one and uses it to resolve the core issue. Later patches
> (post release) can handle some of the wider but less problematic ones
> (e.g. issues in bitbake-layers flatten).
>
> [YOCTO #7511]
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>
Nice, looks good for now. Thanks for the quick fix on this. It should help
sstate reuse in some cases.
Acked-by: Christopher Larson <chris_larson@mentor.com>
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 1805 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-31 15:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 12:29 [PATCH] cooker: Ensure bbappend files are processed in a determistic order Richard Purdie
2015-03-31 15:28 ` Christopher Larson
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.