Skip to contentSkip to conversation

data_smart: Add debugging for overrides stability issue

PATCH New Richard Purdie 1 participant 1 message Nov 24, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 data_smart: Add debugging for overrides stability issue

If someone is unfortunate enough to run into override recursion issues they're hard to debug with the existing message. We can at least show the values that OVERRIDES takes to show there is some problem and aid debugging.

---
 lib/bb/data_smart.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/bb/data_smart.py +3 -1
index 5415f2fccf..fd05451971 100644
@@ -486,12 +486,14 @@ class DataSmart(MutableMapping):
             return
         if self.inoverride:
             return
+        overrride_stack = []
         for count in range(5):
             self.inoverride = True
             # Can end up here recursively so setup dummy values
             self.overrides = []
             self.overridesset = set()
             self.overrides = (self.getVar("OVERRIDES") or "").split(":") or []
+            overrride_stack.append(self.overrides)
             self.overridesset = set(self.overrides)
             self.inoverride = False
             self.expand_cache = {}
@@ -501,7 +503,7 @@ class DataSmart(MutableMapping):
             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.")
+            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. The list of failing override expansions: %s" % "\n".join(str(s) for s in overrride_stack))
 
     def initVar(self, var):
         self.expand_cache = {}
Signature · 1 line
2.34.1