All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed
@ 2016-10-01  2:46 Ulf Magnusson
  2016-10-01  2:46 ` [PATCH 01/22] base.bbclass: " Ulf Magnusson
                   ` (21 more replies)
  0 siblings, 22 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01  2:46 UTC (permalink / raw)
  To: openembedded-core

Motiving quote:

< 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

This seems to be true from looking at the code. exec_func_python() in
bitbake/lib/bb/build.py raises FuncFailed when it catches the
BBHandledException raised by bb.fatal(). Metadata functions that catch
FuncFailed (e.g. in image.bclass) should still work, per the original purpose
of FuncFailed.

The output might change slightly (imo for the better). Here's an example before
the change:

  ERROR: gettext-0.19.8.1-r0 do_fetch: Function failed: Fetcher failure for URL: 'http://ftp.gnu.org/gnu/gettext/gettext-0.19.8.1.tar.gz'. ...
  ERROR: Logfile of failure stored in: /home/ulf/poky/build/tmp/work/i586-poky-linux/gettext/0.19.8.1-r0/temp/log.do_fetch.19715

Here's what it looks like after the change:

  ERROR: gettext-0.19.8.1-r0 do_fetch: Fetcher failure for URL: 'http://ftp.gnu.org/gnu/gettext/gettext-0.19.8.1.tar.gz'. ...
  ERROR: gettext-0.19.8.1-r0 do_fetch: Function failed: base_do_fetch
  ERROR: Logfile of failure stored in: /home/ulf/poky/build/tmp/work/i586-poky-linux/gettext/0.19.8.1-r0/temp/log.do_fetch.19608

I won't get terribly offended if not all of these get merged. Hopefully it
makes people aware that there's a simpler way at least.

There's also a few instances in meta/lib/oe and meta/lib/oeqa that could
probably be replaced, but I got tired and wasn't sure that they're always
called in a context where it'd be safe.

Ulf Magnusson (22):
  base.bbclass: Use bb.fatal() instead of raising FuncFailed
  package_ipk.bbclass: Use bb.fatal() instead of raising FuncFailed
  package_deb.bbclass: Use bb.fatal() instead of raising FuncFailed
  package_rpm.bbclass: Use bb.fatal() instead of raising FuncFailed
  useradd-staticids.bbclass: Use bb.fatal() instead of raising
    FuncFailed
  grub-efi.bbclass: Use bb.fatal() instead of raising FuncFailed
  syslinux.bbclass: Use bb.fatal() instead of raising FuncFailed
  systemd-boot.bbclass: Use bb.fatal() instead of raising FuncFailed
  gummiboot.bbclass: Use bb.fatal() instead of raising FuncFailed
  update-rc.d.bbclass: Use bb.fatal() instead of raising FuncFailed
  license.bbclass: Use bb.fatal() instead of raising FuncFailed
  systemd.bbclass: Use bb.fatal() instead of raising FuncFailed
  gtk-immodules-cache.bbclass: Use bb.fatal() instead of raising
    FuncFailed
  useradd.bbclass: Use bb.fatal() instead of raising FuncFailed
  sstate.bbclass: Use bb.fatal() instead of raising FuncFailed
  chrpath.bbclass: Use bb.fatal() instead of raising FuncFailed
  testsdk.bbclass: Use bb.fatal() instead of raising FuncFailed
  libc-package.bbclass: Use bb.fatal() instead of raising FuncFailed
  package.bbclass: Use bb.fatal() instead of raising FuncFailed
  utility-tasks.bbclass: Use bb.fatal() instead of raising FuncFailed
  testimage.bbclass: Use bb.fatal() instead of raising FuncFailed
  cmake: Use bb.fatal() instead of raising FuncFailed

 meta/classes/base.bbclass                  |  8 ++++----
 meta/classes/chrpath.bbclass               |  3 +--
 meta/classes/grub-efi.bbclass              |  8 ++++----
 meta/classes/gtk-immodules-cache.bbclass   |  2 +-
 meta/classes/gummiboot.bbclass             |  6 +++---
 meta/classes/libc-package.bbclass          |  2 +-
 meta/classes/license.bbclass               |  4 ++--
 meta/classes/package.bbclass               |  2 +-
 meta/classes/package_deb.bbclass           | 10 +++++-----
 meta/classes/package_ipk.bbclass           | 10 +++++-----
 meta/classes/package_rpm.bbclass           |  6 +++---
 meta/classes/sstate.bbclass                |  2 +-
 meta/classes/syslinux.bbclass              |  8 ++++----
 meta/classes/systemd-boot.bbclass          |  6 +++---
 meta/classes/systemd.bbclass               |  3 +--
 meta/classes/testimage.bbclass             |  2 +-
 meta/classes/testsdk.bbclass               |  2 +-
 meta/classes/update-rc.d.bbclass           |  4 ++--
 meta/classes/useradd-staticids.bbclass     |  8 ++++----
 meta/classes/useradd.bbclass               |  2 +-
 meta/classes/utility-tasks.bbclass         |  2 +-
 meta/recipes-devtools/cmake/cmake_3.6.1.bb |  2 +-
 22 files changed, 50 insertions(+), 52 deletions(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2016-10-05 23:02 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-10-05 23:02       ` Ulf Magnusson

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.