Commit Graph

6033 Commits

Author SHA1 Message Date
Richard Purdie
0d81d82645 bitbake: fetch/git : Use cat as pager
We don't have less in HOSTTOOLS in OE and this can confuse git. Force the
pager to cat to be consistent and minimal everywhere.

(Bitbake rev: 59c16ae6c55c607c56efd2287537a1b97ba2bf52)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d3d406e8552fdd865dc58b419a84411736475ad2)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Roland Hieber
fe1a4d1240 bitbake: cache: correctly handle file names containing colons
File names containing colons cause split() to return a list with more
than two elements, which will lead to a stack trace ending in:

    ValueError: too many values to unpack (expected 2)

Split only once at the last colon, thereby making sure that only two
elements are returned.

(Bitbake rev: e14ed7dd866334ab40cd335d9c006e5d7b447abd)

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a70a7376a8708bde07959deb5d5842d7f84ee5f8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
dc41a59eaa bitbake: runqueue: Fix sig file location when using multiconfig
We're using the wrong data store when trying to locate siginfo files,
fix this. Thanks to Gregory Lumen <gregorylumen@microsoft.com> for
spotting.

[YOCTO #14774]

(Bitbake rev: 7eb0ef75fd08b6e4ca1e9dca9c96a7b590e5147b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0ed800e19a3197f8e622c8d3b630aae384e60aba)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Robert Yang
b34c299467 bitbake: fetch2/ssh.py: decode path back for ssh
The path has been encoded by urllib.parse.quote(), so decode it back for ssh.

Fixed when fetch from PREMIRRORS via ssh:
$ bitbake bonnie++ libsigc++-2.0 -cfetch

scp: /path/to/downloads/libsigc%2B%2B-2.10.7.tar.xz: No such file or directory

(Bitbake rev: 3969786a787eea34e096b932d52cd02978aacb8e)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c1c8fc678eb4783cea3974328a5fa8d1b79f1266)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
b6df0485bc bitbake: fetch2/osc: Add missing parameter
This probably means the osc fetcher isn't being used but fix the missing
parameter.

(Bitbake rev: 73fbb743a2def2037d4053605e77e09d2d8a9fd0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a23c201cb6efc5c0abf763c26f905442f0eebb68)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
719b4e733b bitbake: buildinfohelper: Drop unused variables
(Bitbake rev: 97e150550a3807c60cfa685abda8dccafc0a1268)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d720dfa40620e64a557edef527148d58fcb1d858)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
455c7b4393 bitbake: runqueue: Drop pointless variable assignment
This is set at the start of the loop anyway so it does nothing. Drop
the pointless code.

(Bitbake rev: dcf78788daa177bf5c438f33b3c9f7ced7aea8ab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e6a3173c9cdf349ccbd4cf612868f92cce8717c8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
2de11757c4 bitbake: persist_data: Use a valid exception for missing implementation
(Bitbake rev: 1e5c5efa6fe9175b27b21cd7a5b833bd3af55238)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 7254eb6b3e8ef504ef2274541dcc55f1d42238c6)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
1d847bb2cf bitbake: ui/knotty: Drop pointless pass statement
(Bitbake rev: 00f10fe95393728e94339f3512171ebab96f1900)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 625565087d8c9e7a6a79b0b4f3e5be2d77d5f100)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
5eb655e42b bitbake: siggen: Drop pointless break statement
(Bitbake rev: f9b563dc02535b594975ac0f5dab8e12d11a6ce0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 42809f6acb79e39042e81d54c28efb92b7481e44)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
08ee5cf2ea bitbake: fetch2/crate: Drop unused import
(Bitbake rev: 43bb92a2728832eeb1a207809e21404c86ff1710)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 879f17ecd5ba09e217cef74f6a51339b145e8ef5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
98472efbca 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: d739799a1e68dc2ad0414d4ae7d9e079cedcee3c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3bcb20f025907f4e88bbe3d14f5638d5f01010cb)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
2c3009eb3a bitbake: msg: Drop unused local variable
(Bitbake rev: 609d50a6ccb6f794a3ba6d73a820927eba68891c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 140929b404ee1e2f5e0e1a3a1d3aa49fb3759ade)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
ba1a9588f0 bitbake: cooker: Drop unused loop
(Bitbake rev: c6df0e68ef52c10be9e8773e660c3bb5c9d1e915)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1c811ad6f10560e7a7fb6830cf83707551ba04bd)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
91cca6ad72 bitbake: ui/buildinfohelper: Drop unused import
(Bitbake rev: bf221631e4b591c80aadd26c2328586b6a4c9eac)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit aca0ff85109f4b0f3c201c02c3f59cad7ee2e787)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
e62e1284a0 bitbake: server/process: Drop unused import
(Bitbake rev: 65413c1cecc7e667b04d73b95de9159c688f7ce3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 543315e6463f15ca7ab2b4ef3e8ed41bb4207ccf)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Richard Purdie
6cb50fc2a1 bitbake: tests/parse: Fix one test overwriting another
Fix an issue where two tests have the same name with one overwriting the
other.

