Commit Graph

72 Commits

Author SHA1 Message Date
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
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
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
Joshua Watt
9b80c039ad classes-global/insane: Handle case where RPROVIDER is also a provider
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>
2024-12-12 12:55:56 +00:00
Richard Purdie
fea5b7b452 insane: Split ERROR_QA into CHECKLAYER_REQUIRED_TESTS
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>
2024-11-28 00:07:30 +00:00
Richard Purdie
b605bf9a32 insane: Ensure package_qa tasks run in builds when expected
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>
2024-10-24 15:18:54 +01:00
Ross Burton
f85c68cb9c insane: avoid race condition when DEBIAN/CONTROL entries are removed
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>
2024-10-15 11:47:24 +01:00
Richard Purdie
6dfe291284 insane: Don't used cachedpath for os.lstat()
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>
2024-10-14 21:42:17 +01:00
Ross Burton
a475c8ab38 insane: rewrite package_qa_check_arch
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>
2024-10-11 12:17:03 +01:00
Ross Burton
fe5cf7dc81 insane: use oe.cachedpath.CachedPath instead of os.path
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>
2024-10-11 12:17:03 +01:00
Ross Burton
c812b378e0 insane: optimise test in package_qa_check_shebang_size
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>
2024-10-11 12:17:03 +01:00
Ross Burton
68e5aa9b92 insane: micro-optimise the sweep of pkgfiles
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>
2024-10-11 12:17:03 +01:00
Ross Burton
827716ac0a insane: tidy up objdump preloading in package_qa_walk()
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>
2024-10-11 12:17:03 +01:00
Ross Burton
876d319f73 insane: check for RUNPATH as well as RPATH
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>
2024-10-11 12:17:03 +01:00
Ross Burton
27ab030dc0 insane: only parse ELFs if they're files, not symlinks
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>
2024-10-11 12:17:03 +01:00
Richard Purdie
1948bdf639 insane: Remove dependency on TCLIBC from QA test
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>
2024-09-05 21:50:10 +01:00
Ola x Nilsson
4a3eb4f487 insane: Remove redundant returns
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>
2024-09-01 11:05:20 +01:00
Richard Purdie
be6a4145ea insane: Allow ERROR_QA to use 'contains' hash optimisations for do_package_qa
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>
2024-08-29 21:58:19 +01:00
Richard Purdie
e7e2019180 insane: Further simplify code
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>
2024-08-29 21:58:19 +01:00
Richard Purdie
94ca459727 insane: Add missing vardepsexclude
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>
2024-08-29 21:58:19 +01:00
Richard Purdie
796ef498fa insane: Drop oe.qa.add_message usage
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>
2024-08-29 21:58:19 +01:00
Richard Purdie
89c308bc47 insane: Optimise ERROR_QA/WARN_QA references in do_populate_sysroot
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>
2024-08-29 21:58:19 +01:00
Peter Kjellerstedt
e1555ba6f2 license_image.bbclass: Rename license-incompatible to license-exception
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>
2024-08-21 21:51:49 +01:00
Michal Sieron
7d9717a215 insane: remove obsolete QA errors
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>
2024-07-30 12:32:53 +01:00
Ross Burton
eec07311b2 insane: add pep517-backend to WARN_QA
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>
2024-07-26 12:28:42 +01:00
Yoann Congal
d85a10e498 insane: skip unimplemented-ptest checks if disabled
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>
2024-07-16 11:56:53 +01:00
Yoann Congal
c45d45422d Revert "insane: skip unimplemented-ptest on S=WORKDIR recipes"
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>
2024-07-16 11:56:53 +01:00
Richard Purdie
e665be2ad9 insane: Promote long standing warnings to errors
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>
2024-07-14 13:04:29 +01:00
Martin Jansa
0670ea7be8 insane: add patch-status to default ERROR_QA
* 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>
2024-06-12 16:08:31 +01:00
Ross Burton
5bcc84deb4 insane: show cleaned build paths in more tests
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>
2024-06-07 23:21:43 +01:00
Konrad Weihmann
3bb4c6bd18 insane: error out on UNPACKDIR = WORKDIR
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>
2024-06-04 12:04:52 +01:00
Richard Purdie
b4e430a42e autotools/libtool: Drop libtool sysroot patch as not needed
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>
2024-06-04 12:04:52 +01:00
Emil Kronborg
93b8b92ba6 insane.bbclass: remove leftover variables and comment
The code that used these variable and the comment was introduced in
commit b44d32ef41 ("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>
2024-06-03 07:47:04 +01:00
Emil Kronborg
920537c840 insane.bbclass: fix HOST_ variable names
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>
2024-06-03 07:47:04 +01:00
Emil Kronborg
20c3889573 insane.bbclass: remove skipping of cross-compiled packages
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>
2024-06-03 07:47:04 +01:00
Richard Purdie
bde5c8d7bc base/insane: Move S/B checks to more logical place in insane class
(From OE-Core rev: f8f3315d58f9ec7824961d1f6f96d39c449b9578)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-23 11:26:39 +01:00
Richard Purdie
5ef61d10d3 insane: Add error for B = WORKDIR
This was never a good idea and would have mostly happened from S = WORKDIR
however explictly disallow it and error if anyone tries.

(From OE-Core rev: e3c2c1fac904bb518d85e10a2ac0177c81cbf7e8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-23 11:26:39 +01:00
Richard Purdie
c174208db9 insane: Error for S == WORKDIR
Where a recipe uses WORKDIR as S, exit with a fatal error since the
code is no longer safe for this layout.

(From OE-Core rev: 32cba1cc916ad530c5e6630a927e74ca6f06289b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-22 22:26:30 +01:00
Richard Purdie
521a3f727c insane: Fix case where S doesn't exist
If S doesn't exist, do_qa_patch would fail. Fix the code to not fail
in this situation.

(From OE-Core rev: 4041d91b63ff2315657499e22c74ec90adbf9e19)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-13 16:28:35 +01:00
Ross Burton
3c3b0f7be4 insane: handle dangling symlinks in the libdir QA check
The "libdir" QA check tries to open every file it finds as an ELF.  If
it finds a dangling symlink that looks like a library by the filename it
will try to open it and fail with FileNotFoundError error.  As this
dangling symlink probably points to a real file, silently absorb the
error.

[ YOCTO #13949 ]

(From OE-Core rev: f044290f98ea66f2cecfbffd7d392dbc3d986da9)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-02 15:11:06 +01:00
Peter Kjellerstedt
1648d0e8f7 insane.bbclass: Allow the warning about virtual/ to be disabled
Commit f673d3d239799fb1ab50f4aa5d44187666aa0cd7 introduced a warning for
virtual/ being used in RPROVIDES and RDEPENDS. Make it possible to
disable the warning by removing "virtual-slash from WARN_QA.

(From OE-Core rev: 968ffdb9fee5017eecce36ce878ea604c869ce95)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-20 11:39:45 +00:00
Richard Purdie
9b5b628799 insane: Clarify runtime/ warning
We should be pointing people at VIRTUAL-RUNTIME, not virtual so tweak
the warning. Try and make it clear the difference between the build
dependencies and the runtime ones.

(From OE-Core rev: 01d815aa2c0bea113fb79b51bf67c0ff90d57dd2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-13 13:51:41 +00:00
Simone Weiß
6e00774a79 classes-global/insane: Add check for "virtual/" in RPROVIDES and RDEPENDS
Fixes [YOCTO #14538]

Recipes shouldn't use "virtual/" in RPROVIDES and RDEPENDS. This was
addressed already in recipes in meta-oe and oe-core. Add a test for
this in insane.bbclass to ensure no regressions occur.

(From OE-Core rev: f673d3d239799fb1ab50f4aa5d44187666aa0cd7)

Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-19 00:16:42 +00:00
Ola x Nilsson
fc2d534e38 insane.bbclass: Python code cleanup in check_32bit_symbols
(From OE-Core rev: 67b06035326048323f972107f66eb50cf74def0b)

Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-15 21:42:15 +00:00
Ola x Nilsson
ad3eb83b56 insane.bbclass: Check for adjtime in check_32_bit_symbols
adjtime was overlooked in the original commit.

(From OE-Core rev: 07faecd87e77716cfedffeadc52e0982edfd6c7e)

Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-15 21:42:15 +00:00
Joshua Watt
cd125f1703 classes-global/insane: Look up all runtime providers for file-rdeps
Uses the new foreach_runtime_provider_pkgdata() API to look up all
possible runtime providers of a given dependency when resolving
file-rdeps. This allows the check to correctly handle RPROVIDES for
non-virtual dependencies

(From OE-Core rev: 018fa1b7cb5e6a362ebb45b93e52b0909a782ac9)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-24 10:39:07 +00:00
Ross Burton
0b4a4952e1 insane: ensure more paths have the workdir removed
When showing paths to the user we don't want to include the whole build
directory.  Passing the package name to package_qa_clean_path strips
this completely.

(From OE-Core rev: 7f1a862d2a432f216e37bf63648bef787422a43d)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Richard Purdie
d90fb73db5 insane: Move unpack tests to do_recipe_qa
The SRC_URI tests are a better fit for the new do_recipe_qa task, move them
there.

(From OE-Core rev: 5afde8e24e74c7b73c1da312cca65b3277a6c355)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-08 10:56:35 +00:00
Jörg Sommer
90ac8a0c66 package_qa_check_rdepends: Allow /usr/bin/sh if usrmerge
If the distro feature usrmerge is set, all files from /bin are moved to
/usr/bin, i.e. /usr/bin/sh is the same as /bin/sh and should be allowed be
ignored, because it's always present.

(From OE-Core rev: 330dc61053afae8a1812bda6f9e01e2f09d1f08f)

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-23 10:49:19 +01:00