]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
cookerdata: allow multiple passes of config re-parsing
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 15 Sep 2016 11:20:50 +0000 (14:20 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Sep 2016 14:19:33 +0000 (15:19 +0100)
[YOCTO #10188]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/cookerdata.py

index 07425ce00d86dd1f50d6c7f17b4d9d84aca0aef7..9e88f9571dc5acf9a322a785805e53722bd611a1 100644 (file)
@@ -270,9 +270,16 @@ class CookerDataBuilder(object):
 
             bb.event.fire(bb.event.ConfigParsed(), self.data)
 
-            if self.data.getVar("BB_INVALIDCONF", False) is True:
+            reparse_cnt = 0
+            while self.data.getVar("BB_INVALIDCONF", False) is True:
+                if reparse_cnt > 20:
+                    logger.error("Configuration has been re-parsed over 20 times, "
+                                 "breaking out of the loop...")
+                    raise Exception("Too deep config re-parse loop. Check locations where "
+                                    "BB_INVALIDCONF is being set (ConfigParsed event handlers)")
                 self.data.setVar("BB_INVALIDCONF", False)
                 self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
+                reparse_cnt += 1
                 bb.event.fire(bb.event.ConfigParsed(), self.data)
 
             bb.parse.init_parser(self.data)