(Bitbake rev: 38842a8150f44f5d31d9bd2b0b6ec0502acc971d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit da812d938fd79e2cc7bdf355ccf5b0f9ead684c4)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Matt Madison
a550f8333f bitbake: providers: use local variable for packages_dynamic pattern
During parsing, Python raises

   RuntimeError: dictionary changed size during iteration

in getRuntimeProviders, if you happen to have a recipe
with an explicit RDEPENDS on a dynamic package containing a '+'
character, such as 'gtk+3-locale-en'.

This is because we're using the modified pattern as the
key into the packages_dynamic dict to append to rproviders,
and since that key doesn't exist, the dict is getting modified
to add a new, empty, entry for it. So even without the runtime
error, we'd be generating an incorrect result.

Fix this by using a local variable for modifying the pattern
and using the original key to retrieve the value on a match.

(Bitbake rev: 69d3b86449be23b07f794e302f6e18f3a2c46424)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 07de375c3e57f17ab7b47569186f24ecd9896825)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-12 13:41:42 +01:00
Ricardo Salveti
af5cb9d6fe bitbake: fetch2/crate: fix logger.debug line
logger.debug was giving an integer value (2) as event message, causing
knotty to crash when running with debug enabled.

bitbake/lib/bb/ui/knotty.py", line 685, in main
  event.msg = taskinfo['title'] + ': ' + event.msg
TypeError: can only concatenate str (not "int") to str

Same issue also happens in the original code that was taken from
oe-core (openembedded-core/meta/lib/crate.py honister) / meta-rust.

(Bitbake rev: c212b0f3b542efa19f15782421196b7f4b64b0b9)

Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-15 17:30:34 +01:00
Peter Kjellerstedt
c679713a72 bitbake: pyinotify.py: Simplify identification of which event has occurred
Use bitwise operators to manipulate the received event mask in
_ProcessEvent.

Also minor clarification & clean up of the related comments.

(Bitbake rev: 2ab60c7be124d928d304ab1fb73f0dbff29964ae)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-14 09:48:33 +01:00
Schmidt, Adriaan
33b929192e bitbake: bitbake-diffsigs: make finding of changed signatures more robust
In `runtaskhashes`, the keys contain the absolute paths to the recipe. When
working with shared sstate caches (where these absolute paths can be different)
we see that compare_sigfiles does not identifiy a changed hash of a dependent
task as "changed", but instead as "removed"&"added", preventing the function
from recursing and continuing the comparison.

By calling `clean_basepaths` before comparing the `runtaskhashes` dicts, we
avoid this.

(Bitbake rev: 7358378b90b68111779e6ae72948e5e7a3de00a9)

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-14 09:48:33 +01:00
Richard Purdie
73fa855f6a bitbake: ast: Improve function flags handling for EXPORT_FUNCTIONS
Currently, if you use one of the functions from EXPORT_FUNCTIONS,
the meaning of cleandirs and fakeroot are lost. This leads to the function
changing in behaviour depending upon it's caller context. This isn't intended
so add mapping for the cleandirs and fakeroot flags too.

This does break devtool in OE-Core and there is a separate fix for that.

