Skip to content

Commit

Permalink
cooker: Ensure bbappend files are processed in a determistic order
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rpurdie committed Mar 31, 2015
1 parent 2a8b3b8 commit ba14fb2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/bb/cooker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,7 @@ def __init__(self):
class CookerCollectFiles(object):
def __init__(self, priorities):
self.appendlist = {}
self.bbappends = []
self.appliedappendlist = []
self.bbfile_config_priorities = priorities

Expand Down Expand Up @@ -1667,6 +1668,7 @@ def collect_bbfiles(self, config, eventdata):
# 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]:
Expand All @@ -1692,11 +1694,11 @@ def get_file_appends(self, fn):
"""
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):
Expand All @@ -1716,10 +1718,10 @@ def collection_priorities(self, pkgfns, d):
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():
Expand Down

0 comments on commit ba14fb2

Please sign in to comment.