Files
poky/bitbake
Richard Purdie 11698e027d bitbake: server/process: Improve lockfile handling at exit
If memory resident bitbake is active and the build directory is renamed upon
build completion, several bad things can happen:

* the old build directory could be re-created to contain a lockfile
  leaving an empty directory behind
* a lockfile for a new build could be found and attempt to be locked

This patch avoids creating an empty directory (not perfectly, but should
work in the majority of cases - an empty directory is cosmetic).

It also now compares the lock file contents to it's own pid and
just exits if it doesn't match, it is clearly then belonging to some
new process.

This will be combined with bitbake shutdown calls on the autobuilder to
ensure "saved" build directories, or build directories being deleted by
clobberdir don't do strange things.

(Bitbake rev: b986eac18b6a8bf633f5ef15f32f68de4c86173b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-14 14:33:00 +00:00
..
2010-08-04 16:12:39 +01:00

Bitbake

BitBake is a generic task execution engine that allows shell and Python tasks to be run efficiently and in parallel while working within complex inter-task dependency constraints. One of BitBake's main users, OpenEmbedded, takes this core and builds embedded Linux software stacks using a task-oriented approach.

For information about Bitbake, see the OpenEmbedded website: https://www.openembedded.org/

Bitbake plain documentation can be found under the doc directory or its integrated html version at the Yocto Project website: https://docs.yoctoproject.org

Bitbake requires Python version 3.8 or newer.

Contributing

Please refer to https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded for guidelines on how to submit patches, just note that the latter documentation is intended for OpenEmbedded (and its core) not bitbake patches (bitbake-devel@lists.openembedded.org) but in general main guidelines apply. Once the commit(s) have been created, the way to send the patch is through git-send-email. For example, to send the last commit (HEAD) on current branch, type:

git send-email -M -1 --to bitbake-devel@lists.openembedded.org

Mailing list:

https://lists.openembedded.org/g/bitbake-devel

Source code:

https://git.openembedded.org/bitbake/

Testing

Bitbake has a testsuite located in lib/bb/tests/ whichs aim to try and prevent regressions. You can run this with "bitbake-selftest". In particular the fetcher is well covered since it has so many corner cases. The datastore has many tests too. Testing with the testsuite is recommended before submitting patches, particularly to the fetcher and datastore. We also appreciate new test cases and may require them for more obscure issues.

To run the tests "zstd" and "git" must be installed. Git must be correctly configured, in particular the user.email and user.name values must be set.

The assumption is made that this testsuite is run from an initialized OpenEmbedded build environment (i.e. source oe-init-build-env is used). If this is not the case, run the testsuite as follows:

export PATH=$(pwd)/bin:$PATH
bin/bitbake-selftest