summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-09-23 13:21:11 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-10 16:53:26 +0100
commitc272ecd65b3c2be9a411a79576d934378025c7bb (patch)
tree4044439a69499b9b7914ffa3b63fa6088708ee43
parent8e23315bda711e4b9f4848672d0b0acccea1ae6c (diff)
downloadpoky-c272ecd65b3c2be9a411a79576d934378025c7bb.tar.gz
bitbake: cookerdata: Add mc conffiles hashes to cache hash
The variable values that result from parsing multiconfig should be included in the cooker data hash, otherwise changes to these files won't be detected, which will allow the parsing cache to be loaded with the old values for the multiconfigs. This can either manifest as the variable values simply not updating, or getting basehash changed errors when building. This bug was previously undetected because all of the multiconfig base files were a direct file dependency in all parsed recipes. This was fixed in 34137a00f60 ("bitbake: bitbake: cooker: Rename __depends in all multiconfigs"), exposing this bug. [YOCTO #13541] (Bitbake rev: 6b045e074c6fea97d4e305a5a3c8bf82135d95eb) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/cookerdata.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 5df66e6173..d9887c714b 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -26,6 +26,7 @@ import logging
26import os 26import os
27import re 27import re
28import sys 28import sys
29import hashlib
29from functools import wraps 30from functools import wraps
30import bb 31import bb
31from bb import data 32from bb import data
@@ -279,6 +280,7 @@ class CookerDataBuilder(object):
279 self.mcdata = {} 280 self.mcdata = {}
280 281
281 def parseBaseConfiguration(self): 282 def parseBaseConfiguration(self):
283 data_hash = hashlib.sha256()
282 try: 284 try:
283 bb.parse.init_parser(self.basedata) 285 bb.parse.init_parser(self.basedata)
284 self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles) 286 self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
@@ -302,7 +304,7 @@ class CookerDataBuilder(object):
302 bb.event.fire(bb.event.ConfigParsed(), self.data) 304 bb.event.fire(bb.event.ConfigParsed(), self.data)
303 305
304 bb.parse.init_parser(self.data) 306 bb.parse.init_parser(self.data)
305 self.data_hash = self.data.get_hash() 307 data_hash.update(self.data.get_hash().encode('utf-8'))
306 self.mcdata[''] = self.data 308 self.mcdata[''] = self.data
307 309
308 multiconfig = (self.data.getVar("BBMULTICONFIG") or "").split() 310 multiconfig = (self.data.getVar("BBMULTICONFIG") or "").split()
@@ -310,9 +312,11 @@ class CookerDataBuilder(object):
310 mcdata = self.parseConfigurationFiles(self.prefiles, self.postfiles, config) 312 mcdata = self.parseConfigurationFiles(self.prefiles, self.postfiles, config)
311 bb.event.fire(bb.event.ConfigParsed(), mcdata) 313 bb.event.fire(bb.event.ConfigParsed(), mcdata)
312 self.mcdata[config] = mcdata 314 self.mcdata[config] = mcdata
315 data_hash.update(mcdata.get_hash().encode('utf-8'))
313 if multiconfig: 316 if multiconfig:
314 bb.event.fire(bb.event.MultiConfigParsed(self.mcdata), self.data) 317 bb.event.fire(bb.event.MultiConfigParsed(self.mcdata), self.data)
315 318
319 self.data_hash = data_hash.hexdigest()
316 except (SyntaxError, bb.BBHandledException): 320 except (SyntaxError, bb.BBHandledException):
317 raise bb.BBHandledException 321 raise bb.BBHandledException
318 except bb.data_smart.ExpansionError as e: 322 except bb.data_smart.ExpansionError as e: