openembedded-core.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: mac@mcrowe.com, openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v4 1/2] lib/oe/qa,insane: Move extra error handling functions to library
Date: Fri, 15 Oct 2021 15:09:08 +0100	[thread overview]
Message-ID: <a58827c0ad0f2c39ca4df700efe31fc9d18b1383.camel@linuxfoundation.org> (raw)
In-Reply-To: <be8780efcbcee32cc1ef6aff886e85d1b78fe627.1634306366.git.mac@mcrowe.com>

On Fri, 2021-10-15 at 14:59 +0100, Mike Crowe via lists.openembedded.org wrote:
> Extract package_qa_write_error, package_qa_handle_error and
> package_qa_add_message functions from insane.bbclass to lib/oe/qa.py and
> drop the package_qa_ prefixes.
> 
> Update various bbclasses to use the new functions. No import is required
> since base.bbclass puts oe.qa in OE_IMPORTS.
> 
> Stop requiring callers to manually track whether a fatal error has been
> encountered via a "sane" flag. Instead replace the QA_SANE variable with
> QA_ERRORS_FOUND and call oe.qa.exit_if_errors or
> oe.qa.exit_with_message_if_errors at the end of each task.
> 
> Inspired by discussion resulting from
> https://lists.openembedded.org/g/openembedded-core/message/156793 and
> https://lists.openembedded.org/g/openembedded-core/message/156900
> 
> Signed-off-by: Mike Crowe <mac@mcrowe.com>
> ---
>  meta/classes/buildhistory.bbclass |   3 +-
>  meta/classes/insane.bbclass       | 180 ++++++++++++------------------
>  meta/classes/multilib.bbclass     |   3 +-
>  meta/classes/package.bbclass      |  26 ++---
>  meta/classes/ptest.bbclass        |   2 +-
>  meta/lib/oe/qa.py                 |  34 ++++++
>  6 files changed, 121 insertions(+), 127 deletions(-)
> 
> diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
> index 7c44fec2d1..62d0d781a1 100644
> --- a/meta/classes/buildhistory.bbclass
> +++ b/meta/classes/buildhistory.bbclass
> @@ -287,7 +287,7 @@ python buildhistory_emit_pkghistory() {
>              r = bb.utils.vercmp((pkge, pkgv, pkgr), (last_pkge, last_pkgv, last_pkgr))
>              if r < 0:
>                  msg = "Package version for package %s went backwards which would break package feeds (from %s:%s-%s to %s:%s-%s)" % (pkg, last_pkge, last_pkgv, last_pkgr, pkge, pkgv, pkgr)
> -                package_qa_handle_error("version-going-backwards", msg, d)
> +                oe.qa.handle_error("version-going-backwards", msg, d)
>  
>          pkginfo = PackageInfo(pkg)
>          # Apparently the version can be different on a per-package basis (see Python)
> @@ -321,6 +321,7 @@ python buildhistory_emit_pkghistory() {
>  
>      # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
>      bb.build.exec_func("buildhistory_list_pkg_files", d)
> +    oe.qa.exit_if_errors(d)

This is a change in behaviour since currently buildhistory doesn't do that and
I'm not sure it should.


>  }
>  
>  python buildhistory_emit_outputsigs() {
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index 433e4dfa33..2df5edf138 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -18,7 +18,7 @@
>  #   files under exec_prefix
>  #  -Check if the package name is upper case
>  
> -QA_SANE = "True"
> +QA_ERRORS_FOUND = "False"
> 

Lets just delete this please, we don't need a default value and it is confusing
being isolated from the other code.

Otherwise looks good, thanks!

Cheers,

Richard



  parent reply	other threads:[~2021-10-15 14:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 13:59 [PATCH v4 1/2] lib/oe/qa,insane: Move extra error handling functions to library Mike Crowe
2021-10-15 13:59 ` [PATCH v4 2/2] insane,license,license_image: Allow treating license problems as errors Mike Crowe
2021-10-15 14:09 ` Richard Purdie [this message]
2021-10-15 14:17   ` [OE-core] [PATCH v4 1/2] lib/oe/qa,insane: Move extra error handling functions to library Mike Crowe
2021-10-15 14:21     ` Richard Purdie

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=a58827c0ad0f2c39ca4df700efe31fc9d18b1383.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=mac@mcrowe.com \
    --cc=openembedded-core@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).