[PATCH] build: Print item UID in case of errors

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Mar 6 15:40:40 UTC 2023


This helps to identify issues in build items.
---
 wscript | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/wscript b/wscript
index a34cac51e2..567f42db2f 100755
--- a/wscript
+++ b/wscript
@@ -214,14 +214,24 @@ class Item(object):
             self.prepare_configure(conf, cic)
             for p in self.links():
                 p.configure(conf, cic)
-            self.do_configure(conf, cic)
+            try:
+                self.do_configure(conf, cic)
+            except Exception as e:
+                raise type(e)(
+                    "Configuration error related to item spec:{}: {}".format(
+                        self.uid, str(e)))
 
     def build(self, bld, bic):
         if _is_enabled(bld.env.ENABLE, self.get_enabled_by()):
             bic = self.prepare_build(bld, bic)
             for p in self.links():
                 p.build(bld, bic)
-            self.do_build(bld, bic)
+            try:
+                self.do_build(bld, bic)
+            except Exception as e:
+                raise type(e)(
+                    "Build error related to item spec:{}: {}".format(
+                        self.uid, str(e)))
 
     def do_defaults(self, enabled):
         return
-- 
2.35.3



More information about the devel mailing list