summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-16 21:57:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-18 15:14:02 +0100
commit4325f6f03dee60ee45828ecffb053321a26fbc16 (patch)
tree294cb13592fbf30fe95bc267b9f572965ae07aa4 /bitbake
parent3a5e46b6ed483e43251da7e328b9299189997722 (diff)
downloadpoky-4325f6f03dee60ee45828ecffb053321a26fbc16.tar.gz
bitbake: data_smart: Expand overrides cache recursively
If the values that make up OVERRIDES are themselves overridden, we end up into some horrible circular logic. Unfortunately some metadata does depend on this functionality. e.g: DEFAULTTUNE_virtclass-multilib-xxx = Y which changes TUNE_ARCH which changes TARGET_ARCH which changes OVERRIDES As a solution, we iterate override expansion until the values don't change. If we iterate more than 5 times we abort and tell the user to report the issue. (Bitbake rev: 10279697c701e01bf6fdd5e9f92792ef5134807b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/data_smart.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 4be6614a2f..85412b2a8b 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -413,9 +413,11 @@ class DataSmart(MutableMapping):
413 self.overrides = None 413 self.overrides = None
414 414
415 def need_overrides(self): 415 def need_overrides(self):
416 if self.overrides is None: 416 if self.overrides is not None:
417 if self.inoverride: 417 return
418 return 418 if self.inoverride:
419 return
420 for count in range(5):
419 self.inoverride = True 421 self.inoverride = True
420 # Can end up here recursively so setup dummy values 422 # Can end up here recursively so setup dummy values
421 self.overrides = [] 423 self.overrides = []
@@ -424,6 +426,13 @@ class DataSmart(MutableMapping):
424 self.overridesset = set(self.overrides) 426 self.overridesset = set(self.overrides)
425 self.inoverride = False 427 self.inoverride = False
426 self.expand_cache = {} 428 self.expand_cache = {}
429 newoverrides = (self.getVar("OVERRIDES", True) or "").split(":") or []
430 if newoverrides == self.overrides:
431 break
432 self.overrides = newoverrides
433 self.overridesset = set(self.overrides)
434 else:
435 bb.fatal("Overrides could not be expanded into a stable state after 5 iterations, overrides must be being referenced by other overridden variables in some recursive fashion. Please provide your configuration to bitbake-devel so we can laugh, er, I mean try and understand how to make it work.")
427 436
428 def initVar(self, var): 437 def initVar(self, var):
429 self.expand_cache = {} 438 self.expand_cache = {}