summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
Commit message (Collapse)AuthorAgeFilesLines
* sanity: Add sanity test for 'bad' gcc installs on ubuntu 24.04Richard Purdie13 days1-0/+7
| | | | | | | | | | | 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>
* base.bbclass: Deferred inherit native toolchain classKhem Raj2025-07-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* sanity: Reference gcc/g++ directlyRichard Purdie2025-07-031-6/+6
| | | | | | | | | | | | | 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>
* sanity/utils: Directly use gcc, not BUILD_CCRichard Purdie2025-07-031-6/+3
| | | | | | | | | 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>
* uninative/utils: Drop workarounds for gcc 4.8/4.9Richard Purdie2025-07-031-1/+1
| | | | | | | | | 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>
* base: Use OE_SHARED_UMASK for do_fetchRichard Purdie2025-07-011-0/+1
| | | | | | | | | 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>
* bitbake.conf/sstate: Introduce OE_SHARED_UMASK to standarise shared area umaskRichard Purdie2025-07-011-5/+7
| | | | | | | | | | 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>
* sstate: apply proper umask when fetching from SSTATE_MIRRORRasmus Villemoes2025-06-261-10/+12
| | | | | | | | | | | | | | | | 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>
* base.bbclass: drop compatibility moving of sources into workdirAlexander Kanavin2025-06-201-10/+3
| | | | | | | | | | | | | | | | | | | | | 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>
* insane/do_qa_unpack: add checks that ensure S is set correctlyAlexander Kanavin2025-06-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* toolchain: Provide abstraction for recipe specific toolchain selectionRichard Purdie2025-06-161-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* base: Add deferred class event handlerRichard Purdie2025-06-161-1/+10
| | | | | | | | | | | | | 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>
* insane: Fix debug-deps checkRyan Eatmon2025-06-161-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* insane: add test for recipe naming/class mismatchesRoss Burton2025-06-091-1/+8
| | | | | | | | | | | | | | | | | | 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>
* insane.bbclass: Add unimplemented-ptest detection for cargo-based testsInes KCHELFI2025-05-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | 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>
* bitbake.conf/pseudo: Switch from exclusion list to inclusion listRichard Purdie2025-05-123-4/+3
| | | | | | | | | | | | | | | | | 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>
* classes/yocto-check-layer: add check for tasks that allow network accessRoss Burton2025-05-051-0/+30
| | | | | | | | | | | | | | | | | | 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>
* classes/yocto-check-layer: refactor to be extended easilyRoss Burton2025-05-051-6/+10
| | | | | | | | | | 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>
* uninative: show errors if installing failsRoss Burton2025-04-291-2/+4
| | | | | | | | | | | | 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>
* insane.bbclass: Report all invalid PACKAGECONFIGs for a recipe at oncePeter Kjellerstedt2025-04-081-4/+4
| | | | | | | | | | | 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>
* insane.bbclass: Move test for invalid PACKAGECONFIGs to do_recipe_qaPeter Kjellerstedt2025-04-081-10/+10
| | | | | | | | | | | 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>
* sanity: Check if the C++ toolchain supports --std=gnu++20Yoann Congal2025-03-201-0/+5
| | | | | | | | | | | | 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>
* sanity: Refactor "C++ toolchain support this flag" checkYoann Congal2025-03-201-5/+5
| | | | | | | | | 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>
* sanity: Bump minimum python version requirement to 3.9Richard Purdie2025-03-201-3/+3
| | | | | | | | | | | | | | | | 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>
* mirrors: rationalise Debian mirrorsRoss Burton2025-03-061-17/+1
| | | | | | | | | | | | | | | 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>
* buildstats: Avoid rare UnboundLocalErrorRichard Purdie2025-03-031-6/+9
| | | | | | | | | | | | 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>
* classes/insane: do not leak host uid/gid into package_qa sstate signaturesAlexander Kanavin2025-02-281-0/+1
| | | | | | | | | | | | | 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>
* sanity: Check for non ascii chars in TOPDIRSofiane HAMAM2025-02-201-0/+9
| | | | | | | | | | | | | | 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>
* base: Fix PACKAGECONFIG handling for cross recipesRichard Purdie2025-02-181-1/+1
| | | | | | | | | | 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>
* package_ipk: Use preferred form of --force-postinstallRichard Purdie2025-02-111-1/+1
| | | | | | | | | | 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>
* classes: switch p7zip to 7zipPeter Marko2025-02-101-2/+2
| | | | | | | | | | | | 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>
* meta/meta-selftest: Fix variable assignment whitespaceRichard Purdie2025-02-011-1/+1
| | | | | | | | | | 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>
* sanity: Add test for functional c++ toolchainChristos Gavros2025-01-271-0/+25
| | | | | | | | | | | | 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>
* classes/recipes: Switch virtual/XXX-gcc to virtual/cross-cc (and c++/binutils)Richard Purdie2025-01-212-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* kernel-yocto: make kernel commits reproducibleEnrico Jörns2025-01-211-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* classes/logging: Added the bbverbnote command to the logging setBastien JAUNY2025-01-201-0/+10
| | | | | | | | | | | 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>
* sstate: Ensure errors cause task failureRichard Purdie2025-01-081-0/+4
| | | | | | (From OE-Core rev: c1491ef7afc8722927c568b0ac0ddbbc84837ca3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: set a timestamp handling policy with the new macro ↵Bin Lan2025-01-041-1/+1
| | | | | | | | | | | | | | | | %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>
* sanity.bbclass: Lower the length of TMPDIR limit to 400Changqing Li2025-01-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* base/features_check: Make PARSE_ALL_RECIPES and SOURCE_MIRROR_FETCH booleanRobert Yang2024-12-231-3/+4
| | | | | | | | | | 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>
* classes/utility-tasks: port do_listtasks to use bb.build.listtasksRoss Burton2024-12-121-12/+11
| | | | | | | | | | | 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>
* rpm: update 4.19.1.1 -> 4.20.0Alexander Kanavin2024-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* base.bbclass: fix RRECOMMENDS extend issue for multilibChangqing Li2024-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During handle PACKAGECONFIG, DEPENDS/RDEPENDS/RRECOMMENDS is appended by calling function appendVar according to the PACKAGECONFIG setting: PACKAGECONFIG[f1] = "\ --with-f1, \ --without-f1, \ build-deps-for-f1, \ runtime-deps-for-f1, \ runtime-recommends-for-f1, \ packageconfig-conflicts-for-f1" [snip of base.bbclass] pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {} if pkgconfigflags: ... appendVar('DEPENDS', extradeps) appendVar('RDEPENDS:${PN}', extrardeps) appendVar('RRECOMMENDS:${PN}', extrarrecs) ... [snip of base.bbclass] After following commit in meta-oe, [fe3ba7ac5c cryptsetup: demote udev runtime dependency to recommendation] 'udev lvm2' changed from RDEPENDS to RRECOMMENDS, but RRECOMMENDS is not handled in this process, and causes following error: $bitbake lib32-cryptsetup ERROR: QA Issue: lib32-cryptsetup package lib32-cryptsetup - suspicious values 'udev lvm2' in RRECOMMENDS [multilib] In layer openembedded-core, we do have very few recipes that have runtime-recommends-for-f1 in PACKAGECONFIG setting, but f1 is not enabled in PACKAGECONFIGS, so not report error when multilib is enabled. (From OE-Core rev: 2f539a1318a80d3ad5d0d43a9ba4070465e402af) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes-global/insane: Handle case where RPROVIDER is also a providerJoshua Watt2024-12-121-8/+13
| | | | | | | | | | | | | | | | | | | The check to see if a provider of a given package is listed first checks for an exact match of the provider name. However, if this match existed, but didn't match in the task dependencies, it would not continue to look for other providers of package. This would manifest if one (non-virtual) recipe package RPROVIDES the name of a package produced by another recipe. Fix this, and also clean up the code to make it more readable by using a function to check if a runtime dependency is in the task dependencies. In addition, if no provider is found, list all the possible providers instead of the last one that was looked at. (From OE-Core rev: f13de6ab616eb1e38960a2296111febe2a9f4a28) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib: move buildstats.py and rootfspostcommands.py into oeChen Qi2024-12-051-2/+2
| | | | | | | | | | | These two files are the only ones that are left in meta/lib. They logically belong to meta/lib/oe, so move them there. (From OE-Core rev: c65dd0e3e463d6072b9364ac74e1fef0d998068f) 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>
* yocto-check-layer: expand to cover all required QA checksDenys Dmytriyenko2024-12-031-0/+28
| | | | | | | | | | | | | | insane.bbclass now defines CHECKLAYER_REQUIRED_TESTS list with required QA checks that are becoming mandatory for Yocto Project Compatible layers. Update yocto-check-layer.bbclass in order to catch when packages from such layers try to skip any of the required QA checks. (From OE-Core rev: 9c3ba88628853b20fb4c98c99cf3fe8349024016) Signed-off-by: Denys Dmytriyenko <denys@konsulko.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Split ERROR_QA into CHECKLAYER_REQUIRED_TESTSRichard Purdie2024-11-281-19/+18
| | | | | | | | | | | | | | | We'd like to start requiring some set of checks are enabled for Yocto Project Compatible Status and to pass yocto-check-layer. Start by splitting ERROR_QA into two sets, the ones we think can be required and the ones we know have challenges to implement (e.g. with prebuilt binaries). To change the required list, the YP TSC would need to approve. (From OE-Core rev: ce2e42ace2d15fb6745437cf0a7f07d28398ca12) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: restrict rpm to 4 threadsAlexander Kanavin2024-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TL;DR version: with this, and the previous compression level changes I am seeing drastic speedups in package_write_rpm completion times: webkitgtk goes from 78 seconds to 37 seconds glibc-locale goes from 399 seconds to 58 seconds (!) The long version: rpm uses multithreading for two purposes: - spawning compressors (which are nowadays themselves multi-threaded, so the feature is not as useful as it once was) - parallel file classification While the former behaves well on massively parallel CPUs (it was written and verified here :), the latter was then added by upstream and only benchmarked on their very old, slow laptop, apparently: https://github.com/rpm-software-management/rpm/commit/41f0e214f2266f02d6185ba11f797716de8125d4 On anything more capable it starts showing pathologic behavior, presumably from spawning massive amount of very short-lived threads, and then having to synchronize them. For example classifying glibc-locale takes 5m20s with 256 threads (default on my machine!) 1m49s with 64 threads 59s with 16 threads 48s with 8 threads Even a more typical recipe like webkitgtk is affected: 47s with 256 threads 32s with 64 threads 27s with 16 or 8 threads I have found that the optimal amount is actually four: this also means that only four compressors are running at a time, but as they're themselves using threads, and typical recipes are dominated by just two or three large packages, this does not affect overall completion time. (From OE-Core rev: 286d456e71ee2730c197ce394d6be2c7eeced18d) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: use zstd's default compression levelAlexander Kanavin2024-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | zstd uses 3 by default (and ZSTD_COMPRESSION_LEVEL is set to that), while 19 is the highest and slowest. It's not clear why 19 was picked to begin with, possibly I copy-pasted it from rpm's examples without thinking: https://git.yoctoproject.org/poky/commit/?h=master-next&id=4a4d5f78a6962dda5f63e9891825c80a8a87bf66 This brings significant speedups in rpm's compression step: for example compressing webkitgtk takes 11s instead of 36s. The rpm size increases from 175648k to 234860k. I think it's a worthy default tradeoff. (From OE-Core rev: f1c7d76361425c85d68ad1f61be1e7ff05df4bab) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: rewrite sstate_archive_package in pythonRoss Burton2024-11-181-27/+26
| | | | | | | | | | | | | | As sstate_archive_package just calls tar, writing the function in shell is actually more complex and opaque than the equivalent python. Don't check for zstd vs pzstd, we have pzstd in HOSTTOOLS so it will always be available. (From OE-Core rev: c9ac5d9d94f254292cf3cafdf273dd6b61d3baa7) 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>