Commit Graph

5 Commits

Author SHA1 Message Date
Paul Eggleton e60597abb7 classes/logging: allow shell message functions to work in devshell
Fix a regression caused by the shell message changes - if you run a
shell task's runfile, the task isn't actually running in BitBake and
thus the message FIFO won't exist - so we should just fall back to
printing the message with echo as we did before so that the run files
are still useful.

(From OE-Core rev: 607d3306f7abef057693dcb6aac1f7b26880181d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:24 +01:00
Paul Eggleton 757be608a5 classes/base: fix die() to print the full log
The recent change to connect through the shell logging functions caused
a regression - bb.error() and bb.fatal() cause a flag to be set
internally such that BitBake's UI will not print the full task log on
failure; unfortunately we have in a lot of places called die() or
bbfatal() within shell functions with a very terse message as a means of
exiting out, where we still want to see the full log (and we were
previously). We do still want to have fatal errors with proper messages
that don't result in the full log being printed, however we can't ignore
the typical usage of die(). Having added a mechanism to BitBake to log an
error and reset the flag, create a bbfatal_log() function that uses this
and call it from die() to restore the previous behaviour.

(From OE-Core rev: beec1cf3d22d7dbe85f332a055c72649f4bd3e92)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:23 +01:00
Paul Eggleton c3ac850f69 classes/logging: make shell message functions output to the console
Use the FIFO that is now set up when executing tasks within BitBake to
make bbdebug/bbnote/bbwarn/bbplain/bberror/bbfatal output to the console
through BitBake's UI (as their python counterparts do) instead of only
outputting to the task log.

Note that this requires the corresponding change in BitBake that creates
the FIFO; without it such messages will end up in a file where the FIFO
should have been (but won't cause any other ill effects).

Remainder of the fix for [YOCTO #5275].

(From OE-Core rev: f04139fc2a33ef48dc889ce51ea442927db0c134)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:45 +01:00
Patrick Ohly 553305eee8 logging.bbclass: avoid bashism in bbdebug()
Checking the bbdebug() debug level parameter with a regular
test expression only works in bash. Using tr to filter out
digits and then checking whether anything is left achieves
the same result and is more portable.

(From OE-Core rev: 25cb71799e72d4e0c4fe39653d8b84280d087372)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:46:56 +01:00
Darren Hart 753bc3e919 logging: add bb* logging mechanisms for bash recipe functions
The following logging mechanisms are to be used in bash functions of recipes.
They are intended to map one to one in intention and output format with the
python recipe logging functions of a similar naming convention: bb.plain(),
bb.note(), etc.

For the time being, all of these print only to the task logs. Future
enhancements may integrate these calls with the bitbake logging infrastructure,
allowing for printing to the console as appropriate. The interface and intention
statements reflect that future goal. Once it is in place, no changes will be
necessary to recipes using these logging mechanisms.

I opted to write new functions instead of modifying the oe* logging functions
from base.bbclass (and utils.bbclass in oe) for a couple reasons. First, one of
my goals was to generate a uniform logging API between bash and python in
recipes. Second, there are no users of oe* logging in meta (oe-core) or
meta-yocto, while several oe recipes do use them. I wanted to make a clean start
with the freedom to change behavior without forcing the oe recipes to change or
experience unexpected logging changes. Eventually, the oe recipes can be
migrated to the new bb* logging routines and the existing oe* routines can be
retired (deleted).

(From OE-Core rev: 7cb3f0206619b725e404282fa7a3ac50b4609f1e)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-28 10:45:41 +01:00