* [PATCH] utils: Ensure shell function failure in python logging is correct
@ 2022-02-21 16:03 Richard Purdie
2022-03-08 10:39 ` [bitbake-devel] " Peter Kjellerstedt
0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2022-02-21 16:03 UTC (permalink / raw)
To: bitbake-devel
If a python function exec_func() calls a shell task, the logging wasn't working
correctly in all cases since the exception was turned into a BBHandledException()
and the logfile piece was lost which is handled at the top task level.
The easiest way to avoid this is to allow the ExecutionError exceptions to
be raised to a higher level, we don't need the traceback for them.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
lib/bb/utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 2c22535424..2e8256101a 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -402,7 +402,7 @@ def better_exec(code, context, text = None, realfile = "<code>", pythonexception
code = better_compile(code, realfile, realfile)
try:
exec(code, get_context(), context)
- except (bb.BBHandledException, bb.parse.SkipRecipe, bb.data_smart.ExpansionError):
+ except (bb.BBHandledException, bb.parse.SkipRecipe, bb.data_smart.ExpansionError, bb.process.ExecutionError):
# Error already shown so passthrough, no need for traceback
raise
except Exception as e:
--
2.32.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* RE: [bitbake-devel] [PATCH] utils: Ensure shell function failure in python logging is correct
2022-02-21 16:03 [PATCH] utils: Ensure shell function failure in python logging is correct Richard Purdie
@ 2022-03-08 10:39 ` Peter Kjellerstedt
0 siblings, 0 replies; 2+ messages in thread
From: Peter Kjellerstedt @ 2022-03-08 10:39 UTC (permalink / raw)
To: Mittal, Anuj; +Cc: bitbake-devel@lists.openembedded.org
> -----Original Message-----
> From: bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: den 21 februari 2022 17:04
> To: bitbake-devel@lists.openembedded.org
> Subject: [bitbake-devel] [PATCH] utils: Ensure shell function failure in
> python logging is correct
>
> If a python function exec_func() calls a shell task, the logging wasn't working
> correctly in all cases since the exception was turned into a BBHandledException()
> and the logfile piece was lost which is handled at the top task level.
>
> The easiest way to avoid this is to allow the ExecutionError exceptions to
> be raised to a higher level, we don't need the traceback for them.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> lib/bb/utils.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/bb/utils.py b/lib/bb/utils.py
> index 2c22535424..2e8256101a 100644
> --- a/lib/bb/utils.py
> +++ b/lib/bb/utils.py
> @@ -402,7 +402,7 @@ def better_exec(code, context, text = None, realfile = "<code>", pythonexception
> code = better_compile(code, realfile, realfile)
> try:
> exec(code, get_context(), context)
> - except (bb.BBHandledException, bb.parse.SkipRecipe, bb.data_smart.ExpansionError):
> + except (bb.BBHandledException, bb.parse.SkipRecipe, bb.data_smart.ExpansionError, bb.process.ExecutionError):
> # Error already shown so passthrough, no need for traceback
> raise
> except Exception as e:
> --
> 2.32.0
This needs to be cherry-picked to Honister. There are corresponding
patches for oe-selftest as well to exercise the above change, but I'm
not sure if you normally backport them too.
//Peter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-08 10:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-21 16:03 [PATCH] utils: Ensure shell function failure in python logging is correct Richard Purdie
2022-03-08 10:39 ` [bitbake-devel] " Peter Kjellerstedt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.