All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: "Mittal, Anuj" <anuj.mittal@intel.com>
Cc: "bitbake-devel@lists.openembedded.org"
	<bitbake-devel@lists.openembedded.org>
Subject: RE: [bitbake-devel] [PATCH] utils: Ensure shell function failure in python logging is correct
Date: Tue, 8 Mar 2022 10:39:45 +0000	[thread overview]
Message-ID: <ee2ce832f87b40ebbc02eb0a43339a85@axis.com> (raw)
In-Reply-To: <20220221160356.3167661-1-richard.purdie@linuxfoundation.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



      reply	other threads:[~2022-03-08 10:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee2ce832f87b40ebbc02eb0a43339a85@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=anuj.mittal@intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.