summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
Commit message (Collapse)AuthorAgeFilesLines
* do_package/sstate/sstatesig: Change timestamp clamping to hash output onlyRichard Purdie2024-10-281-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was changing the timestamps of the files in the do_package output, particularly the files added for debug sources. This was to do two things: a) make do_package sstate more reproducible b) ensure better hash equivalence matching Unfortuately the debug source files are hardlinks into the source tree for efficiency so touching these, touches a lot of files in ${B} and ${S}. This causes unpredictable effects if compile is run again for example, or could cause compiling in the install task. The hash equivalence matching is of key importance but we can mimic that using clamping of the file timestamps in the depsig output used to generate the hashes. This patch drops the global timestamp clamping, instead allowing the files to retain their creation timestamps into sstate. This makes do_package sstate slightly less reproducibile. We could clamp the sstate timestamps but that would lead to two different sets of timestamps depending on whether the data came from sstate or not. I'd prefer to have consistent code behaviour, rather than differing behavhour depending on whether data came from sstate or not. If we wanted to have reproducibiliy and fix the "corruption" of S/B and have consistent codepaths, the only other option would be two copies of the sources, which could end up huge and seems the least desireable option. This patch therefore drops the timestamp clamping in the sstate files and tweaks the depsig data generation to clamp the timestamps for do_package instead since this seems the best compromise. I validated that rpm/deb/ipk files still generate correctly as before. (From OE-Core rev: 475759fdab7200488b2a568b2ba1aa31a456d113) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/package: Check incompatible licenses at packaging timeJoshua Watt2024-10-252-5/+0
| | | | | | | | | | | | | | | | | | | Instead of checking for incompatible licenses in the anonymous python and setting '_exclude_incompatible-', (re)check all the packages in populate_packages(). This ensures that all packages are processed, even dynamically generated ones. The use of the '_exclude-incompatible-' variable set in base.bbclass has been the mechanism used for per-packages licenses since it was added as a feature (although with different names for the variable throughout history). However, since this misses dynamic packages, calling oe.license.skip_incompatible_package_licenses() a second time on the actual final package set is a better solution. (From OE-Core rev: 1816c5a5e724a7f907c9afe4a47b6699ea081ace) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/license: Move package license skip to libraryJoshua Watt2024-10-251-31/+4
| | | | | | | | | | Moves the code that skips packages with incompatible licenses to the library code so that it can be called in other locations (From OE-Core rev: 86eb409e3c1b30110869ec5a0027ae2d48bbfe7f) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes-global/license: Move functions to library codeJoshua Watt2024-10-252-170/+5
| | | | | | | | | | | | | | Moves several of the functions in license.bbclass to be library code New function dependencies were manually verified using bitbake-dumpsigs to ensure that bitbake identified the same dependencies even though they are now in library code (although the new function names mean that the task hashes still change) (From OE-Core rev: 0333e04e353991260c5f67a72f80f3ab9dcf526a) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Ensure package_qa tasks run in builds when expectedRichard Purdie2024-10-241-0/+2
| | | | | | | | | | | | | Currently, if you "bitbake XXX" and XXX depends on something else, the do_package_qa teask for that something may not run. Users would generally expect it to have though. Add in the missing dependency to ensure that do_build does trigger the right package_qa tasks. (From OE-Core rev: e0beb64c6d3cf1d649f79a8704fb25cdf83b4a8b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: skip check_userns for non-local uidChangqing Li2024-10-221-0/+2
| | | | | | | | | | | | | 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>
* insane: avoid race condition when DEBIAN/CONTROL entries are removedRoss Burton2024-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a race condition when iterating directories which are being altered whilst iterating, which is something that can and does happen when do_package_qa runs at the same time as eg do_package_write_ipkg (the opkg metadata is written inside the build tree). The race is that naive code will list a directory contents and then stat() each name to determine if its a directory or file. The classic failure that we see is that CONTROL/ is found on a listdir but deleted by the time the stat happens, so is incorrectly listed as a file (because it is not a directory). Since Python 3.5, os.walk() uses scandir() instead of listdir() which mitigates this race by returning the file type alongside the name, so a stat is no longer needed to identify the type. However, cachedpath.walk() was copied from Python before this, so it uses listdir() and has this race condition. Since I changed insane to use cachedpath.walk()[1] I inadvertently reintroduced this race. I believe there's actually no need to use cachedpath.walk() and a logical fix is to simply use os.walk(): With os.walk() each directory is listed and categorised in a single os.scandir() as the underlying syscall, getdents64, returns the type. However, cachedpath.walk() uses os.listdir() which ignores the type field returned and has to do a stat() on every file to determine the type. Thus, we should switch users of cachedpath.walk() to os.walk(): there's no real gain in what is effectively just a prefetch for the stat cache, but depending on what the calling code does may result in more stat() calls than needed. In the future we may want to redesign cachedpath to reimplement walk so that it can also cache the DirEntry instances as returned by scandir() as that will avoid needing to call stat() at all in many cases. However I believe we should instead use a caching pathlib.Path instance instead. [1] cad3c8 insane: use oe.cachedpath.CachedPath instead of os.path (From OE-Core rev: 22e4486d65e4874bf48d89160d69118f318278e8) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Don't used cachedpath for os.lstat()Richard Purdie2024-10-141-3/+2
| | | | | | | | | | | The functions behave slightly differently to the functions they're caching and the use in insane.bbclass isn't compatible. For now, to avoid build failures, switch back to the stat calls. We may be able to improve cachedpath or change the call sites. (From OE-Core rev: fa771ae887ab5152f043748cf3419735831bcf7b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm: Check if file exists before open()Pavel Zhukov2024-10-111-4/+12
| | | | | | | | | | | | | | | | Exception handler tries to read() /etc/passwd file in sysroot and if file doesn't exist for any reason then it raises FileNotFoundError exception which mask the original source of the problem and makes debugging of the issue more difficult. Fixes: Exception: FileNotFoundError: [Errno 2] No such file or directory: '/codebuild/output/src1899304708/src/build/tmp-container/work/core2-64-oe-linux/emqx-bin/4.3.12/recipe-sysroot/etc/passwd' (From OE-Core rev: 4ad9a0e0b11eb7bc5a3dd45fc8945e094ea949e9) Signed-off-by: Pavel Zhukov <pavel@zhukoff.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: rewrite package_qa_check_archRoss Burton2024-10-111-16/+25
| | | | | | | | | | Reorder and comment the architecture checks to make it clearer what they are actually checking. (From OE-Core rev: 78db9e79e1a307ffb8436e26656bfb98efb513bc) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: use oe.cachedpath.CachedPath instead of os.pathRoss Burton2024-10-111-14/+28
| | | | | | | | | | | | | | | | | | | The insane QAPATHTESTs make many os.stat() calls, the majority of which are redundant with caching as the initial sweep does a stat() on every entry to determine if it is a file or a directory, and from then on each test that does further stat()s is redundant as the tree doesn't change. Switch os.stat() and friends (os.path.isfile(), etc) to use a common oe.cachedpath.CachedPath() instance that is shared between all of the functions, meaning only one stat is done. In my test case of ltp:do_package_qa, this reduces the time taken from 44s to 37s. (From OE-Core rev: cad3c889439fd6a007debd6f2f6578f4a1e16c9c) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: optimise test in package_qa_check_shebang_sizeRoss Burton2024-10-111-2/+1
| | | | | | | | | | Check whether the elf is not None first, before doing os.stat() calls on disk. Also don't check anything that isn't a file, not just FIFOs. (From OE-Core rev: 38454a2675f38c7db55efcb67bbb8b9fef7e0bf1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: micro-optimise the sweep of pkgfilesRoss Burton2024-10-111-16/+11
| | | | | | | | | | | | | | Don't actively do more work: - Exit early if there are no packages being generated - Don't iterate repeatedly when removing CONTROL and DEBIAN - Extend a list with another list instead of appending item by item - Remove unused variables (From OE-Core rev: 79ffb8896d570dd935d3aea9d28ee20b52e1674a) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: tidy up objdump preloading in package_qa_walk()Ross Burton2024-10-111-10/+11
| | | | | | | | | | | | | | Move the prepopulate function out of global scope, and access the dictionary once instead of repeatedly. This still results in each ELF being opened twice, but this avoids opening all of the files at once and the ELFFile.open() call is fairly fast. (From OE-Core rev: cda3647b32703f43c4fe2af3bab977e5698633f6) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: check for RUNPATH as well as RPATHRoss Burton2024-10-111-4/+4
| | | | | | | | | | | | | | Since oe-core 66f8a7 merged in 2023[1], ld sets DT_RUNPATH instead of DT_RPATH when -rpath is specified, which we don't check for. Update the insane tests to look at both RPATH and RUNPATH. [1] oe-core 66f8a745668a067d8d763fa2af3e65f26c9c1ebe (From OE-Core rev: d6c5076d179a3d5ebb74b719ec4d523c197c1918) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: only parse ELFs if they're files, not symlinksRoss Burton2024-10-111-19/+2
| | | | | | | | | | | This reduces the number of files that need to be swept by not scanning eg the library symlinks, and means we can remove the explicit islink() checks in many of the tests. (From OE-Core rev: aa9ec4b5c719bf610ad953095d1111e4c257747e) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: check for working user namespacesRoss Burton2024-09-131-0/+24
| | | | | | | | | | | | | | | | 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>
* insane: Remove dependency on TCLIBC from QA testRichard Purdie2024-09-051-0/+1
| | | | | | | | | | The TCLIBC value is already encoded into build paths through the triplet so no need to encode it here where it can cause problems for allarch output that span multiple libcs. (From OE-Core rev: ea8c7a457a79589c35ca80b2f265799164855674) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Make do_recipe_qa and do_populate_lic non-arch specificRichard Purdie2024-09-051-2/+2
| | | | | | | | | | | The sstate functions currently pull in STAMP and SSTATE_PKG which end up pulling in DEFAULTTUNE and other variables. The location on disk encodes all the "architecture" information we need so clean up the dependencies of these tasks and make them non-architecture specific. (From OE-Core rev: 65df61ccff6781906449bfea386a8dd13112a51c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* license: Fix directory layout issuesRichard Purdie2024-09-051-2/+8
| | | | | | | | | | | | | | | | There are several issues: a) pointless empty directories were being created as a path wasn't fixed in a previous commit b) SSTATE_PKGARCH wasn't being captured into the task signature since it is in the ignore list by default. We want to capture the absolute value, not the dependencies c) with those issues fixed, cross/native issues became apparent so those need to be fixed too. (From OE-Core rev: f68aed302a0e4b86fb8c16a6ef4e7295bed48b86) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Drop SSTATEPOSTINSTFUNC supportRichard Purdie2024-09-041-6/+0
| | | | | | | | | | | This was deprecated with the introduction of postfunc support for tasks in general and only used by buildhistory. Now that usage has been removed, drop the code from sstate.bbclass. Any other users should be able to use postfuncs too. (From OE-Core rev: 74e08170a5584d83f5f03cd8a71978b5e0895c1d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* buildhistory: Simplify intercept call sites and drop SSTATEPOSTINSTFUNC usageRichard Purdie2024-09-041-1/+4
| | | | | | | | | | | | | | | | We planned to drop SSTATEPOSTINSTFUNC some time ago with the introduction of postfuncs. Finally get around to doing that which should make the buildhistory code a little more readable. Unfortunately ordering the buildhistory function calls after the sstate ones is difficult without coding that into the sstate class. This patch does that to ensure everything functions as expected until we can find a better way. This is still likely preferable than the generic sstate postfuncs support since the function flow is much more readable. (From OE-Core rev: c9e2a8fa2f0305ef1247ec405555612326f798f8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* abi-version/ssate: Bump to avoid systemd hash corruption issueRichard Purdie2024-09-011-1/+1
| | | | | | | | | | | | Unfortunately some recent patches caused non-deterministic output. One input hash lead to both good and bad output and whilst that patch has been fixed, the problematic hash 'cross' linkage remains. Bump to a new sstate and hash equivalence version to avoid this and work from a clean slate. (From OE-Core rev: 639e42b9c14dff516688964dba4ab25bba7b8a55) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Remove redundant returnsOla x Nilsson2024-09-011-3/+0
| | | | | | | | | | Some redundant return statements were left over from insane: Drop oe.qa.add_message usage (From OE-Core rev: 1e49635f802b04acad14115640ce9fcd63cc32a7) Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Allow ERROR_QA to use 'contains' hash optimisations for do_package_qaRichard Purdie2024-08-291-34/+36
| | | | | | | | | | | | | | | | | | | We want ERROR_QA to operate using the "contains" optimizations which means accessing the variable only using the contains function. To do this, remove usage of ALL_QA, open coding the few references to check both WARN_QA and ERROR_QA. Move the function table generation to a separate function where we can exclude the ERROR_QA and WARN_QA variables since they are handled by the handle_error() function calls. Ensure all the chain of functions to the handle_error calls is correctly recognised in the variable dependencies. (From OE-Core rev: 384e9a6b2e7943b6a3ade1215ed79351c78a0b0d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Further simplify codeRichard Purdie2024-08-291-27/+14
| | | | | | | | | Now handle_error is used, we can further simplify the QA test execution as we don't need seperate function lists for warnings and errors. (From OE-Core rev: 6896c9fcfc57f007c0ce15f7804e79b6b88f5ded) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Add missing vardepsexcludeRichard Purdie2024-08-291-0/+2
| | | | | | | | | | | | If we improve the function dependency visibility in insane.bbclass, it exposes some dependencies which were previously not seen causing variances in the do_package_qa task checksums. Update vardepsexclude in a couple of test cases to ensure the sstate hash selftests pass and the taskhashes don't vary when we don't expect them too. (From OE-Core rev: 9b6dae2771ed86bd2946548004f4da58e8c0b44c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Drop oe.qa.add_message usageRichard Purdie2024-08-291-138/+87
| | | | | | | | | | | | | | | Drop the oe.qa.add_message() usage in favour of oe.qa.handle_error() which has code allowing it to be optimised with contains usage. The patch also drops unused return values which we stopped using a while ago and drops the now unneeded function parameters, generally leading to cleaner code. The code should be functionally equivalent. (From OE-Core rev: 9b2eea9fd4eab4f5e12e955738db22091b91f698) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Optimise ERROR_QA/WARN_QA references in do_populate_sysrootRichard Purdie2024-08-291-3/+2
| | | | | | | | | | The new contains code can't inspect variable references in handle_error() calls. Expand what is effectively a hardcoded reference anyway so the code can optimise it. (From OE-Core rev: 51f767d92efb3daeb4aa3b91d72e6d2993cb0f46) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: split guess_license functionEnguerrand de Ribaucourt2024-08-231-4/+4
| | | | | | | | | | | | | | | The npm recipetool handler redefines the license code the could be unified. In order to do this refactoring, extract the bits we'll need into separate functions. guess_license() is renamed to find_licenses() and is split into find_license_files() and match_licenses(). (From OE-Core rev: f1ec28feaea8ea6a2df894dd4ddba561c8a04ed2) Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* license_image.bbclass: Rename license-incompatible to license-exceptionPeter Kjellerstedt2024-08-211-1/+1
| | | | | | | | | | | | | | | | There is currently both an incompatible-license and a license-incompatible QA message. This is very confusing. However, license-incompatible is only used to output a message when a package is included in an image despite it having a license that is normally incompatible (by using the INCOMPATIBLE_LICENSE_EXCEPTIONS variable). To better match how it is used and to distinguish it from incompatible-license, rename it to license-exception. (From OE-Core rev: d309eed66f5a4a4bce082536e51207fe65725fab) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: add new retain class for retaining build resultsPaul Eggleton2024-08-031-0/+182
| | | | | | | | | | | | | | | | | | | | If you are running your builds inside an environment where you don't have access to the build tree (e.g. an autobuilder where you can only download final artifacts such as images), then debugging build failures can be difficult - you can't examine log files, the source tree or output files. When enabled, by default this class will retain the work directory for any recipe that has a task failure in the form of a tarball, and can also be configured to save other directories on failure or always. It puts these tarballs in a configurable location (${TMPDIR}/retained by default), where they can be picked up by a separate process and made available as downloadable artifacts. (From OE-Core rev: e2030c0d747eb990b9ad10098c6b74d6f8f4e74e) Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: remove obsolete QA errorsMichal Sieron2024-07-301-4/+4
| | | | | | | | | | | | Those were removed quite some time ago: - perms: 5da7ad1a483d0840a9a2e3b95fa62a1901be73f2 - split-strip: bcc03ea19e103f6aa93bada2f49fcc5cc7bc0790 - (compile|install)-host-path: a67e9ebfd5b8002fd4a7d8d27ff0d997817f76e1 (From OE-Core rev: 068d3821430734132c3eb70fd95461e0917fd1e8) Signed-off-by: Michal Sieron <michalwsieron@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: add pep517-backend to WARN_QARoss Burton2024-07-261-1/+1
| | | | | | | | | | Enable the new pep517-backend warning from setuptools3, initially as a warning so as not to break builds straight away. (From OE-Core rev: 27597d986ad7b3a6c2d36150a163951be7c640f1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: skip unimplemented-ptest checks if disabledYoann Congal2024-07-161-1/+1
| | | | | | | | | | | This avoids searching through ${S} multiple times if unimplemented-ptest QA check is disabled (the default case). (From OE-Core rev: 8ee42430a91d13de2b7a53c2ae04aa54bd76fad0) 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>
* Revert "insane: skip unimplemented-ptest on S=WORKDIR recipes"Yoann Congal2024-07-161-2/+0
| | | | | | | | | | | | S=WORKDIR is not supported anymore, so the check is now redundant. This reverts commit 9a2d2f7c2b7236667a6d80355f73db4c27e6582e (in OE-Core). (From OE-Core rev: 71c4bba0235b4cd45dc88844263e7b3f8ad9f079) 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>
* insane: Promote long standing warnings to errorsRichard Purdie2024-07-141-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of these warnings have been around and enabled for a long time. In particular, buildpaths has been like this for two years. I'm aware some layers still have not been able to resolve all the warnings but I believe that regardless, it is still time to raise the bar. If the warnings don't get fixed, it is probably a sign that nobody cares about the recipe and it should be dropped. For anyone coming here to find out what changed and how to disable it, if you are going to remove from ERROR_QA and add back to WARN_QA (or just ignore the warnings), please do it with a layer specific override rather than making it global. We have fixed these issues in core and intend to keep them all fixed. If you globally disable the errors, it just means we get patches which end up regressing things. You can do things like: ERROR_QA:remove:layer-mylayername = "buildpaths" not that I'd recommend it. Also note that the next version of Yocto Project Compatible will only be available to layers which are not disabling some set of these errors. (From OE-Core rev: b79b191cc43a45dde2adb61ea349b426cb2461d1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes-global/staging: Exclude do_create_spdx from automatic sysroot extensionJoshua Watt2024-07-131-1/+8
| | | | | | | | | | | | | | | | do_create_spdx is a outlier in that it doesn't need the RSS to be extended just because it depends on do_populate_sysroot. In fact, it only depends on do_populate_sysroot so it can see the actual recipes sysroot, and attempting to extend the sysroot can cause problems for some recipes (e.g. if a recipe does do_populate_sysroot[noexec] = "1") As such, explicitly exclude do_create_spdx from extending the sysroot just because it depends on do_populate_sysroot. (From OE-Core rev: 8b506f327838b885bfeb2cf144f43c8be68b8591) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* abi_version/package: Bump hashequiv version and package class versionRichard Purdie2024-07-051-1/+1
| | | | | | | | | | | | | | The recent pkgconfig change and subsqeuent fixes have left the hash equivalence server in a corrupted state with hashes linking the changes beofore and after the pkgconfig change, breaking reproducibile builds. Bump the appropriate version numbers to allow us to move on and avoid build failures and corrupt equivalence data now the underlying issue was fixed. (From OE-Core rev: 7b2cdd257132645534642a1461fe14b835eee6e8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils.bbclass: Use objdump instead of readelf to compute SONAMEKhem Raj2024-07-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | LLVM has changed the ELF header dump format [1], the code in oe_libinstall relied upon the format and processed the SONAME inside square brackets e.g. 0x000000000000000e (SONAME) Library soname: libreadline.so.8 with older readelf from ( llvm <19 or GNU binutils objdump ) we get 0x000000000000000e (SONAME) Library soname: [libreadline.so.8] The check in oe_libinstall will now trip over ELF files read by llvm-readelf from llvm19+ To make it portable which works across GNU binutils and LLVM tools switch to using objdump -p to dump the ELF file and modify the regexp accordingly, as an aside, the post processing expression is simplified too [1] https://github.com/llvm/llvm-project/pull/96562 (From OE-Core rev: 11ea8dc57f275057e19db564e6c55d2baea980b0) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* binutils-cross-testsuite: Rename to binutils-testsuiteJoshua Watt2024-06-271-1/+1
| | | | | | | | | | | This recipe needs to be renamed because the "-cross-" substring in the name triggers the cross architecture detection in sstate, but this recipe is not actually a cross recipe. (From OE-Core rev: 812c114a8a872ad59b19c7ffb8c1f230fc64c823) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: add patch-status to default ERROR_QAMartin Jansa2024-06-121-2/+1
| | | | | | | | | | | | | | | | * it's enabled for patches in oe-core for very long time and I was using it for many other layers as well, so most layers should be in good shape * it's also possible to disable it for individual layer as shown by oe-core in: https://git.openembedded.org/openembedded-core/commit/meta/classes-global/insane.bbclass?h=scarthgap&id=61a881fdbe8b5a21c6276b8a5d06cc30486b1eb3 (From OE-Core rev: b7fb91c797ab37a029b8dd1eb7277a7468bc97ed) Signed-off-by: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: show cleaned build paths in more testsRoss Burton2024-06-071-5/+5
| | | | | | | | | | A few tests were still manually cleaning their build paths, change them to use package_qa_clean_path(). (From OE-Core rev: f6550c3ee1bc076015d85db36b3d281e6a7ace9d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: error out on UNPACKDIR = WORKDIRKonrad Weihmann2024-06-041-0/+3
| | | | | | | | | | as this will clear WORKDIR and create race conditions across various handling tasks (From OE-Core rev: 1cf99ce3f79b2c96bdef5aa9b69c2b3ead7e46f1) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* autotools/libtool: Drop libtool sysroot patch as not neededRichard Purdie2024-06-041-1/+1
| | | | | | | | | | | | | libtool auto detects the sysroot from gcc's parameters or configuration so we don't need to pass in this configuration separately to libtool. Whilst the option names do conflict with gcc/binutils, that is an issue for those projects to resolve, not us. Upstream libtool did reject the patch. We can drop this patch and simplify our code. (From OE-Core rev: 7c8553f81bccc3e8c2bb1116ee1e89f5f8af4c9e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane.bbclass: remove leftover variables and commentEmil Kronborg2024-06-031-4/+0
| | | | | | | | | | | | | | | The code that used these variable and the comment was introduced in commit b44d32ef41ef ("insane.bbclass: Portions of code were not running, fix this and sync with OE.dev. Also add tests for bad sysroot rpaths in binaries"). Later, in commit 17dae13fabe2 ("insane.bbclass: Fix ELF bitsize comparison"), some of that code was removed again, but not the variables and the comment. (From OE-Core rev: 730d00b0d1d1d617b62900be12fa034bb41fc48b) Signed-off-by: Emil Kronborg <emil.kronborg@protonmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane.bbclass: fix HOST_ variable namesEmil Kronborg2024-06-031-6/+6
| | | | | | | | | | | | | Commit cd25e5544ca3 ("insane: use HOST_ variables, not TARGET_ to determine the cross system") updated the variables themselves, but not their names. To prevent confusion, match the Python variable name to the BitBake variable name. (From OE-Core rev: f5bebc96580ec74d10bc96b4265357ebc9bcd6ad) Signed-off-by: Emil Kronborg <emil.kronborg@protonmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane.bbclass: remove skipping of cross-compiled packagesEmil Kronborg2024-06-031-5/+0
| | | | | | | | | | | | | After commit cd25e5544ca3 ("insane: use HOST_ variables, not TARGET_ to determine the cross system"), this check is no longer necessary. The introduction of HOST_ variables ensures architecture compatibility is correctly checked. (From OE-Core rev: 6e1ddeb05dcd5ff77e0f5526a6e56a484daa4864) Signed-off-by: Emil Kronborg <emil.kronborg@protonmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib: package: Add file_reverse_translateJoshua Watt2024-06-031-6/+2
| | | | | | | | | | | | | Adds API to reverse the removal of special characters from file names so it can be correctly done in multiple places without open-coding it. Replace the translation done in the package_rpm.bbclass with the new API (From OE-Core rev: 4cb7e93c624987d146aaf626ce8e99568e938a70) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: Check if tar is gnutarSimone Weiß2024-05-311-0/+3
| | | | | | | | | | | | | | 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>