Commit Graph

246 Commits

Author SHA1 Message Date
Ross Burton
d5d5af8c4a classes/base: prefer gnu-prefixed HOSTTOOLS
Ubuntu 25.10 has changed the default coreutils implementation from GNU
coreutils to uutils/coreutils. Unfortunately this causes build problems:

  couldn't allocate absolute path for 'null'.
  tail: cannot open 'standard input' for reading: No such file or directory
  install: failed to chown '...': Invalid argument (os error 22)

Clear build failures happen in 'install' and 'tail', but there may be
further breakage.

Luckily, Ubuntu also installs GNU coreutils with a binary prefix of
'gnu', so whilst these issues are root-caused and fixed in either pseudo
or uutils we can prefer the gnu-prefixed binaries where they are present.

[ YOCTO #16028 ]

(From OE-Core rev: 16f2684ebeffa72b5d90525cf9102751b68c298e)

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>
2025-11-03 17:40:41 +00:00
Ross Burton
5284c01374 classes/mirrors: use geo-located kernel.org mirrors
We use the kernel.org mirrors for a number of projects: obviously the
kernel, but also the GNU tarballs are fetched from there too.

However, mirrors.kernel.org does not have any geo-proximity DNS magic
and will always resolve to the primary server on in west coast USA,
which is far from ideal if you're not near there.

Switch the mirror URLs to mirrors.edge.kernel.org, which does actually
resolve to a closer server.

(From OE-Core rev: 63d586cd6499ef2a8d311223fa0e1ed9d071dd0e)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-16 10:53:10 +01:00
Andreas Stergiopoulos
38bf362945 sanity.bbclass: Remove tool version repetition for gcc, patch, git, make, tar
This commit mainly changes the way that error messages are printed when
sanity checking for the version numbers of gcc, patch, git, make and
tar. It affects the following functions:

check_patch_version(),
check_make_version(),
check_gcc_version(),
check_tar_version(),
check_git_version()

Before this commit, the minimum version number and the error string
were hard-coded string literals which the programmer had to maintain
manually and independently. With this change, the version is defined
once in each function and then used both for checking and for error
printing.

Additionally, the affected error messages have been made to spill
over multiple lines for better source code readability.

Link to the relevant discussion:
https://lists.openembedded.org/g/openembedded-core/topic/115491380#msg224131

This change has been tested by changing the version string and making
sure that the test fails and the proper minimum version is reported
in the error message.

Suggested-By: Yoann Congal <yoann.congal@smile.fr>
(From OE-Core rev: 27a4ce7b34946200e35adfab1ace512a531fc560)

Signed-off-by: Andreas Stergiopoulos <andreas.stergiopoulos@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-16 10:53:10 +01:00
Antonin Godard
6c52f68111 sanity: Update minimum gcc version to 10.1
Since commit 19004950ad56 ("sanity: Check if the C++ toolchain supports
--std=gnu++20") host GCC must support "--std=gnu++20", which became
available in 10.1. This is already reflected in the documentation [1]
but not here.

Update the sanity check on GCC and raise the minimum version to 10.1.
Remove the dead link to www.softwarecollections.org.

[1]: https://git.yoctoproject.org/yocto-docs/commit/?id=0e538c102bfcb7184c76c2401e8cb878168c4434

Cc: Yoann Congal <yoann.congal@smile.fr>
(From OE-Core rev: 871cc04305fe7483a4c256f38fa63a67cef82183)

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-10-02 11:28:02 +01:00
Chen Qi
8221eb2424 base.bbclass: remove unneeded bb.runqueue import
base.bbclass no longer uses bb.runqueue[1]. Remove the import.

[1] https://git.openembedded.org/openembedded-core/commit/?id=2af49716504f65be0cb01f609ea9bfa334926589

(From OE-Core rev: f28415e3ca69b2fb81ae3e3987ef40aa8184b82d)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-15 17:57:24 +01:00
Ola x Nilsson
f8be2d88cd sstate: Open file with context manager
In sstat_install and sstate_clean_cache.

(From OE-Core rev: 040aeaf3a4fbc780148d725aa666954ad1ab20e7)

Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-28 10:47:08 +01:00
Chris Laplante
45c3fbcea3 sstate: fixup calls to bb.event.check_for_interrupts to remove unused argument
This commit should come along with this associated commit in bitbake: https://patchwork.yoctoproject.org/project/bitbake/patch/20250806145308.2052128-2-chris.laplante@agilent.com/

(From OE-Core rev: b0438b744800af60037ecc585c659be05a50d419)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-12 10:05:11 +01:00
Philip Lorenz
c4110987b1 package: Drop var-undefined QA check
The variables checked for are mandatory in all cases so a QA check does
not seem to be the right choice for this. Additionally, the code never
called `exit_if_errors` so the reported QA issue didn't actually fail
the task.

(From OE-Core rev: cb69d7eba80215f9f8b74dafe40ca2289fa294aa)

Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-31 10:48:35 +01:00
Richard Purdie
0a9668e192 sanity: Add sanity test for 'bad' gcc installs on ubuntu 24.04
Installing emacs on Ubuntu 24.04 pulls in emacs-gtk which leads to libgcc-14-dev
despite gcc being 13. This breaks libcxx-native and compiler-rt-native builds.
We've tried various ways of addressing this buit they don't work. Instead, detect
this situation and tell the user to either install or remove a package.

(From OE-Core rev: 087b2730bb2446ad5ea98c233e349d2787c17ff1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-09 08:48:04 +01:00
Khem Raj
c69887224f base.bbclass: Deferred inherit native toolchain class
use TOOLCHAIN_NATIVE variable for selecting native compiler

Default it to PREFERRED_TOOLCHAIN_NATIVE, a recipe which wants
to enforce a toolchain can do so with

for cross toolchains ( e.g. target, nativesdk )

TOOLCHAIN = "gcc"

For native

TOOLCHAIN_NATIVE = "gcc"

This helps build native recipe with clang as native compiler.

(From OE-Core rev: 546baa210acacff5dde6ce55e9842b90277bc9a8)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-04 14:56:41 +01:00
Richard Purdie
57f1eb2e66 sanity: Reference gcc/g++ directly
BUILD_CC and BUILD_CXX can be overridden on a per recipe context now so
these tests don't make sense in this form any more. They assume gcc/g++
so lets just use those directly.

This fixes things to work with toolchain selection for the native
case.

(From OE-Core rev: cc93781667cf4f6971bcb9319ab8ab21320852de)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-03 10:40:16 +01:00
Richard Purdie
8624474277 sanity/utils: Directly use gcc, not BUILD_CC
The test/helper is written assuming gcc, so just call that and stop
accessing BUILD_CC which may be set to clang.

(From OE-Core rev: 0a165a93693a293f08cb0d7e2dfa1016803a917a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-03 10:40:16 +01:00
Richard Purdie
204653a519 uninative/utils: Drop workarounds for gcc 4.8/4.9
We require at least gcc 8.0 in sanity.bbclass so drop the 4.8/4.9
special case handling in uninative.

(From OE-Core rev: 552e037bf598ac523f35b69d2dafc99e5ba59c5f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-03 10:40:16 +01:00
Richard Purdie
f47786d66f base: Use OE_SHARED_UMASK for do_fetch
The intent has always been to share DL_DIR, so set the umask accordingly
to the new OE_SHARED_UMASK variable and match expectations.

(From OE-Core rev: 00e9bfbd29f3959adfc2c64ec78285a11ff83821)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-01 08:49:37 +01:00
Richard Purdie
6c8292de85 bitbake.conf/sstate: Introduce OE_SHARED_UMASK to standarise shared area umask
Currently, the "shared" directory permissions of sstate are hardcoded. Since
multiple areas of the code reference this, separate it out to a variable to
allow the behaviour to be configurable. Initially this applies to SSTATE_DIR.

(From OE-Core rev: ce32daa9843bcb5f6daf3560c64ca9e5144adcb0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-01 08:49:37 +01:00
Rasmus Villemoes
ba290e7ec8 sstate: apply proper umask when fetching from SSTATE_MIRROR
Currently, files and directories created under ${SSTATE_DIR} when
fetching from an sstate mirror are not created with group write,
unlike when the sstate artifacts are generated locally. That's
inconsistent, and problematic when the local sstate dir is shared
among multiple users.

Wrap the fetching in a bb.utils.umask() context manager, and for simplicity
move the mkdir of SSTATE_DIR inside that.

(From OE-Core rev: a6038553aaef3b88b834a09018c524c4fa41e625)

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-26 11:02:34 +01:00
Alexander Kanavin
0ad5fb3431 base.bbclass: drop compatibility moving of sources into workdir
Potentially there could be a grace period for fixing recipes (with warnings, etc),
on the other hand, changes to git unpacking destination would already
break various layers, so we might as well make this a hard qa error and drop
the magic at the same time.

I commit to sending fixes for layers included in autobuilder testing
(meta-oe/arm/intel/virt/agl/aws/mingw/etc).

SOURCE_BASEDIR is at the same time adjusted to be calculated relative
to UNPACKDIR (previously it only worked if S was set to
WORKDIR/something/otherthing, and that is no longer working). It is also
no longer removed from the filesystem, as content of unpackdir is managed elsewhere.

(From OE-Core rev: 53e9ea30aaf48292307b4cff6964bead74c69fff)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-20 12:07:27 +01:00
Alexander Kanavin
4dd321f8b8 insane/do_qa_unpack: add checks that ensure S is set correctly
The checks are fatal, as this avoids rather more cryptic errors further
down the build. Example:

ERROR: gnu-config-native-20240823+git-r0 do_unpack: Recipes that set S = "${WORKDIR}/git" or S = "${UNPACKDIR}/git" should remove that assignment, as S set by bitbake.conf in oe-core now works.
ERROR: perlcross-native-1.6.2-r0 do_unpack: S should be set relative to UNPACKDIR, e.g. replace WORKDIR with UNPACKDIR in "S = ${WORKDIR}/perl-cross-${PV}"

Dropping the S = ${WORKDIR}/git assignment (addressing the first error) can be done
with a single sed command when there is a lot of recipes:

sed -i "/^S = \"\${WORKDIR}\/git\"/d" `find . -name *.bb -o -name *.inc -o -name *.bbclass`

Replacing WORKDIR with UNPACKDIR can be done similarly, but should be done after
the removals:

sed -i "s/^S = \"\${WORKDIR}\//S = \"\${UNPACKDIR}\//g" `find . -name *.bb -o -name *.inc -o -name *.bbclass`

(From OE-Core rev: 46480a5e66747a673041fe4452a0ab14a1736d5e)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-20 12:07:26 +01:00
Richard Purdie
5317a214c5 toolchain: Provide abstraction for recipe specific toolchain selection
This change implements a toolchain selection mechanism. Selection is
made using a set of variables, primarily PREFERRED_TOOLCHAIN_TARGET which
defaults to gcc.

It uses the familiar name for toolchain e.g. "gcc" which selects GNU
compiler + binutils as default C/C++ toolchain or "clang" which will
use LLVM/Clang Compiler. Layers an add their own toolchain definitions
too.

There are also PREFERRED_TOOLCHAIN_NATIVE and PREFERRED_TOOLCHAIN_SDK
which will ulitmately allow selection of the toolchain used for the
native/cross and nativesdk/crosssdk compilers. This currently isn't
functional but is essential to the patch to ensure things are set
to the existing gcc support in those cases.

Users would most commonly want to set:

PREFERRED_TOOLCHAIN_TARGET ?= "clang"

in local.conf or other distro specific global configuration metadata.

It is also selectable at recipe scope, since not all packages are
buildable with either clang or gcc, a recipe can explicitly require
a given toolchain using the TOOLCAHIN variable, e.g. glibc can not
be built with clang therefore glibc recipe sets:

TOOLCHAIN = "gcc"

The TOOLCHAIN variable is distinct from the user preference so recipes
with specific requirements can be identified. This also allows different
polcies to be be specified for native/SDK cases in the future.

(From OE-Core rev: 45bdedd213aff8df3214b95ef2a8551c0abd93a0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-16 22:26:38 +01:00
Richard Purdie
c49991441c base: Add deferred class event handler
Use the new deferred class event to set the class overrides earlier.
This improves interaction of the override with PACKAGECONFIG values
that control conditional inherits (such as python support).

This also allows toolchain configuration in an easier and more user
friendly way.

(From OE-Core rev: d58f94d5684332bd4fac3747688558bb261b9c63)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-16 22:26:38 +01:00
Ryan Eatmon
12b533e120 insane: Fix debug-deps check
Fixes bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15901

The cheeck for debug-deps is looking for the mere existence of the
substring "-dbg" inside of the name of an RDEPENDS package, but it should be
an endswith check.  This helps with some eroneous errors in kernel
module names like:

ERROR: linux-xxx do_package_qa: QA Issue: kernel-modules rdepends on kernel-module-g-dbgp-6.12.22-ti [debug-deps]

and

ERROR: QA Issue: kernel-module-mtk-vcodec-dec-6.16.0-rc1-next-20250610-dirty rdepends on kernel-module-mtk-vcodec-dbgfs-6.16.0-rc1-next-20250610-dirty [debug-deps]

(From OE-Core rev: 1b85d84c736a0fa5cb27b8716ca37f181464c85a)

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-16 17:57:29 +01:00
Ross Burton
8644f202a1 insane: add test for recipe naming/class mismatches
It's not unheard of for new users to create a recipe called foo-native
that has BBCLASSEXTEND="native" instead of "inherit native". This will
result in a foo-native recipe that is actually a target recipe, and a
foo-native-native recipe for native builds.

Add a test in recipe_qa to verify that recipes called -native inherit
native, and recipes called nativesdk- inherit nativesdk.

As this behaviour is expected, add the new test to the set of tests
required to pass for Yocto Project Compatible status.

(From OE-Core rev: ec2c10a3e85d0772135289fe416d13fa3afca571)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-09 17:43:41 +01:00
Ines KCHELFI
3d131ece58 insane.bbclass: Add unimplemented-ptest detection for cargo-based tests
Extend unimplemented-ptest QA check to detect Rust tests.
Note: To enable this QA check, add the following to your local.conf:
  WARN_QA += "unimplemented-ptest"

Examples of Rust-based meta-oe packages triggering unimplemented-ptest:

WARNING: cbindgen-0.28.0-r0 do_patch: QA Issue: cbindgen: cargo-based tests detected [unimplemented-ptest]
WARNING: fdfindd-10.2-r0 do_patch: QA Issue: fdfindd: cargo-based tests detected [unimplemented-ptest]
WARNING: deqp-runner-0.20.3-r0 do_patch: QA Issue: deqp-runner: cargo-based tests detected [unimplemented-ptest]
WARNING: bindgen-cli-0.71.1-r0 do_patch: QA Issue: bindgen-cli: cargo-based tests detected [unimplemented-ptest]
WARNING: python3-maturin-1.8.3-r0 do_patch: QA Issue: python3-maturin: cargo-based tests detected [unimplemented-ptest]
WARNING: uutils-coreutils-0.0.30-r0 do_patch: QA Issue: uutils-coreutils: cargo-based tests detected [unimplemented-ptest]

(From OE-Core rev: c3c10f00b1f4d4a092e5d3834ec0ba6abd6ac969)

Signed-off-by: Ines KCHELFI <ines.kchelfi@smile.fr>
Reviewed-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>
2025-05-19 17:35:43 +01:00
Richard Purdie
6a2ad60ecc bitbake.conf/pseudo: Switch from exclusion list to inclusion list
Currently, pseudo tracks all files referenced within its presence unless
they're listed in an exclusion list. The exclusion list has grown to be
fairly unwieldy.

This patch swaps PSEUDO_IGNORE_PATHS for PSEUDO_INCLUDE_PATHS which in
theory should be easier and more explicit to maintain.

This change does drop many directories from pseudo coverage including
/home and /tmp. There may be adapatations needed for recipes/classes
using pseudo in specific ways.

(From OE-Core rev: 2502da81709f25de499277b28d33c915638c45f6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-05-12 22:01:56 +01:00
Ross Burton
24efa3786c classes/yocto-check-layer: add check for tasks that allow network access
Add a new test that checks that no tasks between do_fetch (exclusive)
and do_build (inclusive) are allowed to use the network, with rare
exceptions.

The only exception currently is build-appliance-image's do_image task,
as that currently usese pip to install the required Toaster dependencies.

Note that this will mean layers that have Go-based recipes will fail
unless they're using the gomod fetcher and have a complete list of
modules in the SRC_URI.

(From OE-Core rev: e95b3bd194e294412bc0419c9c74abfc2f37406f)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-05-05 17:22:11 +01:00
Ross Burton
e4c9b45a98 classes/yocto-check-layer: refactor to be extended easily
Rearrange the class so that the check is a separate function, to make it
neater to add further tests in the future.

(From OE-Core rev: 36658a113811de98249bc1e1b79cfadd405e5391)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-05-05 17:22:11 +01:00
Ross Burton
c2aec3f86c uninative: show errors if installing fails
We call the installer script but if it fails the user doesn't see the
reason, which makes resolving the problem hard.  Capture both stdout and
stderr as text, and display it to the user when it fails.

(From OE-Core rev: c67fbe17ce063350181c28f99662004737d8b770)

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>
2025-04-29 09:55:32 +01:00
Peter Kjellerstedt
5183200247 insane.bbclass: Report all invalid PACKAGECONFIGs for a recipe at once
Rather than reporting each invalid PACKAGECONFIG with a separate error
message, report them all with one error message.

(From OE-Core rev: bf9366583f53fe2498d7aa9192ebfe6562887cf3)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-04-08 15:49:17 +01:00
Peter Kjellerstedt
35e4c46d06 insane.bbclass: Move test for invalid PACKAGECONFIGs to do_recipe_qa
This makes sure invalid PACKAGECONFIGs are reported also for recipes
that have no do_configure task, e.g., packagegroups.

(From OE-Core rev: d3325c384a7df54c564cae093659cf7b692629f2)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-04-08 15:49:17 +01:00
Yoann Congal
5d2ed873c8 sanity: Check if the C++ toolchain supports --std=gnu++20
This is needed to build nodejs from meta-oe. Check this early to avoid
an error later in the build.

Fixes [YOCTO #15804]

(From OE-Core rev: 19004950ad5691ef51f7fcf946558bd0de561403)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-20 17:49:16 +00:00
Yoann Congal
503ff92f45 sanity: Refactor "C++ toolchain support this flag" check
This can be use to check for other flags.

(From OE-Core rev: 42d012e8414736d89618422fb6f9bce9e4a2a391)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-20 17:49:16 +00:00
Richard Purdie
65db5783d3 sanity: Bump minimum python version requirement to 3.9
Since Ubuntu 20.04 is heading to EoL and that we're having other issues
on that platform needing buildtools anyway, we're about to lose the
last python 3.8 platform we were supporting.

Bump the minimum version to 3.9 since there are many developers wanting
access to newer python features.

This likely won't be seen since the bitbake minimum has also been
increased but helps for documentation purposes.

(From OE-Core rev: c3db241c6e97420ca0705d1535a7cdd0c273b761)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-20 11:29:04 +00:00
Ross Burton
a50f4c3239 mirrors: rationalise Debian mirrors
Change DEBIAN_MIRROR to point at the canonical server, deb.debian.org.

This is a CDN-backed server using network magic to load balance across
the planet so there's no need to set a slew of regional mirrors.

Also add a more recent snapshot.debian.org from the beginning of 2025.

(From OE-Core rev: 3d95d45836accd29916dd8cb9bfe624d63d6c202)

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>
2025-03-06 11:16:46 +00:00
Richard Purdie
2bd5494291 buildstats: Avoid rare UnboundLocalError
In rare cases BUILDNAME can seemingly be None outside of heartbeat events
which leads to UnboundLocalErrors as bsdir and taskdir aren't defined.

Skip the code in these cases rather than generate tracebacks which cause
bitbake server to exit.

(From OE-Core rev: 0f74d804ba0daf7e8bd6481597740b9d89821414)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-03 18:01:29 +00:00
Alexander Kanavin
c92709d4c0 classes/insane: do not leak host uid/gid into package_qa sstate signatures
This prevented package_qa sstate from being reusable unless host uid/gid
values would  match exactly (and they unfortunately do on the yocto autobuilder
worker machines which all share a 'pokybuild' user).

I noticed this when testing CDN sstate reuse, which otherwise works well.

(From OE-Core rev: 6ea8b4b10b0549c858427a8411bf2a4cd5c0eb7b)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-28 07:49:18 +00:00
Sofiane HAMAM
48c946af33 sanity: Check for non ascii chars in TOPDIR
Some modules (like Perl's MakeMaker) do not support non ASCII
characters in build folder's path, this would cause build failures
of software that does not support non ASCII.
A sanity check is added to warn the user.

Fixes [YOCTO #15764]

(From OE-Core rev: 2b3be97a0d0d60d026786a4465b24b6f6752ba32)

Signed-off-by: Sofiane HAMAM <sofiane.hamam@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-20 11:57:49 +00:00
Richard Purdie
cce708b925 base: Fix PACKAGECONFIG handling for cross recipes
We don't have many cross recipes that use PACKAGECONFIG but gdb-cross does,
so correctly remap dependencies for that case allowing the gdb recipe to be
simplified.

(From OE-Core rev: c5bb7976f4d6e8559b4b87e4c3f39135dbb40ef8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-18 22:53:45 +00:00
Richard Purdie
b9dbb45aa6 package_ipk: Use preferred form of --force-postinstall
opkg accepts both - and _ in its options but use the help text
preferred format. From https://github.com/yoctoproject/poky/pull/14
from Philipp-Alexander Blum <blum@gessler.de>.

(From OE-Core rev: 4bea64347407dfb1eb46dacffd05af3bd200b419)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 11:44:19 +00:00
Peter Marko
39cbbd1a87 classes: switch p7zip to 7zip
meta-oe has switched from p7zip to 7zip.
p7zip recipe does not exist anymore and p7zip is provided and rprovided
by 7zip recipe.
Use real provider instead of replaced one.

(From OE-Core rev: 5aa516bfa295d5be919459dfe45f452cdec45e81)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-10 13:03:57 +00:00
Richard Purdie
c2da016918 meta/meta-selftest: Fix variable assignment whitespace
Recipes are much more readable with whitespace around the assignment operators.
Fix various assignments in OE-Core to show this is definitely the preferred
formatting.

(From OE-Core rev: 30ea609d3357fb3de911f2f6a5e6856c151b976a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-01 13:42:34 +00:00
Christos Gavros
0ddac246e1 sanity: Add test for functional c++ toolchain
Users reported issues caused by missing the right libstdc++-version-dev.
A new function 'check_cpp_toolchain' added in sanity.bbclass to test linking libstdc++

[YOCTO #15712]

(From OE-Core rev: 611c1a26212dfbfe8d0640d9fefe5df49f7b69b8)

Signed-off-by: Christos Gavros <gavrosc@yahoo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-27 15:47:11 +00:00
Richard Purdie
90e0a0f7f4 classes/recipes: Switch virtual/XXX-gcc to virtual/cross-cc (and c++/binutils)
The idea of the base class dependency is to say "yes, I need a C cross compiler"
and this was never meant to be gcc specific. Looking at the codebase, whilst we
code triplets into this, it does overcomplicate things as there are only ever
limited, "target", "sdk" and the class extended versions like mutlilib.

After much thought, we can simplify this to virtual/cross-cc and virtual/nativesdk-cross-cc.

This lets us remove the "gcc" specific element as well as removing the over
complicated triplet usage.

At the same time, change the much less widely used "g++" variant to "c++" for
similar reasons and remove the triplet from virtual/XXX-binutils too.

Backwards compatibility mappings could be left but are just going to confuse
things in future so we'll just require users to update.

This simplification, whilst disruptive for any toolchain focused layers, will
make improved toolchain selection in the future much easier.

Since we no longer have overlapping variables, some code for that can just
be removed. The class extension code does need to start remapping some variables
but not the crosssdk target recipe names.

This patch is in two pieces, this one handles the renaming with the functional
changes separate in a second for easier review even if this breaks bisection.

(From OE-Core rev: 4ccc3bc8266c327bcc18c9a3faf7536210dfb9f0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-21 23:09:33 +00:00
Enrico Jörns
2d2d17e136 kernel-yocto: make kernel commits reproducible
The git commit hashes for the kernel checkout are not reproducible under
certain conditions:

- If the git repository is initialized on an archive (rather than a
  git), the initial git commit not only has the current user name set,
  it also uses the current system time as committer and author date.
  This will affect the initial git hash and thus all subsequent ones.

- The patches applied by the kern-tools have a valid author and date.
  However, their committer again depends on the user building the BSP.

This is an issue, for example, if one compiles a kernel with
CONFIG_LOCALVERSION_AUTO enabled where the commit hash lands into the
kernel and thus the package version. This not only makes the package
version non-reproducible, but also leads to version mismatches between
kernel modules built against a fresh kernel checkout and the kernel
retrieved from the sstate cache.

The class uses 'check_git_config' from utils.bbclass, but this only sets
the git user and only if none existed before. Thus it doesn't really
help here.

Since in Git the committer information can be set only from the
environment variables GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, and
GIT_COMMITTER_DATE, we introduce a helper function to set those and
apply the author settings in the same way.
As values simply use PATCH_GIT_USER_NAME, PATCH_GIT_USER_EMAIL (from
patch.bbclass) and SOURCE_DATE_EPOCH.
For convenience, put the new helper 'reproducible_git_committer_author'
into utils.bbclass next to 'check_git_config' so others can use it, too.

Using this helper in kernel-yocto.bbclass makes the committer and author
date/name/email for the initial commit reproducible, as well as the
committer name/email for the patches applied with kern-tools.

For debugging purpose, allow disabling the reproducibility features by
setting KERNEL_DEBUG_TIMESTAMPS to "1".

Suggested-by: Felix Klöckner <F.Kloeckner@weinmann-emt.de>
(From OE-Core rev: aab4517b4649917abd519ea85a20fd9d51bf3d99)

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-21 13:26:07 +00:00
Bastien JAUNY
16c44defcd classes/logging: Added the bbverbnote command to the logging set
Fixes [YOCTO #15688]

Reviewed-by: Yoann Congal <yoann.congal@smile.fr>
(From OE-Core rev: 48e4b8c06e503868404b99bf45a46a52794baa5a)

Signed-off-by: Bastien JAUNY <bastien.jauny@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-20 13:38:59 +00:00
Richard Purdie
d702d9a926 sstate: Ensure errors cause task failure
(From OE-Core rev: c1491ef7afc8722927c568b0ac0ddbbc84837ca3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-08 12:37:20 +00:00
Bin Lan
e71a52a528 package_rpm: set a timestamp handling policy with the new macro %build_mtime_policy
There is the following warning when the do_package_write_rpm task is executed
when bitbake linux-yocto:
  warning: %clamp_mtime_to_source_date_epoch is deprecated, please use %build_mtime_policy

After RPM is upgraded to 4.20.0, the %clamp_mtime_to_source_date_epoch macro is
now deprecated in favor of %build_mtime_policy set to clamp_to_source_date_epoch.

(From OE-Core rev: fa9b9e599bbf3ac73c7a9b1d15ccb0e0bbbe4c11)

Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-04 12:34:04 +00:00
Changqing Li
b5f2bcd0c1 sanity.bbclass: Lower the length of TMPDIR limit to 400
When TMPDIR has length 410,  bitbake uninative-tarball will fail at
do_populate_sdk with error: Failed to open backup database:
"TMPDIR/work/x86_64-nativesdk-pokysdk-linux/uninative-tarball/1.0/sdk/image/var/lib/dnf/history.sqlite"

sqlite3 has a hardcode max pathname limit 512, refer [1], and there is a
check, refer [2], pathname + 8 > max path name limit(512) is not
allowed.  So the pathname length need to <= 504.  While, length of
"TMPDIR/work/x86_64-nativesdk-pokysdk-linux/uninative-tarball/1.0/sdk/image/var/lib/dnf/history.sqlite"
is 505, so error happened.

We had met similar issue [3], and refer the comments, upstream reject
the change of the hardcode length, see [4][5].

This patch try to improve and workaround this issue by lower max TMPDIR
length to 400, at least for distro name length <=13, the build can
success.

[1] https://github.com/sqlite/sqlite/blob/master/src/os_unix.c#L180
[2] https://github.com/sqlite/sqlite/blob/master/src/pager.c#L4777
[3] https://bugzilla.yoctoproject.org/show_bug.cgi?id=12374
[4] https://sqlite.org/cgi/src/tktview/c060923a5422590b3734
[5] https://sqlite.org/forum/forumpost/0b1b8b5116

(From OE-Core rev: da1c0998bdaf5def7ae94f44a33b9a505edc99c1)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-03 11:05:03 +00:00
Robert Yang
284a08b6e4 base/features_check: Make PARSE_ALL_RECIPES and SOURCE_MIRROR_FETCH boolean
So that value "0" can turn them off.

(From OE-Core rev: 1a2afcd0773c5ec5946d1dfc27bde585c52a5724)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-23 11:41:38 +00:00
Ross Burton
5d95623708 classes/utility-tasks: port do_listtasks to use bb.build.listtasks
Instead of iterating every datastore value by hand to find tasks, use
the new bb.build.listtasks() function (bitbake 185c4b)

(From OE-Core rev: 466c3ed0d01bc70caa29d5eb8bb99f7d0e6e710c)

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-12 13:31:27 +00:00
Alexander Kanavin
ea9c2cfb69 rpm: update 4.19.1.1 -> 4.20.0
With this release, as expected, deprecated openpgp support
has been fully removed and replaced with sequoia:
https://github.com/rpm-software-management/rpm-sequoia/

Alas, it's written in rust, and has no recipe, so for now
signing rpm packages has to be disabled.

Remove package name parameter to %prep in source archiving, as it's
been dropped in the new rpm, and wasn't needed to begin with.

Drop 0001-perl-disable-auto-reqs.patch
(files removed upstream).

(From OE-Core rev: 8c15b4577d5e554cc2dd5adfb88b816894b05a9a)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-12 13:22:08 +00:00