[YOCTO #8621]

(Bitbake rev: b074f4aff00923acc5bf6649d204d541a79fd2b6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-14 09:48:33 +01:00
Pavel Zhukov
6ec07ea632 bitbake: fetch2: Add GIT_SSH_COMMAND to the list of exports
GIT_SSH_COMMAND is more convinient to use if arguments have to be passed
and the user doesn't want to create a wrapper script around ssh.

(Bitbake rev: 5e746cb9d26ce87d6c9d52d9022122081a9811c5)

Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-14 09:48:33 +01:00
Olaf Mandel
d1f254d56f bitbake: fetch2/git: canonicalize ids in generated tarballs
Change the owner information in the mirror tarballs generated using
BB_GENERATE_MIRROR_TARBALLS="1". This is an extension of commit
0178ab83, which used the original pokybuild:user information, but failed
to clean up the numerical user and group ids. Now set the more canonical
values of oe:oe and 0:0.

(Bitbake rev: 37437115d3fb1a9f5d8ed7356a0fc01a408e4f8c)

Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com>
CC: Marek Vasut <marex@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-14 09:48:33 +01:00
Richard Purdie
73d0fcf5d5 bitbake: checksum: Allow spaces in URI filenames
If there are spaces in the URI filenames it can break the code.
We already solved this issue once somewhere else in the code so
use the same regex trick here as well.

We should ultimately refactor this code but at least fix the issue
for now.

(Bitbake rev: 57e2fc4d7f60afea4d4b2c84761324dd99e74a87)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-14 09:48:33 +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
Richard Purdie
6b2ca96434 bitbake: data: Fix accidentally added parameter
This was only meant to be added for the handle_contains function in
a previous commit, fix it.

(Bitbake rev: 7399be398df39bc29e1b5eaac23b29cfae017abd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-04 10:59:56 +01:00
Richard Purdie
dfc910bdc2 bitbake: pyinotify: Handle potential latent bug
The kernel inotify code can set more than one of the bits in the mask,
fsnotify_change() in linux/fsnotify.h is quite clear that IN_ATTRIB,
IN_MODIFY and IN_ACCESS can arrive together. We don't care about two
of these from a bitbake perspective but it probably explains why in
real world builds, we've seen:

pyinotify.ProcessEventError: Unknown mask 0x00000006

This module code assumes only one mask bit can be present. Since we
don't care about two of these events, just mask them out for now.
The "upstream" code is unmainained since 2015.

(Bitbake rev: 7fb93c2ce6dacd9b53fc3a227133a3493e6a6a1d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-03 17:51:26 +01:00
Richard Purdie
d0082265d5 bitbake: cooker: Reset and rebuild inotify watches
The recent inotify changes can cause entire build trees to be monitored
which is suboptimal for performance.

Rather than trying increasingly convoluted tricks to try and handle add/removed
directories, rebuild the inotify watch when we reparse the configuration or
metadata.

(Bitbake rev: 3df322a200c28b45af1f2c92478c85eb7d20c38b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-03 17:51:26 +01:00
Richard Purdie
496cbc01ca bitbake: server/process: Disable gc around critical section
The python gc can trigger whilst we're holding the event stream lock
and when cleaning up objects, they can trigger warnings. This translates
into a new event which would then need the lock and we can deadlock.

Disable gc whilst we hold that lock to avoid this unfortunate and
problematic situation.

(Bitbake rev: 96a6303949cefd469bcf5ed250ff512271354357)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-03 17:51:26 +01:00
Richard Purdie
70d6360602 bitbake: data: Ensure vardepsexclude or BB_BASEHASH_IGNORE_VARS covers contains items
Adding bb.utils.filter('WARN_QA', 'patch-fuzz', d) when WARN_QA is in
BB_BASEHASH_IGNORE_VARS or in vardepsexclude should not add a dependency
on WARN_QA.

Fix it and add some tests.

(Bitbake rev: 6aecc2fe51a52020f6f13be08449e18d42e7a6b5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-03 17:51:26 +01:00
Richard Purdie
b868387c42 bitbake: parse: Ensure any existing siggen is closed down first
We're still seeing issues with unclosed asyncio event loops. At the
init site, make sure any existing one is closed first to try and avoid
this.

(Bitbake rev: 78dee3c03c75a27531fcff26f9298fce2519bdde)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-03 17:51:26 +01:00
Richard Purdie
1976521190 bitbake: cooker: Avoid error if siggen wasn't setup
In some cases we'd never have setup a siggen so don't error in that case.

(Bitbake rev: bbaaf2cf7b5a9339d3790610e622020c19d52f5a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:14:01 +01:00
Richard Purdie
9b8eda7eb3 bitbake: cooker: Ensure any existing hashserv connection is closed
Ensure any exiting hash server connection is terminated before we start
a new bitbake session. This avoids errors seen with memory resident bitbake
when the asyncio event loop isn't closed correctly.

(Bitbake rev: 42ff9de77f24e2a0bec48a14b64c4b538e00b4af)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:14:01 +01:00
Richard Purdie
b731e47eeb bitbake: cooker: Restore sys.path and sys.modules between parses
When memory resident bitbake is active and we re-parse, the old module
configuration is present which can lead to strange errors. Reset this
when reparsing so the state is consistent. This fixes memory resident
bitbake errors.

(Bitbake rev: 951942c3c284ec2c62e730e145688033190af9b2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:14:01 +01:00
Richard Purdie
fd1a6bad77 bitbake: cooker: Further fixes to inotify to fix memres bitbake issues
The previous fix for inotify wasn't quite correct as we need to modify
bbseen before calling add_filewatch(). We also need to ensure the parse
mtime cache is cleared when directories are added/removed. There was also
a typo in the original fix and the wrong watcher was being changed. Fix
the various issues which improves memory resident bitbake testing results.

(Bitbake rev: 66cadd6be58bce5f7a56556cf92efd8159fb0b0e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:14:01 +01:00
Richard Purdie
f6cdd19553 bitbake: build: Add missing parameter to TaskInvalid
Fixes:

File "bitbake/lib/bb/build.py", line 585, in _exec_task
  event.fire(TaskInvalid(task, d), d)
TypeError: __init__() missing 1 required positional argument: 'metadata'

(Bitbake rev: 16ea4429344e36ff022616abd7fa74e5964b6d6a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-30 13:05:03 +01:00
Richard Purdie
4a5a2e67a8 bitbake: cooker: Rework force parser shutdown
The "force" option to parser shutdown was often the cause of lockups and
there is no good reason we should have two different behaviours.

Change and unify the codepaths to always:
  * Wait for longer for a controlled shutdown of a process (0.5s). Usually
    it will be much faster if it has finished so the delay doesn't really matter.
  * Send processes a SIGINT
  * Failing that, send a SIGTERM
  * Call .close() if available to release zombies

This means we no longer need the "force" parameter to the function so it is removed.

(Bitbake rev: de88c62ef873e9fce78ba162f5311d846de96f2b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-30 13:05:03 +01:00
Richard Purdie
928bcb10a4 bitbake: cooker/process: Fix signal handling lockups
If a parser process is terminated while holding a write lock, then it
will lead to a deadlock (see
https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Process.terminate).

With SIGTERM, we don't want to terminate holding the lock. We also don't
want a SIGINT to cause a partial write to the event stream.

I tried using signal masks to avoid this but it doesn't work, see
https://bugs.python.org/issue47139

Instead, add a signal handler and catch the calls around the critical section.
We also need a thread lock to ensure other threads in the same process don't
handle the signal until all the threads are not in the lock.

(Bitbake rev: a40efaa5556a188dfe46c8d060adde37dc400dcd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-30 13:05:03 +01:00
Richard Purdie
c0ff6c75ee bitbake: cooker: Simplify parser init function handling
Not sure why this is so convoluted but we should simplify it!

(Bitbake rev: 6195343c46ba9d2685fc2d42366922f88ff3f369)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-30 13:05:03 +01:00
Richard Purdie
849e26181d bitbake: cooker: Improve exception handling in parsing process
If an exception occurs in the parsing process, ensure the cleanup
is called via all codepaths using a try/finally.

(Bitbake rev: e1ba2a69f1fc02f01a851bce20b1badf0b991f03)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-30 13:05:03 +01:00
Richard Purdie
af5c7cf95f bitbake: cooker: Fix main loop starvation when parsing
When parsing, the parser isn't servicing the main loop so a Ctrl+C in the
UI won't be seen on the cooker/server side. Fix this by returning when queue
timeouts occur. This helps where there is a hung or slow parsing thread.

(Bitbake rev: a2cde38311a51112dca5e7bb4e7feaf4e6a281b3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-30 13:05:03 +01:00
Richard Purdie
99f9b9b439 bitbake: cooker: Fix exception handling in parsers
We shouldn't be generating exception inside a generator. Rearrange the
code to improve the handling of this. Also fix the misconverted code
from when multiconfig was added and pass the exception as "result".

(Bitbake rev: ae89e23696de2f27c00ae00922933395171de5d5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-30 13:05:03 +01:00
Peter Kjellerstedt
279e754d86 bitbake: server/process: Correct a typo in a comment
(Bitbake rev: b4a157b2fe2fb481ffa40e0f32659d05dd6320c2)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-28 13:33:28 +01:00
Olaf Mandel
5cbdd2b483 bitbake: fetch2/git: stop generated tarballs from leaking info
When using BB_GENERATE_MIRROR_TARBALLS="1" to generate mirror tarballs
of git repositories, they leaked local information: username, group and
time of the last fetch. Remove all these by setting fixed information:

 * uname = pokybuild
 * gname = users
 * mtime = committer time of newest commit in repo

The username and group value were taken from the archives available on
the downloads.yoctoproject.org mirror. The modification time is chosen
so it still retains some relationship to the contents of the archive.

(Bitbake rev: 0178ab83e6312e97e528aa8c5e12105f5165d896)

Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-26 09:27:43 +00:00
Richard Purdie
7e273d09d0 bitbake: cooker: Fix inotify watches causing memory resident bitbake corruption
Thanks to great debugging from pavel@zhukoff.net we had a simpler reproducer
for the corruption see in oe-selftest when using BB_SERVER_TIMEOUT=60, i.e.
with bitbake in memory resident mode. This was effectively:

oe-selftest -r devtool.DevtoolUpgradeTests.test_devtool_upgrade devtool.DevtoolUpgradeTests.test_devtool_upgrade_git -j 1 -K

The issue is that if directories are removed (such as workspace), if
they are added again, we don't have the watches in place any more. This
patch adds some slightly paranoid checks to ensure we do the correct things
for directory additions and removals (we track directories, not files
specifically to avoid running out of watches).

[YOCTO #14023]

(Bitbake rev: 2c414f659d793d732041614caedd773959eb4f27)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-26 09:27:43 +00:00
Richard Purdie
cff6c1a18d bitbake: server/process: Move threads left debug to after cooker shutdown
This debug is useful but the cooker shutdown or post_serve() may have cleanup
left so run after those.

(Bitbake rev: 1463fc0448d1a6a7265806a4a8b165b610dfb43f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-26 09:27:43 +00:00
Richard Purdie
f0c28dddbe bitbake: siggen: Add missing reset handler to hashserv signature generator
When we have a client connection, we should close that connection when reset()
is called on the siggen. Add the missing function.

(Bitbake rev: 770b4ea81b6126b0830e51649c40f7a46c64132a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-26 09:27:43 +00:00
Richard Purdie
88fcf8422d bitbake: cooker/siggen: Support exit calls and use for hashserv client
We have shutdown functions within the async client code but the siggen
doesn't currently call them. We notice on python 3.10 (such as on fedora35)
that at exit, there is a stray asyncio process left behind. Usually this
doesn't cause problems but it could potentially be a cause of a hang.

For general cleanliness and completness, add in hooks to call the exit handler.

(Bitbake rev: 9ee3fb95330003878fbd64b3ce8897aad96fcd0f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-26 09:27:43 +00:00
Richard Purdie
a10ac380b7 bitbake: tinfoil: Allow run_command not to wait on events
There are some commands where we want to see the events returned so allow
the caller to request this. This also allows us to fix an infamous bug in
the tinfoil testsuite in OE-Core.

(Bitbake rev: 0e8421c41d97d5d50a553d70c8f775d521f1a199)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-26 09:27:43 +00:00