summaryrefslogtreecommitdiff
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:13:14 +0100
commit10279697c701e01bf6fdd5e9f92792ef5134807b (patch)
tree6bf4a0e56ba3b0e421004359fba6fe47307b41a4
parenteaaa81393f181432c8586b17ade623f42c9fed2e (diff)
downloadbitbake-10279697c701e01bf6fdd5e9f92792ef5134807b.zip
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/data_smart.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 4be6614a..85412b2a 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -413,9 +413,11 @@ class DataSmart(MutableMapping):
self.overrides = None
def need_overrides(self):
- if self.overrides is None:
- if self.inoverride:
- return
+ if self.overrides is not None:
+ return
+ if self.inoverride:
+ return
+ for count in range(5):
self.inoverride = True
# Can end up here recursively so setup dummy values
self.overrides = []
@@ -424,6 +426,13 @@ class DataSmart(MutableMapping):
self.overridesset = set(self.overrides)
self.inoverride = False
self.expand_cache = {}
+ newoverrides = (self.getVar("OVERRIDES", True) or "").split(":") or []
+ if newoverrides == self.overrides:
+ break
+ self.overrides = newoverrides
+ self.overridesset = set(self.overrides)
+ else:
+ 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.")
def initVar(self, var):
self.expand_cache = {}