Commit Graph

1096 Commits

Author SHA1 Message Date
David Reyna
ddf3b3ecd4 bitbake: toaster: accommodate missing 'Image Name' value in buildinfohelper
The value "Image Name" in bitbake events was missing for certain builds. Update 'buildinfohelper' to extract the
image name elsewhere in this circumstance and not crash.

[YOCTO #13191]

(Bitbake rev: 703792c48c818025163de9c2f35f6ac815500607)

Signed-off-by: Kieran McNulty <Kieran.McNulty@windriver.com>
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-30 10:41:54 +01:00
Tim Orling
4d1675beac bitbake: bitbake: fix deprecated threading.Thread.setDaemon
Deprecated in Python 3.10:
https://docs.python.org/3/whatsnew/3.10.html#deprecated
https://github.com/python/cpython/pull/25174

Fixes warnings like:

...bitbake/lib/bb/ui/uievent.py:68: DeprecationWarning: setDaemon() is
deprecated, set the daemon attribute instead
  self.t.setDaemon(True)

(Bitbake rev: 323f6ce27a1bfd7159e72f29684674ff495dedee)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-24 21:59:44 +00:00
Richard Purdie
3a439f94ab bitbake: knotty: Improve shutdown handling
There are three levels of shutdown, the initial "wait for current tasks",
then "stop current tasks" and "exit now". Change the code so that we don't
instantly exit after "stop current tasks" but allow the events to come
through from the server first. The new shutdown level allows that to then
be broken out of too.

(Bitbake rev: af38345b91cfc8a6bb5c38f5753255e7635bfe2b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-11 23:14:48 +00:00
Richard Purdie
a19687acd1 bitbake: lib/bb: Update thread/process locks to use a timeout
The thread/process locks we use translate to futexes in Linux. If a
process dies holding the lock, anything else trying to take the lock
will hang indefinitely. An example would be the OOM killer taking out
a parser process.

To avoid bitbake processes just hanging indefinitely, add a timeout to
our lock calls using a context manager. If we can't obtain the lock
after waiting 5 minutes, hard exit out using os._exit(1). Use _exit()
to avoid locking in any other places trying to write error messages to
event handler queues (which also need locks).

Whilst a bit harsh, this should mean we stop having lots of long running
processes in cases where things are never going to work out and also
avoids hanging builds on the autobuilder.

(Bitbake rev: d2a3f662b0eed900fc012a392bfa0a365df0df9b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-05 11:50:17 +00:00
Richard Purdie
a486edbfb1 bitbake: knotty: Ping the server/cooker periodically
We're seeing failures where the UI hangs if the server disappears. Ping
the cooker/server if we've not had any events in the last minute so we can
check if it is still alive.

(Bitbake rev: 6567ad6181f9e39812097f0154647e4b38238fdd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-31 17:05:17 +00:00
Richard Purdie
2c5bc03796 bitbake: knotty: Avoid looping with tracebacks
If there are events queued and there is an exception in the main loop
of the UI code, it will print tracebacks on the console indefinitely.
Avoid that by improving the loop exit conditions.

(Bitbake rev: 2d0940b920a22b244f3ba6849c7cd019578386b4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-31 17:05:16 +00:00
Richard Purdie
cbeda8ee3b bitbake: buildinfohelper: Drop unused variables
(Bitbake rev: d720dfa40620e64a557edef527148d58fcb1d858)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-21 21:00:35 +01:00
Richard Purdie
ff9f30b4c6 bitbake: ui/knotty: Drop pointless pass statement
(Bitbake rev: 625565087d8c9e7a6a79b0b4f3e5be2d77d5f100)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-21 21:00:35 +01:00
Richard Purdie
004b0e03e1 bitbake: buildinfohelper: Drop unused function
The function has a loop where the variable is never used which I was going
to fix but the entire function never seems to be called so remove it entirely.

(Bitbake rev: 3bcb20f025907f4e88bbe3d14f5638d5f01010cb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-21 21:00:35 +01:00
Richard Purdie
4431ad2802 bitbake: ui/buildinfohelper: Drop unused import
(Bitbake rev: aca0ff85109f4b0f3c201c02c3f59cad7ee2e787)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-21 21:00:35 +01:00
Peter Kjellerstedt
12b4074675 bitbake: knotty.py: Show elapsed time also for tasks with progress bars
While the progress bar is good at conveying information about how much
of a task has executed, the elapsed time of the task is still very
much relevant to show.

(Bitbake rev: 41eeb4f34fb2306303f7688ec5e0ae965a573aa4)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-05 10:50:08 +01:00
Ross Burton
93eb983e79 bitbake: bitbake: knotty: reduce keep-alive timeout from 5000s (83 minutes) to 10 minutes
The keep alive timeout is excessively long at 83 minutes (5000 seconds),
reduce this to 10 minutes: this should be long enough that it rarely
triggers in normal builds, but when it does it has useful information.

(Bitbake rev: 2e47346b95b09d7ab8f0603e2d62cfb549dc1f5c)

(Bitbake rev: dcf52157d3635925491783be656c6b76d1efe1a4)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-23 12:08:56 +00:00
Ross Burton
3e314814bf bitbake: bitbake: knotty: display active tasks when printing keepAlive() message
In interactive bitbake sessions it is obvious what tasks are running
when one of them hangs or otherwise takes a long time. However, in
non-interactive sessions (such as automated builds) bitbake just prints
a message saying that it is "still alive" with no clues as to what tasks
are active still.

By simply listing the active tasks when printing the keep alive message,
we don't need to parse the bitbake log to identify which of the tasks
is still active and has presumably hung.

(Bitbake rev: f9f57fb7d2c8a13df1eb9d5b9766f15e229dcf97)

(Bitbake rev: 30f6c3f175617beea8e8bb75dcf255611e3fc2fd)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-23 12:08:56 +00:00
David Reyna
c71a9c89e3 bitbake: toaster: race condition for end-of-build
Force a sync point for end-of build event handler force
the build's outcome status commit, to resolve a race
condition with the build completion takedown.

[YOCTO #14765]

(Bitbake rev: f76c13536e19d2401365c0fc240ef8dbcb3ee7e8)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-21 10:07:40 +00:00
Tim Orling
377c744340 bitbake: bitbake: buildinfohelper.py fix for Django 3.2
connection.features.autocommits_when_autocommit_is_off
was deprecated in 3.0 and is no longer present in 3.2

(Bitbake rev: cc0f526fb4298349d0eea44c8f35d3dd226cc8d6)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-15 08:40:09 +00:00
Peter Kjellerstedt
aae4f55d1b bitbake: knotty.py: A little clean up of TerminalFilter::updateFooter()
* Use max() to clamp progress to >= 0.
* Be consistent when evaluating self.quiet (treat it as a boolean).

(Bitbake rev: 160f71372ff93894d9314619e9d3b547c1f3cda3)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-11 06:56:01 +00:00
Peter Kjellerstedt
af7a4af979 bitbake: knotty.py: Correct the width of the progress bar for the real tasks
In commit 8055ec36 (knotty: Improve setscene task display) the setscene
tasks got their own line in the task output. However, the progress bar
code does not handle newlines in its widgets, so the length of the
setscene line was included when calculating how much space is available
for the progress bar of the running tasks, making it much too short.

Instead of trying to teach the progress bar code to handle newlines,
separate the output of the setscene tasks from the progress bar for the
real tasks.

(Bitbake rev: a41f7792f17acdba8c7ea83b79e413ae6a49da68)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-11 06:56:01 +00:00
Peter Kjellerstedt
553856138c bitbake: knotty.py: Improve the message while waiting for running tasks to finish
Use pluralise() to correct the grammar, and drop the colon at the end if
runnning in quiet mode.

(Bitbake rev: 57396289f935892390c11afe95f3eede28fd80e7)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-11 06:56:01 +00:00
Richard Purdie
46163db74b bitbake: uievent: Fix import warning for python 3.10
(Bitbake rev: bf1de5988698c797403ecd30edda99a76e9c02dd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-10 15:25:47 +00:00
Richard Purdie
e95fedc49c bitbake: knotty: Improve setscene task display
There is general agreement the current display of the total setscene and
executed full tasks is confusing. Fixing it is tricky to be clear to new
users whilst not wasting screen real estate for experienced users and not
compromisng features like the progress bar.

As a compromise, move the setscene total to the previous line making
the status display a two line summary for interactive terminals. This
makes it clear what two of the numbers represent (setscene task) whilst
separating this out from the other items.

Also tweak the non-interactive output to use a comma as a separator,
the use of the forward slash was a poor choice.

(Bitbake rev: 8055ec360507e6a678ee5c4018ec1ab7f5a9cce5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-06 17:38:30 +00:00
Richard Purdie
c9b71a9817 bitbake: knotty: Correctly handle multiple line items
Currently the footer code doesn't quite handle multiline items correct.
Fix this to do so.

(Bitbake rev: 8eeccf73185d986c6abd6426b1d1e72da3a982df)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-06 17:38:30 +00:00
Richard Purdie
478cb0ce2c bitbake: data_smart/cookerdata: Add variable remapping support
This change adds support for improving the user experience when variables
are renamed. This isn't as simple as it might first appear since some
bitbake variables are used through the environment before the datastore
exists, some are bitbake variables which we know about straight away
and some are metadata defined which we don't know about until later.

This patch adds support for handling these different cases, allowing a list
of bitbake renamed variables to be defined in bitbake itself and allows this
to be extended through the metadata using BB_RENAMED_VARIABLES.

In order to give the best feedback to the user, we default to turning on
variable history tracking in the base data store from knotty, which allows
filename and line number information to be shown.

(Bitbake rev: bd50a5d5e4b4fa90844464396887ebdff0d4e5f7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-21 23:37:26 +00:00
Richard Purdie
dac63330e6 bitbake: msg: Add bb.warnonce() and bb.erroronce() log methods
This adds a log level and logging function call to use it where the
warning or error will only be displayed once, regardless of how many
times the message is logged.

This has to be done either in the cooker or on the UI side. I've opted
for the UI side since display control is really a UI issue but it uses
a common library filter function to enable it which can be reused
elsewhere.

The knotty message displayed as the build summary is tweaked to
make sense when the numbers won't match since it will still count
the number of times it was logged and this is probably helpful
for debugging in some cases so I've deliberately left it that way.

(Bitbake rev: 7bd40e3003a043e3cb7efc276681054b563b5e7b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-17 17:51:03 +00:00
Richard Purdie
34e4eebc32 bitbake: lib/bb: Fix string concatination potential performance issues
Python scales badly when concatinating strings in loops. Most of these
references aren't problematic but at least one (in data.py) is probably
a performance issue as the issue is compounded as strings become large.

The way to handle this in python is to create lists which don't reconstruct
all the objects when appending to them. We may as well fix all the references
since it stops them being copy/pasted into something problematic in the future.

This patch was based on issues highligthted by a report from AWS Codeguru.

(Bitbake rev: d654139a833127b16274dca0ccbbab7e3bb33ed0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
9abab49f2b bitbake: lib/bb: Clean up use of len()
(Bitbake rev: bbbc843e86639604d00d76b1949b94a78cf1d95d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Richard Purdie
0f939ecaf8 bitbake: knotty/uihelper: Show setscene task progress in summary output
With the changes to task accounting, bitbake doesn't show progress
when executing setscene tasks on the summary console output.

Change to show a progress within the setscene tasks and a progress
within the main tasks. I can't see any way to display this more easily
without confusing users.

[YOCTO #14586]

(Bitbake rev: 0244acb968eb593d2ad7bc6e52f222c2b1d39aa9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 16:45:06 +01:00
Richard Purdie
6b52061123 bitbake: runqueue/knotty: Improve UI handling of setscene task counting
The recent fixes to merge setscene and normal task accounting in runqueue
fixed some display issues but broke the task numbering of setscene tasks.

Add new accounting methods to the stats structure specifically designed
for setscene. This accounts for the fact that setscene tasks can rerun
multiple times in the build.

Then use the new data in the UI to correctly display the numbers the
user wants to see to understand progress.

(Bitbake rev: ed7e2da88bf4b7bfc7ebfc12b9bd6c0fb7d8c1aa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-17 07:26:23 +01:00
Richard Purdie
15c87c405f bitbake: runqueue: Clean up task stats handling
When we parallelised normal and setscene tasks, the task stats
handling was left separate pending further thought. We had to remove
handling of the setscene tasks from the UI in order to maintain
consistent task numbering.

Currently, "0 of 0" tasks can be shown as setscene tasks execute
until the first normal task runs.

The only use left for sq_stats is in the active task numbers which
we can use the length of sq_ive for instead. We can therefore
drop it and return stats in all cases. This removes the "0 of 0" task
problem since the stats in all normal and setscene tasks matches.

[YOCTO #14479]

(Bitbake rev: eae6e947e37e18cded053814bd2a268b44fb25cd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-11 22:39:19 +01:00
Richard Purdie
5f4e335c8e bitbake: ui/taskexp: Fix to work with empty build directories
If run on an empty build directory, taskexp wasn't working as it didn't
send the current environment to the server. This means HOSTTOOLS in oe-core
couldn't be built and gave an error. Add the missing updateToServer call in.

[YOCTO #14408]

(Bitbake rev: 06a0bbe746f879ae539223e7fdb6f07d55d13719)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-06 06:34:58 +01:00
Richard Purdie
0e3c7594cb bitbake: ui/taskexp: Improve startup exception handling
When an exception occurs at startup, show it to the user.

[YOCTO #14408]

(Bitbake rev: cc1df1af67cfd3e223b39e2b7ea5f86b8cf78aee)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-06 06:34:58 +01:00
Joshua Watt
f3e1a668fb bitbake: knotty: Re-enable command line logging levels
The "-l" command line options to enable specific logging domains wasn't
working with the switch to structured logging because they were only
being used to set the legacy logging domains. Fix this by implementing
the logic to parse the user options into the logging configuration.

(Bitbake rev: 005fc7a8c588d0b0bca382469645cbf481ad8e30)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-01 22:51:06 +01:00
Joshua Watt
75f87db413 bitbake: logging: Make bitbake logger compatible with python logger
The bitbake logger overrode the definition of the debug() logging call
to include a debug level, but this causes problems with code that may
be using standard python logging, since the extra argument is
interpreted differently.

Instead, change the bitbake loggers debug() call to match the python
logger call and add a debug2() and debug3() API to replace calls that
were logging to a different debug level.

[RP: Small fix to ensure bb.debug calls bbdebug()]
(Bitbake rev: f68682a79d83e6399eb403f30a1f113516575f51)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-10 23:48:16 +00:00
Hongxu Jia
37b51ed076 bitbake: Revert "bb.ui: delete __init__.py to make bb.ui a namespace package"
The commit [991f92b4d bb.ui: delete __init__.py to make bb.ui a
namespace package] caused `bitbake -h' failed
...
$ bitbake -h
Traceback (most recent call last):
  File "/buildarea/raid5/hjia/community/poky/bitbake/bin/bitbake", line 35, in <module>
    sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
  File "/buildarea/raid5/hjia/community/poky/bitbake/lib/bb/cookerdata.py", line 27, in __init__
    self.options, targets = self.parseCommandLine(argv or sys.argv)
  File "/buildarea/raid5/hjia/community/poky/bitbake/lib/bb/main.py", line 297, in parseCommandLine
    options, targets = parser.parse_args(argv)
  File "/usr/lib64/python3.6/optparse.py", line 1387, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib64/python3.6/optparse.py", line 1431, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib64/python3.6/optparse.py", line 1536, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/lib64/python3.6/optparse.py", line 785, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib64/python3.6/optparse.py", line 807, in take_action
    parser.print_help()
  File "/usr/lib64/python3.6/optparse.py", line 1647, in print_help
    file.write(self.format_help())
  File "/usr/lib64/python3.6/optparse.py", line 1635, in format_help
    result.append(self.format_option_help(formatter))
  File "/usr/lib64/python3.6/optparse.py", line 1615, in format_option_help
    result.append(OptionContainer.format_option_help(self, formatter))
  File "/usr/lib64/python3.6/optparse.py", line 1061, in format_option_help
    result.append(formatter.format_option(option))
  File "/buildarea/raid5/hjia/community/poky/bitbake/lib/bb/main.py", line 54, in format_option
    valid_uis = list_extension_modules(bb.ui, 'main')
  File "/buildarea/raid5/hjia/community/poky/bitbake/lib/bb/main.py", line 72, in list_extension_modules
    pkgdir = os.path.dirname(pkg.__file__)
AttributeError: module 'bb.ui' has no attribute '__file__'
...

This reverts commit 991f92b4d15b0571b6a540964e5216d1b9728539

(Bitbake rev: 22b8c53205f8915b33d1e0ad6a666dcacc01491d)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-24 15:26:12 +00:00
Chris Laplante
d8babbe08a bitbake: bb.ui: delete __init__.py to make bb.ui a namespace package
This would permit creation of third-party UI modules without having to
incorporate them directly into BitBake, with BitBake able to
automatically discover them in the same way it finds its built-in UIs.

See https://packaging.python.org/guides/packaging-namespace-packages/

(Bitbake rev: 991f92b4d15b0571b6a540964e5216d1b9728539)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-11 10:09:18 +00:00
Richard Purdie
7cad26d585 bitbake: ui/toasterui: Fix startup faults from incorrect event sequencing
Toaster has been failing to start correctly when in interactive mode. The
issue is due to setEventMask being called (which triggers parsing) before
the environment has been sent from the UI over to the server. This means
PATH isn't setup, which causes the sanity checks on HOSTTOOLS to fail
in base.bbclass.

The fix is to ensure the environment is sent to the server before
other commands are run.

The pain in debugging this highlights other improvements to the logging
are needed.

[YOCTO #14079]

Reviewed-by: Tim Orling <timothy.t.orling@linux.intel.com>
Tested-by: Tim Orling <timothy.t.orling@linux.intel.com>
(Bitbake rev: a8efff5c83cd5a25f4b6720e6414a7aa35d04bc7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-17 12:36:14 +01:00
Tim Orling
98e5d24fa9 bitbake: lib/bb/ui/knotty: fix typo in parseprogress
After parseprogress.finish() it was intended to
set parseprogress to None, but a typo means this
is not happening.

(Bitbake rev: f504d6f6598f62aa20fbf69c30fea95569858edb)

Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-17 12:36:14 +01:00
Ross Burton
befe6d2cec bitbake: taskexp: update for GTK API changes
The introspected API for GtkTreeModel and friends had some unexpected
quirks which have now been fixed, see[1] for details. However, for
example Ubuntu 20.04 has the fixed GTK but not an updated pygobject which
means taskexp raises an exception on startup.

Solve by manually looking at what functions are present and calling the
right one.

[ YOCTO #14055 ]

[1] 9cdbc56fba

(Bitbake rev: ac7d1114a7e99e6efd6a37b03d170faf678513fb)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-24 22:34:16 +01:00
Richard Purdie
a6709152e9 bitbake: process/knotty: Improve early exception handling
The new server startup code means exceptions can happen when we aren't
setup to show them to the user correctly, leading to ugly tracebacks.

Add in some special case handling of BBHandledException to at least
ensure that common case doesn't traceback and the user sees meaningful
output.

In the future, the logging setup can likely be improved, as can the way
runCommand handles exceptions, they all should likely become real
exceptions again on the UI side.

[YOCTO #14022]
[YOCTO #14033]

(Bitbake rev: 6059d0e77f60ddb679049bd34478f41b1ab7995d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-02 16:01:05 +01:00
Frazer Clews
abc6f864b9 bitbake: lib: fix most undefined code picked up by pylint
Correctly import, and inherit functions, and variables.
Also fix some typos and remove some Python 2 code that isn't recognised.

(Bitbake rev: b0c807be5c2170c9481c1a04d4c11972135d7dc5)

Signed-off-by: Frazer Clews <frazerleslieclews@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-25 18:14:53 +01:00
Chris Laplante
ae79d6ecc6 bitbake: ui/teamcity: don't use removed logging classes
Allows the TeamCity frontend to be used again.

(Bitbake rev: c5477ba79fcad4a887808dd0df9cfe3554e2c17a)

Signed-off-by: Chris Laplante <mostthingsweb@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-08 12:12:45 +01:00
David Khouya
31c4731c8e bitbake: lib/ui/taskexp: Fix missing Gtk import
Adding back gtk objects import.

Fix bug introduce when adding validation on gtk import.

(Bitbake rev: 765be5ef60668f8a1cfbcba248f4995725807196)

Signed-off-by: David Khouya <dakhouya@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-07 17:49:36 +01:00
David Khouya
64f2361c5b bitbake: lib/ui/taskexp: Validate gi import
When running bitbake -g -u taskexp without having gi python module or
and invalid gtk version, bitbake fails with a stack trace.

In case of import or version error, bitbake should exit with an error
message instead of a stack trace.

(Bitbake rev: 2a2c507f239b047f34765312df4168030e38b90d)

Signed-off-by: David Khouya <dakhouya@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-06 13:47:45 +01:00
Joshua Watt
bf7d68c812 bitbake: knotty/msg: Use logging.shutdown() instead of bb.msg.cleanupLogging()
The logging module provides a shutdown() function that does the same
thing in a much better way

(Bitbake rev: 970cd2fc4f0bbc93069dee5a15a608dd76081c67)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-13 11:29:23 +00:00
Joshua Watt
5ce50b3ce7 bitbake: knotty: Treat verbconsole as a console output
The BitBake.verbconsole needs to be treated like a console output logger
(meaning that the TerminalFilter attaches an InteractConsoleLogFilter to
it), even if it's not directly attached to the root 'BitBake' logger.
First, assign a special "is_console" property to the relevant handlers,
then look for the property in the handlers from the configuration object
return by bb.msg.setLoggingConfig(). Finally, pass the list of all
handlers to the TerminalFilter object; it doesn't care about the
difference between console and errconsole, so pass all the relevant
handlers as a list.

This fixes cases where the console output was corrupted when messages
were sent to the 'BitBake.verbconsole' handler.

(Bitbake rev: 2010be588c74a99256df7b565a309c84c2973546)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-13 11:29:23 +00:00
Joshua Watt
b2d55ec1eb bitbake: knotty: Update hash equivalence logging
Updates hash equivalence logging so that the interesting VERBOSE
messages are always logged to the consolelog file so that issues in
individual user builds can be diagnosed. The autobuilder logging config
then updates this so that they also are shown on stdout, since the
consolelog file is not capture there.

In order to facilitate this, 2 new logging handlers were added,
"BitBake.verbconsole" and "BitBake.verbconsolelog". Neither of these
handlers are attached to anything by default, but they will log any
messages that wouldn't otherwise be logged by the normal console or
consolelog handlers. Users can attach whatever loggers the desire to
this handler to get them to appear on the console or in the consolelog,
as demonstrated by the autobuilderlog.json file.

(Bitbake rev: 766587c0baaaeb5cda3e9454395edbb70e33f756)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-13 11:29:23 +00:00
Joshua Watt
c8b2694cd4 bitbake: knotty: Add logging cleanup
Adds code to close all loggers when bitbake exits. This prevents
unclosed file ResourceWarnings. A form of this closing existed
previously, but was removed in the new logging code.

(Bitbake rev: b3f3779adf63c0d970462a558a6205da1d30c0ed)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-13 11:29:23 +00:00
Joshua Watt
1c9874b9f3 bitbake: knotty: Setup logs with config helper
Sets up logging in knotty to use python's structured logging config and
the bb.msg.setLoggingConfig() helper to setup logging. This allows the
user to specify additional logging mechanism in a config file with
BB_LOGCONFIG

(Bitbake rev: 646a68a49364b50a42168b4b16308f7217eec0dc)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-13 11:29:23 +00:00
Joshua Watt
300fd2a659 bitbake: knotty: Remove dependency on format variable
Passing around the log formatter variable was unnecessary since the log
levels of interest can be accesses as class members of
bb.msg.BBLogFormatter. Switching to do this will make using the
structured python logging much easier, since it can be difficult to
extract out the formatter for a specific handler.

(Bitbake rev: c1c867df24b4ef204027d485acac7c75c63f2bc0)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-13 11:29:23 +00:00
Joshua Watt
ae6e0e0a51 bitbake: knotty: Add commented logging_tree code
Adds a comment section that can be easily uncommented to enable dumping
the logging tree. This module is extremely useful for debugging issued
with logging configuration

(Bitbake rev: 30461310915f911b80f92e03df694af7c1eb1f46)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-13 11:29:23 +00:00
Joshua Watt
77fbe09245 bitbake: knotty: Handle logging messages with specific logger
Handles the log messages from the bitbake server with the specific
logger that the event originated from. This allows hierarchical logging
configurations to work as expected.

(Bitbake rev: 9624d42133e024fd044d0d089c7017ed53eed874)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-13 11:29:23 +00:00