summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-30 13:29:33 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-17 17:52:13 +0000
commit8ef55cc0da13c96349f665987f2bcf9e64eebf8a (patch)
treea408b4053f99ffc091b319ddec9f86d81246cf24
parent6d34267e0a13e10ab91b60590b27a2b5ba3b7da6 (diff)
downloadpoky-8ef55cc0da13c96349f665987f2bcf9e64eebf8a.tar.gz
bitbake: cooker: Ensure bbappend files are processed in a determistic order
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] (Bitbake rev: 370a19bf956a2fba5bf4db3d72806e17d7f9e000) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/cooker.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 70cccefe0c..8bbe1e9fde 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1519,6 +1519,7 @@ class CookerExit(bb.event.Event):
1519class CookerCollectFiles(object): 1519class CookerCollectFiles(object):
1520 def __init__(self, priorities): 1520 def __init__(self, priorities):
1521 self.appendlist = {} 1521 self.appendlist = {}
1522 self.bbappends = []
1522 self.appliedappendlist = [] 1523 self.appliedappendlist = []
1523 self.bbfile_config_priorities = priorities 1524 self.bbfile_config_priorities = priorities
1524 1525
@@ -1613,6 +1614,7 @@ class CookerCollectFiles(object):
1613 # Build a list of .bbappend files for each .bb file 1614 # Build a list of .bbappend files for each .bb file
1614 for f in bbappend: 1615 for f in bbappend:
1615 base = os.path.basename(f).replace('.bbappend', '.bb') 1616 base = os.path.basename(f).replace('.bbappend', '.bb')
1617 self.bbappends.append((base, f))
1616 if not base in self.appendlist: 1618 if not base in self.appendlist:
1617 self.appendlist[base] = [] 1619 self.appendlist[base] = []
1618 if f not in self.appendlist[base]: 1620 if f not in self.appendlist[base]:
@@ -1638,11 +1640,11 @@ class CookerCollectFiles(object):
1638 """ 1640 """
1639 filelist = [] 1641 filelist = []
1640 f = os.path.basename(fn) 1642 f = os.path.basename(fn)
1641 for bbappend in self.appendlist: 1643 for b in self.bbappends:
1644 (bbappend, filename) = b
1642 if (bbappend == f) or ('%' in bbappend and bbappend.startswith(f[:bbappend.index('%')])): 1645 if (bbappend == f) or ('%' in bbappend and bbappend.startswith(f[:bbappend.index('%')])):
1643 self.appliedappendlist.append(bbappend) 1646 self.appliedappendlist.append(bbappend)
1644 for filename in self.appendlist[bbappend]: 1647 filelist.append(filename)
1645 filelist.append(filename)
1646 return filelist 1648 return filelist
1647 1649
1648 def collection_priorities(self, pkgfns): 1650 def collection_priorities(self, pkgfns):
@@ -1662,10 +1664,10 @@ class CookerCollectFiles(object):
1662 unmatched.add(regex) 1664 unmatched.add(regex)
1663 1665
1664 def findmatch(regex): 1666 def findmatch(regex):
1665 for bbfile in self.appendlist: 1667 for b in self.bbappends:
1666 for append in self.appendlist[bbfile]: 1668 (bbfile, append) = b
1667 if regex.match(append): 1669 if regex.match(append):
1668 return True 1670 return True
1669 return False 1671 return False
1670 1672
1671 for unmatch in unmatched.copy(): 1673 for unmatch in unmatched.copy():