summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-30 12:29:33 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-17 17:52:14 (GMT)
commit0b1be9dc67d059ec0754d86715e76d47e4ba0300 (patch)
treec952eaa531d60ec95e3e849da7bcf95cc4b7abf3
parentb9ec9f7425cd11fada2ba104122b0f1ea823ae28 (diff)
downloadpoky-0b1be9dc67d059ec0754d86715e76d47e4ba0300.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: d9a695e9e546cf3a158c88b0ecf2ecc132fb52e5) 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 f44a088..a2c9b10 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1408,6 +1408,7 @@ class CookerExit(bb.event.Event):
1408class CookerCollectFiles(object): 1408class CookerCollectFiles(object):
1409 def __init__(self, priorities): 1409 def __init__(self, priorities):
1410 self.appendlist = {} 1410 self.appendlist = {}
1411 self.bbappends = []
1411 self.appliedappendlist = [] 1412 self.appliedappendlist = []
1412 self.bbfile_config_priorities = priorities 1413 self.bbfile_config_priorities = priorities
1413 1414
@@ -1502,6 +1503,7 @@ class CookerCollectFiles(object):
1502 # Build a list of .bbappend files for each .bb file 1503 # Build a list of .bbappend files for each .bb file
1503 for f in bbappend: 1504 for f in bbappend:
1504 base = os.path.basename(f).replace('.bbappend', '.bb') 1505 base = os.path.basename(f).replace('.bbappend', '.bb')
1506 self.bbappends.append((base, f))
1505 if not base in self.appendlist: 1507 if not base in self.appendlist:
1506 self.appendlist[base] = [] 1508 self.appendlist[base] = []
1507 if f not in self.appendlist[base]: 1509 if f not in self.appendlist[base]:
@@ -1527,11 +1529,11 @@ class CookerCollectFiles(object):
1527 """ 1529 """
1528 filelist = [] 1530 filelist = []
1529 f = os.path.basename(fn) 1531 f = os.path.basename(fn)
1530 for bbappend in self.appendlist: 1532 for b in self.bbappends:
1533 (bbappend, filename) = b
1531 if (bbappend == f) or ('%' in bbappend and bbappend.startswith(f[:bbappend.index('%')])): 1534 if (bbappend == f) or ('%' in bbappend and bbappend.startswith(f[:bbappend.index('%')])):
1532 self.appliedappendlist.append(bbappend) 1535 self.appliedappendlist.append(bbappend)
1533 for filename in self.appendlist[bbappend]: 1536 filelist.append(filename)
1534 filelist.append(filename)
1535 return filelist 1537 return filelist
1536 1538
1537 def collection_priorities(self, pkgfns): 1539 def collection_priorities(self, pkgfns):
@@ -1551,10 +1553,10 @@ class CookerCollectFiles(object):
1551 unmatched.add(regex) 1553 unmatched.add(regex)
1552 1554
1553 def findmatch(regex): 1555 def findmatch(regex):
1554 for bbfile in self.appendlist: 1556 for b in self.bbappends:
1555 for append in self.appendlist[bbfile]: 1557 (bbfile, append) = b
1556 if regex.match(append): 1558 if regex.match(append):
1557 return True 1559 return True
1558 return False 1560 return False
1559 1561
1560 for unmatch in unmatched.copy(): 1562 for unmatch in unmatched.copy():