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

2023-03-06 Thread Kinsey Moore
Looks good. A welcome improvement for anyone working on the build system.

Kinsey

On Mon, Mar 6, 2023 at 9:40 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> 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
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

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

2023-03-06 Thread Sebastian Huber
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

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel