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:33 +0100
commit07d4569049183c9d3bec33247bef1bfc82463836 (patch)
tree1206b6e2b6c980aa6a8014b92b8396a25762b118
parent1153a954e652304b6b5d287437817b7da891d491 (diff)
downloadpoky-07d4569049183c9d3bec33247bef1bfc82463836.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: 75d6648f232a06b99c54a1e33324a7fc1cd15b38) 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 50b6b6bd3a..9ad97f4f38 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -16,6 +16,7 @@ import logging
16import os 16import os
17import re 17import re
18import sys 18import sys
19import hashlib
19from functools import wraps 20from functools import wraps
20import bb 21import bb
21from bb import data 22from bb import data
@@ -269,6 +270,7 @@ class CookerDataBuilder(object):
269 self.mcdata = {} 270 self.mcdata = {}
270 271
271 def parseBaseConfiguration(self): 272 def parseBaseConfiguration(self):
273 data_hash = hashlib.sha256()
272 try: 274 try:
273 bb.parse.init_parser(self.basedata) 275 bb.parse.init_parser(self.basedata)
274 self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles) 276 self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
@@ -292,7 +294,7 @@ class CookerDataBuilder(object):
292 bb.event.fire(bb.event.ConfigParsed(), self.data) 294 bb.event.fire(bb.event.ConfigParsed(), self.data)
293 295
294 bb.parse.init_parser(self.data) 296 bb.parse.init_parser(self.data)
295 self.data_hash = self.data.get_hash() 297 data_hash.update(self.data.get_hash().encode('utf-8'))
296 self.mcdata[''] = self.data 298 self.mcdata[''] = self.data
297 299
298 multiconfig = (self.data.getVar("BBMULTICONFIG") or "").split() 300 multiconfig = (self.data.getVar("BBMULTICONFIG") or "").split()
@@ -300,9 +302,11 @@ class CookerDataBuilder(object):
300 mcdata = self.parseConfigurationFiles(self.prefiles, self.postfiles, config) 302 mcdata = self.parseConfigurationFiles(self.prefiles, self.postfiles, config)
301 bb.event.fire(bb.event.ConfigParsed(), mcdata) 303 bb.event.fire(bb.event.ConfigParsed(), mcdata)
302 self.mcdata[config] = mcdata 304 self.mcdata[config] = mcdata
305 data_hash.update(mcdata.get_hash().encode('utf-8'))
303 if multiconfig: 306 if multiconfig:
304 bb.event.fire(bb.event.MultiConfigParsed(self.mcdata), self.data) 307 bb.event.fire(bb.event.MultiConfigParsed(self.mcdata), self.data)
305 308
309 self.data_hash = data_hash.hexdigest()
306 except (SyntaxError, bb.BBHandledException): 310 except (SyntaxError, bb.BBHandledException):
307 raise bb.BBHandledException 311 raise bb.BBHandledException
308 except bb.data_smart.ExpansionError as e: 312 except bb.data_smart.ExpansionError as e: