Commit Graph

7673 Commits

Author SHA1 Message Date
Richard Purdie
6b01f33b33 bitbake: utils: Print information about lock issue before exiting
(Bitbake rev: cdf6c51a064f8f335c3262b7f102618996f1a229)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-03 21:38:57 +00:00
Ross Burton
707be18cac bitbake: lib/bb/build: remove mention of OE_EXTRA_IMPORTS
This is an OpenEmbedded-specific variable that is no longer used[1].

[1] oe-core 1f56155e ("base: Switch to use addpylib directive and
    BB_GLOBAL_PYMODULES")

(Bitbake rev: 34bfa55a3c14f5d1d6bb3e31b747906fa7cb99c3)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-27 15:21:10 +00:00
Michael Estner
e1836b205a bitbake: lib: Remove double imports
* Remove double imports mentioned by pylint

(Bitbake rev: 741db6719efca5aa9ef2c15e60cdd624e4aa1a8d)

Signed-off-by: Michael Estner <michaelestner@web.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-27 15:12:55 +00:00
Chen Qi
40b5f61a8f bitbake: data_smart: fix indentation
Fix 8 spaces indentation to be 4 spaces.

(Bitbake rev: 973866d134f0493bb3034593fe03cb8bf8920c5c)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-25 15:27:28 +00:00
Antonin Godard
9a59194f22 bitbake: doc: bitbake-user-manual-ref-variables: document BB_CURRENT_MC
Document the BB_CURRENT_MC variable, which holds the name of the current
multiconfig build a task is being run under.

(Bitbake rev: 178e09ea5ea39e60452077fa2ab90b90478ada6e)

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-25 14:10:36 +00:00
Richard Purdie
ba91179519 bitbake: fetch2: Fix BB_FETCH_PREMIRRORONLY network disabling
When using BB_FETCH_PREMIRRORONLY we write to the datastore to disable the network.
This change needs to be undo when handling later urls, so operate on a copy of the
datastore to allow this.

Reported by Julian Haller <julian.haller@philips.com>

(Bitbake rev: 67a5ede8ae92ed7dcad29fd0dcfd62c6640b10b2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-25 12:49:52 +00:00
Joerg Schmidt
ae8fe5b896 bitbake: bblayers/query: Fix using "removeprefix" string method
The minimum Python version required for Yocto 5.0 is 3.8 which causes
failure in poky/bitbake/lib/bblayers/query.py when listing layers by
using command "bitbake-layers show-recipes -f --bare --mc MC" for the
given multiconfig MC.
The reason for that failure is the use of "removeprefix" string method
which got introduced in Python 3.9.
This patch replaces the "removeprefix" method with an equivalent
solution supported by Python 3.8.

(Bitbake rev: 004cfdec1c865f2351bbac99acb3d63bfef9d380)

Signed-off-by: Joerg Schmidt <joerg.schmidt@garmin.com>
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-21 13:14:22 +00:00
Michael Estner
8f69906d5e bitbake: utils: Clean up imports
* Remove double imports
* Re-roder the imports as mentioned by pylint

(Bitbake rev: 6de536bbaee8cf7664c5702a96a5ca18ad09fb9d)

Signed-off-by: Michael Estner <michaelestner@web.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-18 23:07:07 +00:00
Louis Rannou
2ae32dae58 bitbake: bitbake: tests/data: add tests for variable flags
Check default flags are correctly returned by getVarFlags and check all flags
are returned when internalflags is True.

Check delVarFlags also removes default value.

Check all flags are removed after delVar.

Run the test with:
    $ bitbake-selftest -v bb.tests.data.TestFlags
    test_delflag (bb.tests.data.TestFlags.test_delflag) ... ok
    test_delvar (bb.tests.data.TestFlags.test_delvar) ... ok
    test_setflag (bb.tests.data.TestFlags.test_setflag) ... ok

    ----------------------------------------------------------------------
    Ran 3 tests in 0.000s

    OK

This is a test case for [YOCTO #15685]

(Bitbake rev: ff8cae735cf489373af1aac7ee233d7b82d483d3)

Signed-off-by: Louis Rannou <louis.rannou@non.se.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-13 22:24:27 +00:00
Louis Rannou
0a9cfebb3a bitbake: bitbake: data_smart: fix ??= operator for variable flags
Variable flags have been fixed in commit
0329a7e3ac694737f2d2c1861f65492551360663 which introduces the
"_defaultval_flag_" prefix for default values.

This must not be ignored in delVarFlags and getVarFlags.

Fixes [YOCTO #15685]

(Bitbake rev: 2ee079fc1b7cf6d384ca17bd034b0a40461d9d18)

Signed-off-by: Louis Rannou <louis.rannou@non.se.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-13 22:24:27 +00:00
Stefan Herbrechtsmeier
c49684b48b bitbake: fetch2: clearcase: remove double DL_DIR from localfile
(Bitbake rev: bcf090ed631bbd523a5341baebba0765f1a847f8)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 21:18:39 +00:00
Stefan Herbrechtsmeier
f62042523a bitbake: fetch2: ssh: use common localpath handling
(Bitbake rev: 22ac6e84c70034a74f1729c7e0f31ca928fa1dea)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 21:18:39 +00:00
Stefan Herbrechtsmeier
170dd77e4a bitbake: fetch2: remove unnecessary unquote
The URI path is already unquoted. Remove the unnecessary unquote
function calls for URI path values.

(Bitbake rev: 3de12bbc28b5a4189b849720735cf3e268d3941d)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 21:18:39 +00:00
Stefan Herbrechtsmeier
f17c51c695 bitbake: fetch2: local: use path variable
Use the path variable from the fetch data instead of decoding the path
manually from the plain unexpanded url.

(Bitbake rev: ad3a29fa6ea53741d4e1786de35f8e7fc4292e7a)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 21:18:39 +00:00
Stefan Herbrechtsmeier
3e543e8eaa bitbake: fetch2: remove unnecessary expand function calls
The fetch data class already expands the type, host, path, user, pswd
and parm variables. The fetcher classes already expand the localfile
variable. The getVar function expands the returned string per default.
Remove unnecessary expand function calls to simplify the code.

(Bitbake rev: 1b1eb037b861fbf20491ac17e519e9eaf232b858)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 21:18:39 +00:00
Stefan Herbrechtsmeier
2935d76bb4 bitbake: fetch2: remove duplicated code in url decode and encode
Use the URI class to decode and encode an URL. Remove duplicate code and
unify the behavior.

(Bitbake rev: a5d569c94700f04b8193c6bccae5af619931b00f)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 21:18:39 +00:00
Stefan Herbrechtsmeier
851b24cf81 bitbake: tests: fetch: quote URI password as per RFC3986
The password must be quoted as per RFC3986 because it can contain
reserved characters.

(Bitbake rev: 5c53dbf0ad4385e1de7f2eef66565a1f05dae67a)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 21:18:39 +00:00
Stefan Herbrechtsmeier
34bb313e90 bitbake: tests: fetch: use lower case hostnames
Do not use upper case hostnames because the hostname is case insensitive
and maybe decoded into lower case to follow the common style.

(Bitbake rev: 554b7048412c4c67bf895a8b98822b54ac3a66db)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 21:18:39 +00:00
Stefan Herbrechtsmeier
e69304675d bitbake: tests: fetch: add test for file URI with @
(Bitbake rev: f169704ef48f04da33aaca8b1ad5d8d7eabf8fd6)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 21:18:39 +00:00
Stefan Herbrechtsmeier
2b71696f35 bitbake: fetch2: do not decode user from file URI
A file URI can't contain a user. Do not treat the @ as reserved
character for a file URI.

(Bitbake rev: 11cf4062f48536547a352e24d6e963d91fdd1190)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 21:18:39 +00:00
Quentin Schulz
64ef07f6c4 bitbake: b4-config: Add basic support for b4 contribution workflow
b4[1] is a very nice tool for mail-based contribution. A config[2] file
exists to set up a few defaults. We can use it to set the To recipients
to always add, in our case the mailing list.

This also adds a wrapper script that is called by b4 to figure out which
addresses to put as Cc recipients. Considering that patches to the doc/
directory also need to be sent to the yocto-docs mailing list, this
wrapper handles that. A limitation of the script (lsdiff actually) is
that it doesn't know how to handle empty files, but those should be
of rather rare occurrences.

Because we currently do not have anything to check for patch validity,
remove requirement for b4 prep --check to be run before sending a patch
series, via disable-needs-checking in prep-pre-flight-checks.

[1] https://pypi.org/project/b4/
[2] https://b4.docs.kernel.org/en/latest/config.html

(Bitbake rev: 8843860010c97cc10ff69205d209634639b6c5cd)

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-06 10:40:10 +00:00
Nikolai Merinov
b65452bda3 bitbake: parse: Forbid ambiguous assignments to ${.}, ${+}, and ${:} variables
Old code that parse variable names in assignment commands behave differently for
variables that ends with special symbol for single-character variable names and
multi-character variable names. For example:

  A+="1"   # Change variable ${A}, '+' glued to '='
  A+ = "1" # Change variable ${A+}

  +="1"    # Change variable ${+}, the '+' symbol not part of assignment operator
  + = "1"  # Change variable ${+}

New code would always assume that '.=', '+=', and ':=' is assignment operator.
As result code like the following would raise parsing error

  +="value"

While code with extra spaces would work as before

  + = "value" # Change variable ${+}

This change allow to catch issues in code that generate bitbake configuration
files in a manner like "echo ${VARNAME}+=${VALUE} >> conf/local.conf"

(Bitbake rev: 93059aad13a12cd69d86368795c88e5349197d5d)

Signed-off-by: Nikolai Merinov <n.merinov@inango-systems.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-05 12:11:01 +00:00
Savvas Etairidis
934828e963 bitbake: tests/parse: Add test for unclosed functions
This test covers the handling of unclosed functions.
It tests that both whitespace and tabs generate the
correct exception if added before a closing bracket.
Additionally that a residue blocks generates a error
is tested as well.

[YOCTO #15470]

(Bitbake rev: 29e67acb87ae76879efe9688a69c961a96df10f1)

Signed-off-by: Savvas Etairidis <falital@hotmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-28 14:34:36 +00:00
Richard Purdie
e72d641a99 bitbake: cooker/cache: Drop mc 'default' string value
The string value "default" for the default multiconfig is confusing since an
empty string is used pretty much everywhere in the code. Remove the few
remaining references to that to standarise.

This affects the default value of BB_CURRENT_MC and does have an impact
on metadata, particulalry bitbake.conf in openembedded-core. That said, the
number of bugs we'll avoid by trying to make "default" back to "" within
bitbake's code make fixing those extremely worthwhile.

(Bitbake rev: 0fa0d8d764bbeb8a44c47f79d7b849068d565199)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-25 11:30:51 +00:00
Richard Purdie
c996cfea52 bitbake: tests/fetch: Fix git shallow test failure with git >= 2.48
From git 2.48 release notes:

"""
When "git fetch $remote" notices that refs/remotes/$remote/HEAD is
missing and discovers what branch the other side points with its
HEAD, refs/remotes/$remote/HEAD is updated to point to it.
"""

This means with git 2.48 onwards, there is a mystery "HEAD" revision
appearing in some of our shallow clone tests. We can avoid this by
using the same canonicalization as used for the reference revisions.

This resolves autobuilder failures on the Fedora 40 workers.

(Bitbake rev: c83444d1210740e27b1744d3aa7c5cad4e28db2f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-23 00:03:06 +00:00
Richard Purdie
01c3354325 bitbake: parse/ast: Add support for BB_RECIPE_VIRTUAL_PROVIDERS
Currently, providers are set on a global config basis. This change allows
for a select set of providers configured in BB_RECIPE_VIRTUAL_PROVIDERS to
be selected on a per recipe basis. This would allow for the selection of
virtual/cross-cc as gcc or clang for example in OE-Core.

DEPENDS and task flag [depends] values are processed.

(Bitbake rev: fb119c7888ae8a749aa824f8c51780176af077f9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-21 23:09:33 +00:00
Yoann Congal
052746da9a bitbake: data_smart: fix ??= operator for variable flags
??= operator works for variable value by defining a "_defaultval" flag.

Use something similar for flags: For the default value of the flag
"flag_name", define a flag "_defaultval_flag_flagname" that is used when
reading flag_name but no other value has been set.

Fixes [YOCTO #15685]

(Bitbake rev: 0329a7e3ac694737f2d2c1861f65492551360663)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Reviewed-by: Ghislain Mangé <ghislain.mange@smile.fr>
Suggested-by: Ola Nilsson <ola.x.nilsson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-14 09:51:45 +00:00
Yoann Congal
a68fb2be37 bitbake: tests/parse: add test for ?= and ??= operators for variable flags
Run the test with:
 $ bitbake-selftest bb.tests.parse.ParseTest.test_parse_defaulttest
.
----------------------------------------------------------------------
Ran 1 test in 0.001s

OK

This is a test case for [YOCTO #15685]

(Bitbake rev: d12c80125d810df54379cc4f019a95ab9064ad2c)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Reviewed-by: Ghislain Mangé <ghislain.mange@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-14 09:51:45 +00:00
Bin Lan
33271912bf bitbake: bb/fetch2/__init__.py: remove a DeprecationWarning in uri_replace()
There is the following warning when executing to bitbake linux-yocto:
  bitbake/lib/bb/fetch2/__init__.py:464: DeprecationWarning: 'count' is passed as positional argument

This is because the 4th parameter of re.sub(pattern, repl, string, count=0, flags=0)
is a keyword parameter. We use keyword arguments for parameters that are not positional.

(Bitbake rev: 4bd62639f7023eec9f55ad7909fa9250538de936)

Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-14 09:51:45 +00:00
Stefan Herbrechtsmeier
e223f6635a bitbake: tests: utils: add test for Go mod h1 checksum
Add a basic test for the goh1_file function.

(Bitbake rev: 3dc4d28a9eed962876c148dbe69d9f521bf42287)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-11 18:35:01 +00:00
Stefan Herbrechtsmeier
f00e8e1233 bitbake: utils: add Go mod h1 checksum support
Add support for the Go mod h1 hash. The hash is based on the Go dirhash
package. The package defines hashes over directory trees and is uses for
Go mod files and zip archives.

(Bitbake rev: deefb01592f717efba68e3997fefd04dc7611d88)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-11 18:35:01 +00:00
Philip Lorenz
d60c48153d bitbake: asyncrpc: Handle websockets exceptions
The websockets library throws a number of exceptions which are currently
not caught leading to unhandled exceptions in the idle loop.

Fix this by catching them and reexposing them as a `ConnectionError`
which is the exception expected by users of `asyncrpc`.

(Bitbake rev: 41d62911a480283287265fe063696d2acd5904aa)

Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-11 18:35:01 +00:00
Richard Purdie
6ffd1a58f9 bitbake: bin/git-make-shallow: Fix syntax to work with older git versions
The transaction model was only introduced in git 2.27 whereas Ubuntu focal
(20.04) has 2.25. This causes failures. We don't need the transations here
so simply drop the commit piece, fixing on older git versions.

Credit to Nick Owens <nick.owens@eero.com> for working out how to fix it.

(Bitbake rev: 0723ec9d4cd7c9b2d46904c3a038be123feea374)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-10 09:10:06 +00:00
Nick Owens
ef7755749b bitbake: git-make-shallow: use stdin mode
when there are many refs to delete, using xargs to exec git can take a very long
time. make this faster by only running git update-ref with stdin mode.

for a repo with over 34000 git tags this makes git-make-shallow finish
in 2 seconds instead of 3 minutes for me.

(Bitbake rev: 2b815e42ec074a7f8667bbfaccaa69fc4a0ba788)

Signed-off-by: Nick Owens <nick.owens@eero.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-08 11:34:30 +00:00
Stefan Herbrechtsmeier
b242f0a007 bitbake: fetch2: read checksum from SRC_URI flag for npm
(Bitbake rev: 8d3232152e545be958f8f3b069e7477c6f310583)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-08 11:34:04 +00:00
Stefan Herbrechtsmeier
d7c6afc9a9 bitbake: fetch2: do not prefix embedded checksums
The fetcher support entries with an embedded checksum like 'sha256sum'
in the SRC_URI. It adds the parameter 'name' as prefix to the checksums
if the parameter is set. This behavior is unexpected and leads to hacks
in fetchers. Fallback to the checksum without the useless prefix and
set the parameter 'name' in the gomod fetcher unconditional.

(Bitbake rev: 7a86c5a20ea2586f1ae240613644e065e7b21683)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-08 11:34:04 +00:00
Stefan Herbrechtsmeier
e040b45ad2 bitbake: tests: fetch: replace [url] with urls for npm
Replace [url] with urls to simplify future modifications.

(Bitbake rev: 212f9406585a2a6ce6e128bb5975ea79f47c5522)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-08 11:34:04 +00:00
Stefan Herbrechtsmeier
eb0c87fa4c bitbake: fetch2: npmsw: remove old lockfile format support
Remove support for the old lockfile format. The old lockfile format is
required by npm 6 / Node.js 14 which is out of maintenance [2].

[1] https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json
[2] https://nodejs.org/en/about/previous-releases

(Bitbake rev: 7824e19483d9b60a259d6e3a4c7068fade94f2bf)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-08 11:34:04 +00:00
Stefan Herbrechtsmeier
c691d4d53f bitbake: tests: fetch: update npmsw tests to new lockfile format
Update npmsw test cases to new lockfile format. The old lockfile format
is required by npm 6 / Node.js 14 which is out of maintenance [2].

[1] https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json
[2] https://nodejs.org/en/about/previous-releases

(Bitbake rev: bb59d4fdaf8fb81aa3529e431dcdd4c3d665d742)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-08 11:34:04 +00:00
Antonin Godard
c09ea097f1 bitbake: doc: update releases.rst
Add Styhead as a supported release manual, and move Dunfell to the
outdated releases manuals.

(Bitbake rev: d726f4537f16d99512b21ab0a0f476cef832b955)

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-28 11:04:32 +00:00
Antonin Godard
34b6e34a2b bitbake: doc/bitbake-user-manual-metadata: fix unindent warnings
Fix Sphinx warnings (treated as errors on local builds):

  bitbake-user-manual-metadata.rst:979: WARNING: Bullet list ends without a blank line; unexpected unindent.
  bitbake-user-manual-metadata.rst:982: WARNING: Bullet list ends without a blank line; unexpected unindent.
  bitbake-user-manual-metadata.rst:985: WARNING: Bullet list ends without a blank line; unexpected unindent.

(Bitbake rev: 51d89ce0fc8d188bf10a8bcc6a112466268899ae)

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-28 11:04:32 +00:00
Ross Burton
c03be6b81c bitbake: fetch2/wget: correctly construct the target URL in checkstatus()
ud.path has been unescaped (eg %20 is space) but as we're reconstructing
a URL we should re-escape it. For example, unzip has a SRC_URI
containing "UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz" which
then throws exceptions if the unescaped string " (latest)" is used.

Also, this code uses the extracted ud.host and ud.path variables. These
are unescaped but potentially stale as eg the cargo fetcher subclasses
Wget() and reassigns ud.url on construction.

Simplify the code by reconstructing a URL from ud.url directly instead
of bouncing through intermediate variables that may be wrong or
unescaped.

(Bitbake rev: c9906bb289dcfd9ae41f10bd5399ccc17a4cc437)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-20 16:25:28 +00:00
Ross Burton
e8ab6bc411 bitbake: fetch2/wget: handle HTTP 308 Permanent Redirect
urllib2.HTTPRedirectHandler.redirect_request doesn't handle HTTP reponse
code 308 (Permanent Redirect). This was fixed in c379bc5 but can't be
worked around without copying the entire redirect_request() method.

When we can depend on Python 3.13, FixedHTTPRedirectHandler can be
removed.

(Bitbake rev: 365829a2803b954ee6cb0364749551a91d806075)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-20 16:25:28 +00:00
Simon A. Eugster
59c725f411 bitbake: doc: Document suffix for BBFILE_PRIORITY
(Bitbake rev: 08c340d97717e632c5185a52eec46d90359d4006)

Signed-off-by: Simon A. Eugster <simon.eu@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-20 16:21:35 +00:00
Stefan Herbrechtsmeier
f1745ce249 bitbake: tests: fetch: add npmsw test case for bundled dependencies
The npm package lock and shrinkwrap file list bundled dependencies which
are supplied together with the parent dependency. The bundled
dependencies are marked by a flag. The flag and thereby test depends on
the lock file version. The old lock file version uses a `bundled` flag
and stores dependencies in the `dependencies` list. The new lock file
version uses an `inBundle` flag and stores dependencies in the
`packages` list.

(Bitbake rev: 34fd8ea6abe755e04220fe70b082aa620ae15f86)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-20 16:18:59 +00:00
Stefan Herbrechtsmeier
02f8ea6865 bitbake: fetch2: npmsw: ignore bundled dependencies in packages
The npm package lock and shrinkwrap file list bundled dependencies which
are supplied together with the parent dependency. The flag depends on
the lock file version. Add the missing `inBundle` flag to packages list
processing.

(Bitbake rev: 042d7121ddc93c18306bf03d26ea774f66379a90)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-20 16:18:59 +00:00
Stefan Herbrechtsmeier
527e4a7958 bitbake: tests: fetch: do not skip plain npmsw tests
The npmsw fetcher doesn't use the npm command. Remove the
`@skipIfNoNpm()` decorator from plain npmsw tests which don't use the
npm fetcher.

(Bitbake rev: 48f9964a19b8e2e3a73667c9889908eceecf7719)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-20 16:18:59 +00:00
Stefan Herbrechtsmeier
243f9ea060 bitbake: tests: fetch: adapt npmsw tests to fixed unpack behavior
Adapt the npmsw tests to commit 84f102954e10 ("fetch/npmsw: The fetcher
shouldn't have any knowledge of S").

(Bitbake rev: 8194178291d9b47efb2079fe81b704ba6171efc1)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-20 16:18:59 +00:00
Richard Purdie
5cb3d1a59c bitbake: parse: Add include_all conf file directive
In some cases it would be helpful to be able to have an include file
in a standard location which is included in all layers that are added
to the system. The intent is for these to provide configuration tweaks
of specific types so that a given file pattern can be adopted more widely
for such configuration.

The code will search for any named configuration file within BBPATH, so
a configuration directive of:

include_all conf/distro/include/myinc.conf

would include the myinc.conf file in that subpath if present in any
directory in BBPATH. Multiple files will be included if present.

(Bitbake rev: d01d5593e7829ac60f37bc23cb87dc6917026471)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-17 11:48:25 +00:00
Chris Laplante
9d1b31d254 bitbake: cooker: Make cooker 'skiplist' per-multiconfig/mc
Previously, the cooker skiplist was shared across multiconfigs
(including default ''). If you had a recipe that was incompatible with
several multiconfigs for different reasons, then the displayed reason
(i.e. the "ERROR: Nothing PROVIDES" and "* was skipped" messages) might
vary across invocations of bitbake. This was caused by the random order
in which recipes are parsed under different multiconfig contexts, with
each skip reason overwriting the previously assigned reason.

I hit this specificially when using COMPATIBLE_MACHINE, but
COMPATIBLE_HOST (or anything using bb.parse.SkipRecipe) would have done it too.

(Bitbake rev: c51f01a35ed9a928402eab0899598b5c59602eef)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-17 11:48:25 +00:00
Alexander Kanavin
2a5623dddc bitbake: bitbake-config-build: add an alias to bitbake-layers
This alias is intended for managing specific local configs and it
is prompted by adding support for config fragments (in a separate
commit to oe-core); after some deliberation I concluded there should be
a separate tool, as bitbake-layers is already somewhat over-stuffed,
and this will give space for more build/conf/* operations in the future
that anyone can come up with (such as tweaking site-specific items
in site.conf etc.)

The alias completely reuses existing code via symlink and
the difference is in where it looks for plugins.

(Bitbake rev: ba90fe673aa87cb0cda9b2e465ebe2063551f527)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-13 11:11:18 +00:00
Ross Burton
d6f210f690 bitbake: lib/bb/tests: use bb.build.listtasks() instead of __BBTASKS
Use the new listtasks() function (introduced in 185c4b) to avoid
accessing a private variable.

Also use assertSequenceEqual() directly as we don't really care about
the actual type returned, only that it's a sequence.

(Bitbake rev: 452289efc6d3608ceca321286fd5bf417a6e1bed)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-13 10:44:35 +00:00
Alexander Kanavin
adebd9f9bc bitbake: bitbake-user-manual-metadata: add a section about 'addfragments`
(Bitbake rev: 47e4645da582daa8f3e818ba98e9652c2dcf202f)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-13 10:44:35 +00:00
Alexander Kanavin
e0e6124d9a bitbake: bitbake: parse: add support for flagged fragment variables
It was suggested that using flags in fragment content to
mark fragment-specific metadata (such as descriptions and
dependencies) is prone to quiet regressions when fragments
are renamed or moved, and it clutters the fragment content.

With this change allowed fragment metadata variables must
be explicitly listed in a variable that is given to addfragment
directive, and parser will add the flag containing the fragment name
to them.

(Bitbake rev: ed9a3ca9426500511feb77f41a146953dbfe9af7)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-13 10:44:35 +00:00
Alexander Kanavin
3de3bda4c4 bitbake: parse: add support for 'addfragments' directive
It takes two parameters:
- location prefix for fragments
- name of variable that holds the list of enabled fragments, each of them prefixed
by layer id

Implementation of this directive essentially expands the fragment list
obtained from the variable into absolute fragment paths and hands them to the
implementation of 'require'.

(Bitbake rev: f687746703e7b096c5480668fd4f49bd4951182b)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-08 22:36:11 +00:00
Alexander Kanavin
186b7c58d5 bitbake: parse/ConfHandler: allow / in variable flags
This is beneficial for config fragments, as their names
are specified via flags, and those names can include slashes:

BB_CONF_FRAGMENT_SUMMARY[init/systemd] = "This fragment enables systemd as an init manager"

(Bitbake rev: 80805988492b35593067230f68782a5687c8f557)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-08 22:36:11 +00:00
Chris Laplante
9cabda06ab bitbake: cooker: use enum for cooker state to improve readability
enum was introduced in Python 3.4

(Bitbake rev: 35b71a94f8757fcca830f972a42edab1dd000c16)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-06 23:33:54 +00:00
Chris Laplante
2a34c96b8b bitbake: server/xmlrpcserver: fix some warnings
+ Unnecessary parens
+ Missing imports
+ Instance attribute defined outside of __init__

(Bitbake rev: 0622b3df9a55ed66009f3bed47fbf52bb2122056)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-06 23:33:54 +00:00
Chris Laplante
bfe176d6d5 bitbake: knotty: some small cleanups while I'm in here
+ missing imports
+ indentation fix
+ missing call to super __init__
+ redundant parenthesis

(Bitbake rev: 89613f4ba31377528d1934cc591fe33218bd916a)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-06 23:33:54 +00:00
Chris Laplante
c7b362f5ec bitbake: knotty: print an error if MACHINE is not set
When the user forgets to set MACHINE, bitbake just exits without
printing anything.

This is because BB_CONSOLELOG ends up with an unexpanded '${MACHINE}', which
bb.utils.mkdirhier tries to report using bb.fatal. But bb.fatal utilizes the
very logging infrastructure that this code was trying to setup.

(Bitbake rev: 7d3f3655b2f610f76898c84b8b97ef2e26529c41)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-06 23:33:54 +00:00
Richard Purdie
a72cd0d6d0 bitbake: runqueue: Fix scenetask processing performance issue
Analysis shows that "bitbake core-image-ptest-all" spends a lot of
time in scenequeue_updatecounters and much of it is rebuilding a set
which doens't change. Reorder the code to avoid that performance
glitch.

(Bitbake rev: 923c19b9713e398d8e66e6d4422dfd4c18a03486)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-29 22:13:25 +00:00
Richard Purdie
abc603870a bitbake: runqueue: Optimise setscene loop processing
Rather than looping through things we looped through on the previous execution,
start looping where we left off for setscene processing. This gives speed
improvements depending on the kind of build being executed.

(Bitbake rev: 00f4d932e3af0eeb333339cbe942010fc76dee0f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-29 22:13:25 +00:00
Richard Purdie
05b02e3d57 bitbake: runqueue: Fix performance of multiconfigs with large overlap
There have been complaints about the performance of large multiconfig builds
for a while. The key missing data point was that the builds needed to have large
overlaps in sstate objects. This can be simulated by building the same things with
just different TMPDIRs. In runqueue/bitbake terms this equates to large numbers of
deferred tasks.

The issue is that the expensive checks in the setscene loop were hit every time
through runqueue's execute function before the check on deferred tasks. This leads
to task execution starvation as that only happens once per iteration.

Move the skip check earlier in the function which speeds things up enormously
and should improve performance of such builds for users.

(Bitbake rev: 9c6c506757f2b3e28c8b20513b45da6b4659c95f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-29 22:13:25 +00:00
Pascal Eberhard
b35dc1a99d bitbake: fetch2: fix unpack of a single zstd file
do_unpack generates a 'Bitbake Fetcher Error: UnpackError' when
uncompressing a single 'file.zst', zstd command line returns the error
'unexpected end of file', and the input file 'file.zst' becomes empty.

The command line is 'zstd --decompress --stdout file.zst > file.zst'.
So the issue is that the input and output filenames are the same.

Fix the output filename when using zstd for a single file.

(Bitbake rev: 5881ca0e0d53937cd25a57ff682a3b7577b0b7f8)

Signed-off-by: Pascal Eberhard <pascal.eberhard@se.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-29 18:26:14 +00:00
Joshua Watt
29da7370d2 bitbake: Remove custom exception backtrace formatting
Removes the code in bitbake to show custom backtrace formatting for
exceptions. In particular, the bitbake exception code prints function
arguments, which while helpful is a security problem when passwords and
other secrets can be passed as function arguments.

As it turns out, the handling of the custom serialized exception stack
frames was pretty much made obsolete by d7db75020ed ("event/msg: Pass
formatted exceptions"), which changed the events to pass a preformatted
stacktrack list of strings, but the passing of the serialized data was
never removed.

Change all the code to use the python traceback API to format exceptions
instead of the custom code; conveniently traceback.format_exception()
also returns a list of stack trace strings, so it can be used as a drop
in replacement for bb.exception.format_exception()

(Bitbake rev: 2cda75a185aaf8f657f072dac34f8cef9d75f63a)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-28 00:06:24 +00:00
Ross Burton
ef5aaedf2a bitbake: bb/build: add a function to list the tasks in a datastore
There's no easy way to list all of the tasks in a recipe, you can either
look at __BBTASKS (internal variable, shouldn't be used) or iterate all
items in the datastore looking for variables with the 'task' flag set
(which is slow).

Solve this problem by adding a bb.build.listtasks() function that
returns an immutable copy of the __BBTASSK variable.

(Bitbake rev: 185c4b803962b20ba65a7d885dfe1a14e68736ef)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-28 00:06:24 +00:00
Chris Laplante
a8a11cbc79 bitbake: bitbake-layers: use 'with' to manage tinfoil context
(Bitbake rev: bd468a5b9210043d0121a322360d976fd830f736)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-28 00:06:24 +00:00
Antonin Godard
f53fe9c84a bitbake: doc: bitbake-user-manual: document inherit_defer
This was added in 2.7.2. Since using inherit_defer is safer that inherit
when inheriting conditionally, move the instructions about that in
inherit_defer.

Fixes [YOCTO #15640].

Reported-by: Yoann Congal <yoann.congal@smile.fr>
(Bitbake rev: eb10df5a9619e243e28e0f4cd6122c24ed668f52)

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-28 00:06:24 +00:00
BELHADJ SALEM Talel
f0824f9270 bitbake: bitbake-getvar: Catch NoProvider exception
When the recipe provided by (-r, --recipe) is not found
tinfoil raises an exception that is not catched for
readability, example:

Traceback (most recent call last):
  File "/.../poky/bitbake/bin/bitbake-getvar", line 45, in <module>
    d = tinfoil.parse_recipe(args.recipe)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../poky/bitbake/lib/bb/tinfoil.py", line 633, in parse_recipe
    fn = self.get_recipe_file(pn)
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../poky/bitbake/lib/bb/tinfoil.py", line 550, in get_recipe_file
    raise bb.providers.NoProvider('Unable to find any recipe file matching "%s"' % pn)
bb.providers.NoProvider: Unable to find any recipe file matching "aaa"

(Bitbake rev: 06aa6c292813a28c84736193b550fb2d18884d43)

Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-21 12:16:28 +00:00
Richard Purdie
b4bd930fb2 bitbake: fetch/wget: Increase timeout to 100s from 30s
Testing shows the worst case CDN response time can be up to 100s. The wget fetcher
is used for accessing sstate from the CDN so increase our timeouts there to match
our worst case repsonse times.

(Bitbake rev: 7aca591529e115bc277f93811d8c586630acc8c3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-21 12:16:28 +00:00
Richard Purdie
f95a645dd4 bitbake: bitbake-worker/cooker: Increase default pipe size
The default pipe size is 64kb on builds, which can be inefficient
for larger log files from workers. Increase the pipe size to 512kb
since build systems have decent amounts of memory and this is a more
efficient way of batching the data.

Tweak the default read sizes to match the pipe size for efficiency.

Since the contstant is only present in python 3.10 onwards, add
some compatibility code.

(Bitbake rev: 69c14e46600ba5ae9703f67704ab2548875ae6d7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-21 12:16:28 +00:00
Richard Purdie
b97de63d2f bitbake: bitbake-worker: Improve bytearray truncation performance
If there are large amounts of data being transferred to the cooker
from the worker, recreating the bytearray becomes inefficient as it
happens for every pipesize block of data, defaulting to 64kb.

Instead we can use the deletion API for bytearrays to make this more
efficient and avoid the object recreation.

We noticed this with a strace ptest image taking days to complete the
build after having 6GB of data in the testimage log. Whilst there are
other issues there, making this code more efficient doesn't hurt.

(Bitbake rev: a4a72b7edb368f352784c856a647236a887010dd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-21 12:16:28 +00:00
Alexander Kanavin
17f1b80c06 bitbake: bitbake-layers: ensure tinfoil.shutdown() gets executed when tinfoil.prepare() fails
https://git.yoctoproject.org/poky/commit/bitbake/bin/bitbake-layers?id=f6de2b033d32c0f92f19f5a4a8c4c8874a00a8f7
erroneously moved tinfoil.prepare() out of try..finally block, where
'finally' contains a tinfoil.shutdown() call.

Without the shutdown, if there is an error in tinfoil.prepare() (such as parsing errors),
the tool locks up, as seen here:
https://valkyrie.yoctoproject.org/#/builders/71/builds/431

(Bitbake rev: 06b8a18339434be8f754e534dacb790a2c9cb91d)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-21 12:16:28 +00:00
Richard Purdie
282cc1ea92 bitbake: cooker: Drop support for BB_DANGLINGAPPENDS_WARNONLY
DANGLINGAPPENDS_WARNONLY is a very poorly designed interface and
is commonly abused. The challenge is that once it is set, by any
layer, it applies everywhere.

Some layers rely on this to get notification they need to update
bbappend files and having the behaviour change from inclusion of an
antisocial layer is not good.

In addition, showing warnings as an accepted thing on the console
devalues them and trains the user to ignore them. I want to steer us
away from this mindset.

We could extend the functionality and make it apply only to certain
layers, or only to certain appends but then we've basically re-invented
BBMASK.

Given all the above, we should drop support for BB_DANGLINGAPPENDS_WARNONLY
and direct anyone with issues to BBMASK instead.

https://lists.openembedded.org/g/openembedded-architecture/message/2029

[YOCTO #14870]

(Bitbake rev: fca9c9e3cb6f8e9f99bf51dc5e8a8d83f4c84c69)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-21 12:16:28 +00:00
Yoann Congal
4be9d61225 bitbake: bitbake-getvar: use finalizeData tinfoil API to get identical result to "bitbake -e"
Fixes [YOCTO #15638]

(Bitbake rev: 68ae81dc93f86eab378fec2276561c5062263d7e)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-18 13:41:38 +00:00
Yoann Congal
30a3ac4a2e bitbake: tinfoil: add new "finalizeData" API
Create a new tinfoil API "finalizeData" which does key expantion and
runs the anonymous functions to allow bitbake-getvar to have the same
output as "bitbake -e".

(Bitbake rev: 63db64ca98564420a378f14c337074ae06da8c63)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-18 13:41:38 +00:00
Yoann Congal
2abc5dd028 bitbake: doc/user-manual: Refresh help output
In commit 9257c48c3e36 ("Group and reorder options in bitbake help"),
help output was changed, update the doc to match the new output.

(Bitbake rev: 7ef357f1c6fcd50c9d22190ba39d1cfd82070c79)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-18 13:41:38 +00:00
Yoann Congal
0317315a97 bitbake: command: fix needconfig for revalidateCaches
Fixes what looked like a type since parseConfiguration.needconfig is
already set just after parseConfiguration() definition.

(Bitbake rev: d371df029ece3b9e600a89d08337c437a8ddbf63)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-07 22:17:43 +00:00
Richard Purdie
fc027ef55f bitbake: server/process: Decrease idle/main loop frequency
The idle and main loops have socket select calls to know when to execute.
This means we can increase the normal timeout frequency since this is
just a fall back and have some small efficiency gains.

(Bitbake rev: 8d8e17af8619c976819170c9d5d9a686a666c317)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-07 13:36:04 +00:00
Richard Purdie
9500cf65a7 bitbake: server/process: Don't send heartbeats when no idle functions
If there are no idle functions present, don't sent heartbeat events. These
are only meant to happen while builds are active.

(Bitbake rev: 9a2d5e63b07c3912838781776c61f0f1ac9640e1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-07 13:36:04 +00:00
Richard Purdie
f8f45ebde4 bitbake: server/process: Merge a function to simplfy code
Keeping this code separate just makes the code harder to understand,
merge them.

(Bitbake rev: e5ac26a0e1779df1da3277bf48899c8f7642f1f8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-07 13:36:04 +00:00
Richard Purdie
79f193ffa0 bitbake: runqueue: Avoid dumpsigs idle loop blocking
We're seeing some failures on hosts where slow "idle" loop iterations are
causing bitbake server timeouts. These seem to happen particularly in the
dump_signatures() function within runqueue.

That isn't entirely surprising since it creates a pool of threads to execute
work an at best can take around 10s to execture and return control backto the
main loop. On a slow system, it is understandable this can take longer,
particularly as these functions are creating large chunks of IO.

Since the work is being done in threads, we can launch them, return to idle
and check on the results periodically as they complete.

This should hopefully address some of the remaining timeout issues we see on
the autobuilder in oe-selftest sstate tests.

(Bitbake rev: e66f1b643b4b77404ba31f2704cda5af9bf00a57)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-07 13:36:04 +00:00
Justin Bronder
f700c1b774 bitbake: bb/compress: use lz4 instead of lz4c
lz4c has been considered deprecated by upstream since at least 2018 [1]
and has been disabled by default recently [2].  openSUSE Tumbleweed is
no longer packaging the deprecated version and others will likely
follow.

Luckily, we're not using any legacy-specific options and, going back as
far as Ubuntu 16.04/Fedora 25, both lz4 and lz4cli are installed as part
of the same package

1. https://github.com/lz4/lz4/pull/553
2. https://github.com/lz4/lz4/pull/1479

(Bitbake rev: 907472034b344e4eb73cfd43059a413469f52e1c)

Signed-off-by: Justin Bronder <jsbronder@cold-front.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-05 11:17:17 +00:00
Robert Yang
0884c31b1b bitbake: cooker: Sort pn-buildlist
So that we can compare the different pn-buildlist easily.

(Bitbake rev: 529043117a7c62feb45bc891658a412cc8dd7e3f)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-05 11:17:17 +00:00
Jose Quaresma
38c2a44f72 bitbake: bitbake: doc/user-manual: Update the BB_HASHSERVE_UPSTREAM
(Bitbake rev: d8a044351dea6c9e324a8e00dd1aa6f2b606fec6)

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-02 09:41:47 +00:00
Richard Purdie
59d4ee01ca bitbake: tests/fetch: Use our own mirror of mobile-broadband-provider to decouple from gnome gitlab
GNOME gitlab has occasional downtime which impacts bitbake-selftest
and causes autobuilder failures. Switch to our own mirror for test
purposes to avoid those issues.

(Bitbake rev: 91e268b11ed683bd197026f9b36001f6d54ee05c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-29 22:27:45 +00:00
Richard Purdie
2abe7cedbf bitbake: tests/fetch: Use our own mirror of sysprof to decouple from gnome gitlab
GNOME gitlab has occasional downtime which impacts bitbake-selftest
and causes autobuilder failures. Switch to our own mirror for test
purposes to avoid those issues.

(Bitbake rev: 008808755ed6cfeb6c41273e69ce718f0833c26c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-28 14:08:33 +00:00
Robert Yang
0a45ba64ad bitbake: git: Clean broken symlink
The file may be a symlink when mirror from local disk, and the symlink will be
broken when the linked file is removed, use os.path.islink() to check and
remove the broken symlink.

(Bitbake rev: d0deb5fe6e7a84b07b49ef685b209729d2fdc780)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-28 14:08:33 +00:00
Robert Yang
dd9d183621 bitbake: git: Clean shallow mirror tarball
Fixed:
BB_GIT_SHALLOW = "1"
BB_GENERATE_SHALLOW_TARBALLS = "1"
$ bitbake utfcpp -cfetch && bitbake utfcpp -ccleanall

The downloads/gitsmshallow_github.com.nemtrif.*.tar.gz won't be cleaned without
this fix.

(Bitbake rev: bab7a8970a0237a9d24217685a595e76a1336c07)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-28 14:08:33 +00:00
Robert Yang
5bce38fbae bitbake: gitsm: Add clean function
Fixed:
$ bitbake utfcpp -cfetch && bitbake utfcpp -ccleanall

The downloads/git2/github.com.nemtrif.ftest won't be cleaned without this fix.

(Bitbake rev: 79f25fc5c1b8d0e08540f4aa07875309f5325f47)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-28 14:08:33 +00:00
Robert Yang
8d9c02ccfc bitbake: gitsm: Remove downloads/tmpdir when failed
The tmpdir such as downloads/tmplp3cnemv won't be removed without this fix.

(Bitbake rev: 2ba8d3214759142afc11f0a88d80eb30a8bcde3a)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-28 14:08:33 +00:00
Robert Yang
04c1ee924b bitbake: gitsm: Add call_process_submodules() to remove duplicated code
There are 14 lines can be removed, and can make it easy to maintain.

(Bitbake rev: 0ea2c1ac079d63349407a69172ff80cd9acc7252)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-28 14:08:33 +00:00
Jesse Riemens
61d5e47f99 bitbake: contrib/hashserv/Dockerfile: Add libgcc to image for runtime dependency
Libgcc is required as a runtime dependency. Without it, we get the
following error:

OSError: Error loading shared library libgcc_s.so.1: No such file or
directory

(Bitbake rev: 95e61f3dacacb3a001d9f0e2db4c4a2960d96640)

Signed-off-by: Jesse Riemens <riemensjesse@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-25 15:40:54 +01:00
Joshua Watt
b5f17d0334 bitbake: bitbake-hashclient: Add help for address
Adds an epilog to the help text that indicates the possible options for
the server address

(Bitbake rev: b6b703fce02057212ad11b1d1286c6178c533bad)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-25 15:40:03 +01:00
Richard Purdie
0fac8e96f7 bitbake: toaster/tests/browser/layerdetails: Drop unwanted test skipping/exception handling
We really don't want to be skipping a test like this, drop the exception handling
code as in my testing we thankfully no longer seem to be seeing it. If we do again
we need to fix the underlying issue.

(Bitbake rev: b67547f890dc7f347ec05a97cbfb22d3703998cc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
6ee37562d4 bitbake: toaster/tests/functional/utils: Handle WebDriverException
Fix the exception handling in the cancel builds function.

This involved adding WebDriverException which sometimes occurs but
also correcting the other exception handlers to continue to increment
the timeout to avoid test hangs.

(Bitbake rev: e111a2bd4f7a8a4dc2c63e94e91ac6cacca95af8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
56a8e5283e bitbake: toaster/tests/browser/helper: Add wait for jquery to complete
Most of the tests that click on buttons need the DOM to stablise, including
any running JQuery code before the test can proceed. Add calls to do this
whenever we're about to click on an element.

(Bitbake rev: 0eb206b355248e2a874a62baec30025652f2a5a8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
1f2b8a27ea bitbake: toaster/tests/functional/project_page: Use wait_until_element_clickable before click calls
Switch the clickable() calls to use the new element_clickable() function
which accepts a finder labmda function. This means if the element doesn't
yet exist, the code can rebuild the query and try again once a small
amount of time has elapsed.

There were a ton of timing related races around these element interactions
and this seemed to be the most robust way to address the issues.

The change also makes some of the elements slightly more specific so
the code can work effectively.

(Bitbake rev: 38643aadbb5a960004b886cf7709beaf2fc96652)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
7fef43d98a bitbake: toaster/tests/functional/util: Avoid test hangs
If the element never exists, the timeout is never incremented and the test
hangs indefinitely. Fix the exception handling to avoid that and allow
the timeout to happen.

(Bitbake rev: 9eabe923d457bbce65227da4cd71c275c32108e6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
524bbe060e bitbake: toaster/tests/browser: Add various fixes for test failures encountered
Fixes for the browser tests which:
* Add/improve waiting for specific elements
* Waiting for elements to be interactable, not just visible
* Hiding notification windows
* Using more specific asserts to obtain improved error messages

(Bitbake rev: 0c3f9bc2b9516d2af391f2e081280eb7fa62a05e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00