Commit Graph

24 Commits

Author SHA1 Message Date
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
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
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
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
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
Changqing Li
570560f59b sanity.bbclass: skip check_userns for non-local uid
Bitbake preserve network for non-local uid, refer [1],
so check_userns is not needed for non-local uid

[1] https://git.openembedded.org/bitbake/commit/?id=4eafae7904bae6e5c6bc50356e8a9077f2e207fa

(From OE-Core rev: 808d0cece22bcbee15236717e158da247cbedaf1)

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>
2024-10-22 12:28:18 +01:00
Ross Burton
7004840f3d sanity: check for working user namespaces
If user namespaces are not available (typically because AppArmor is
blocking them), alert the user.

We consider network isolation sufficiently important that this is a fatal
error, and the user will need to configure AppArmor to allow bitbake to
create a user namespace.

[ YOCTO #15592 ]

(From OE-Core rev: b6af956fe6e876957a49d4abf425e8c789bf0459)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-13 10:28:10 +01:00
Simone Weiß
af6d28d2b0 sanity: Check if tar is gnutar
In sanity.bbclass the tar version is checked as tar needs to be recent enough
for reproducible builds. Tar could also be provided by other means then gnutar,
but we mean the version of gnutar in the check. Hence we also should ensure
that the installed tar is gnutar.

[YOCTO #14205]

(From OE-Core rev: bdef30bd887cd208d7822dd7853d33e24a6b7a4c)

Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-31 16:58:36 +01:00
Khem Raj
ca93c215fd sanity: Use diff instead of meld by default
meld fallback assumes that user has a gnome desktop
its better to fallback to good old diff tool which
will most distributions on build host will carry

(From OE-Core rev: d027236eac2a136b06903d4a47adbc50ccd6b7c6)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-11 08:55:24 +01:00
Michal Sieron
80396cc72a sanity.bbclass: raise_sanity_error if /tmp is noexec
Older meson versions save temporary scripts in /tmp.
Similarly some recipies also do that (e.g. ccan in sbsigntool).

As this can lead to unexpected build failures with no simple way
to workaround, make such setup a fatal error.

(From OE-Core rev: ee93a8e89322143252040bd5bc99259c5efff831)

Signed-off-by: Michal Sieron <michalwsieron@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-13 13:51:41 +00:00
Philip Balister
cddf8e9f53 sanity.bbclass: Check for additional native perl modules.
Since we use the build systems native perl, we need to check that all
perl modules required for a build are installed. For a default Fedora 39
install, autoconf-native and libxcrypt both fail to build due to missing
perl modules. After taking careful notes, this commits adds checks for
File::Compare, File::Copy, open, and FindBin.

[YOCTO #14691]

(From OE-Core rev: 3d09e759f838a7ce66fd1fb6e6a6653abce9e3a4)

Signed-off-by: Philip Balister <philip@balister.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-03 23:36:34 +00:00
Emil Ekmečić
d151ba95f6 Add GCP fetcher to list of supported protocols
If accepted, this patch should merge with the corresponding BitBake
patch titled "fetch2: add Google Cloud Platform (GCP) fetcher".

(From OE-Core rev: 1e2e596bcdff031d7d7dc1d6f6adbb03d9ec2995)

Signed-off-by: Emil Ekmečić <eekmecic@snap.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-14 12:51:21 +01:00
Mark Hatle
38e3769a72 sanity.bbclass: Update minimum gcc version to 8.0
With a gcc older then 8.0, mesa-native will fail to build with the error:
  sorry, unimplemented: non-trivial designated initializers not supported

According to https://docs.mesa3d.org/install.html?highlight=gcc+version#compile
the required minimum compiler version is now GCC 8.0.

(From OE-Core rev: aa466053bf8a4b7998a462f0b49372d3a68a28e3)

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-04 21:55:21 +01:00
Alexander Kanavin
d369a45ae7 meta/conf: move default configuration templates into meta/conf/templates/default
This sets the ground for standardizing (and enforcing) the location of
configuration templates: let's start with the default one.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-02-16 17:11:11 +00:00
Yoann Congal
ff47bf6ed9 sanity: Fix small typos
* reproducibile -> reproducible
* distrubution -> distribution
* Joined lines gone awry
* and and -> and

(From OE-Core rev: 60196e7512e97c2509256403dad5c8a23dce32fc)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-26 21:06:57 +00:00
Richard Purdie
9c36aef610 sanity: Update minimum python version to 3.8
Bitbake is moving to a minimum python version of 3.8, update OE-Core
to match to make things consistent.

(From OE-Core rev: cc05bc04156122fd6f918191a9cec7bc0392415e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-12 16:16:56 +00:00
Richard Purdie
b955eea197 sanity: Drop data finalize call
This call was effectively like update_data and no longer did anything
in bitbake. Drop it as it is obsolete.

(From OE-Core rev: d3eb4531aae28a07cb7e52ed5fe1102445d2effd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-14 16:19:43 +00:00
Alexander Kanavin
48abeedd63 sanity.bbclass: do not check for presence of distutils
This will be removed in 3.12 and has been deprecated for a while.

If anything breaks because of its absence on the host, this would
expose the breakage so it can be fixed.

icu source specifically does not refer to distutils anywhere.

(From OE-Core rev: 8e3a5b0709384f2b455a82ac1e8e212686fe4456)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-11 13:43:40 +00:00
Ross Burton
05de18eae7 sanity: check for GNU tar specifically
We need the system tar to be GNU tar, as we reply on --xattrs.  Some
distributions may be using libarchive's tar binary, which is definitely
not as featureful, so check for this and abort early with a clear
message instead of later with mysterious errors.

(From OE-Core rev: 7dd2b1cd1bb10e67485dab8600c0787df6c2eee7)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-29 16:28:36 +01:00
Adrian Freihofer
988a27974f own-mirrors: add crate
Support downloading crate files from a mirror at SOURCE_MIRROR_URL.

(From OE-Core rev: aebf4f183267a1e2f073078ade0ddc916ceed53f)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-25 13:42:03 +01:00
Shubham Kulkarni
359ca09e7d sanity: add a comment to ensure CONNECTIVITY_CHECK_URIS is correct
In sanity.bbclass, in function check_connectivity :
Connectivity is tested by fetching URIs in variable CONNECTIVITY_CHECK_URIS.
If none is accessible, the status error is ambiguous.

It says to ensure the host's network is correctly configured but
never if the remote is available.

(From OE-Core rev: 9865176df6b6362a410b0fc3c115d942462dc338)

Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-21 22:51:43 +01:00
Richard Purdie
fd1517e2b5 classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take
advantage of new bitbake functionality to check class scope/usage.

(From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 15:27:17 +01:00