All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Ulf Magnusson <ulfalizer@gmail.com>,
	OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 22/22] cmake: Use bb.fatal() instead of raising FuncFailed
Date: Wed, 05 Oct 2016 23:15:07 +0100	[thread overview]
Message-ID: <1475705707.30475.498.camel@linuxfoundation.org> (raw)
In-Reply-To: <CAFkk2KQHNzLOTfMPf_-V+a+2W1Rp81t7VmbstpsOJq=hXYH3PQ@mail.gmail.com>

On Wed, 2016-10-05 at 22:26 +0200, Ulf Magnusson wrote:
> On Sat, Oct 1, 2016 at 4:47 AM, Ulf Magnusson <ulfalizer@gmail.com>
> wrote:
> > 
> > This sets a good example and avoids unnecessarily contributing to
> > perceived complexity and cargo culting.
> > 
> > Motivating quote below:
> > 
> > < kergoth> the *original* intent was for the function/task to error
> > via
> >            whatever appropriate means, bb.fatal, whatever, and
> >            funcfailed was what you'd catch if you were calling
> >            exec_func/exec_task. that is, it's what those functions
> >            raise, not what metadata functions should be raising
> > < kergoth> it didn't end up being used that way
> > < kergoth> but there's really never a reason to raise it yourself
> > 
> > FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
> > argument, which also shows that the original purpose got lost.
> > 
> > Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
> > ---
> >  meta/recipes-devtools/cmake/cmake_3.6.1.bb | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> > b/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> > index 67ba9c4..850d6de 100644
> > --- a/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> > +++ b/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> > @@ -14,7 +14,7 @@ python () {
> >      docdir=d.getVar("docdir", True)
> > 
> >      if not docdir.startswith(prefix):
> > -        raise bb.build.FuncFailed('docdir must contain prefix as
> > its prefix')
> > +        bb.fatal('docdir must contain prefix as its prefix')
> > 
> >      docdir_stripped = docdir[len(prefix):]
> >      if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
> > --
> > 2.7.4
> > 
> Thanks for merging these!
> 
> There's now some documentation that mentions FuncFailed as well:
> https://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-use
> r-manual.html#bitbake-style-python-functions-versus-python-functions

It did break one of the tests in oe-selftest but we've fixed that...

Cheers,

Richard


  reply	other threads:[~2016-10-05 22:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-01  2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
2016-10-01  2:46 ` [PATCH 01/22] base.bbclass: " Ulf Magnusson
2016-10-01  2:46 ` [PATCH 02/22] package_ipk.bbclass: " Ulf Magnusson
2016-10-01  2:46 ` [PATCH 03/22] package_deb.bbclass: " Ulf Magnusson
2016-10-01  2:46 ` [PATCH 04/22] package_rpm.bbclass: " Ulf Magnusson
2016-10-01  2:46 ` [PATCH 05/22] useradd-staticids.bbclass: " Ulf Magnusson
2016-10-01  2:46 ` [PATCH 06/22] grub-efi.bbclass: " Ulf Magnusson
2016-10-01  2:46 ` [PATCH 07/22] syslinux.bbclass: " Ulf Magnusson
2016-10-01  2:46 ` [PATCH 08/22] systemd-boot.bbclass: " Ulf Magnusson
2016-10-01  2:46 ` [PATCH 09/22] gummiboot.bbclass: " Ulf Magnusson
2016-10-01  2:46 ` [PATCH 10/22] update-rc.d.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 11/22] license.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 12/22] systemd.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 13/22] gtk-immodules-cache.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 14/22] useradd.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 15/22] sstate.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 16/22] chrpath.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 17/22] testsdk.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 18/22] libc-package.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 19/22] package.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 20/22] utility-tasks.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 21/22] testimage.bbclass: " Ulf Magnusson
2016-10-01  2:47 ` [PATCH 22/22] cmake: " Ulf Magnusson
2016-10-05 20:26   ` Ulf Magnusson
2016-10-05 22:15     ` Richard Purdie [this message]
2016-10-05 23:02       ` Ulf Magnusson

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=1475705707.30475.498.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ulfalizer@gmail.com \
    /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.