Commit Graph

16 Commits

Author SHA1 Message Date
Jan Garcia
c94c1ba7c7 insane.bbclass: Count raw bytes in shebang-size
Operating systems limit the shebang to a maximum number of bytes.
This patch makes the shebang-size check count raw bytes instead of UTF-8 characters.

(From OE-Core rev: d4ac66c5cdaf971fb717cc5c5bf9aa51a787d412)

Signed-off-by: Jan Garcia <j@n-garcia.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-22 07:45:17 +01:00
Peter Kjellerstedt
d0ddefc7b7 insane.bbclass: Remove an unused variable
The use of coremeta_path was removed with commit 61a881fdbe (insane:
Improve patch-status layer filtering) when the patch-status QA test was
generalized.

(From OE-Core rev: 71a2c7b2608640dfa45d065692541d537149052e)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-24 16:50:24 +01:00
Alexander Kanavin
f6bd6b72f8 insane.bbclass: add a RECIPE_MAINTAINER check (oe-core recipes only)
Absent maintainer entries are as well a frequent source of friction, as they are checked
only in selftest, and so aren't revealed until autobuilder runs.

The selftest is retained as it also checks for obsolete entries in maintainers.inc
(not possible to do in insane class).

(From OE-Core rev: 675dff0e37666c1cffa10a83f6f1f67d5fadd204)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-07-30 09:16:52 +01:00
Alexander Kanavin
ba961128e2 insane.bbclass: add a SUMMARY/HOMEPAGE check (oe-core recipes only)
This was done in a selftest, but that is too late and creates
friction in integration as errors are not seen until autobuilder fails.

Bonus fix: SUMMARY check wasn't even working, as in the absence
of one set in the recipe there is a default value set from bitbake.conf.

I left DESCRIPTION check out for now, as many recipes don't actually
have it, and it's set from SUMMARY (plus a dot) if absent.

(From OE-Core rev: 4144c2f43da39336b03cfd612cbe1694cbf8c7bd)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-07-30 09:16:52 +01:00
Alexander Kanavin
e8c8337989 insane.bbclass: add do_recipe_qa task
There is a need to run QA checks that can operate entirely from
recipe metadata and do not need any of the build artefacts or
source code. After some deliberation it was concluded that such
checks are best collected in their own task that runs as early as possible,
and so this commit adds the task.

Like package_qa, the task is sstate enabled, but doesn't (yet)
register the qa results into sstate.

(From OE-Core rev: e0c71367ab59021fc430ef215bbfc3b525036ba4)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-07-30 09:16:52 +01:00
Alexander Kanavin
327f06e2d7 insane.bbclass: enable 32 bit time API check (as a warning) on affected architectures
(From OE-Core rev: ae9936ab37d34196891570b2f91a299808c95d25)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-27 15:26:31 +01:00
Richard Purdie
6b26715fd7 insane: Improve patch-status layer filtering
Now that we have layer overrides, we can easily enable patch-status in
ERROR_QA without the hardcoded code making it easier for other layers
to opt into the checks.

(From OE-Core rev: 61a881fdbe8b5a21c6276b8a5d06cc30486b1eb3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-20 23:24:26 +01:00
Alexander Kanavin
35e3f3b8d4 insane.bbclass: simplify exceptions for 32 bit time API check
Existing implementation required to list both specific problematic apis, and files that
use them: neither is necessary as both are seen in package_qa error messages, and
can cause excessive amount of exception lines, if there are too many files, or
they are installed in arch-specific locations. Also, the value of INSANE_SKIP
should be the test that needs to be skipped, and in this case it wasn't.

Also, all problematic recipes are now correctly listed.

(From OE-Core rev: e6ebd0c556dfc576a59f5755d97089a2a241f698)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-05 11:07:26 +01:00
Martin Jansa
149ea9db96 insane.bbclass: move Upstream-Status logic to oe.qa
* to be used by standalone script scripts/contrib/patchreview.py
  as well

(From OE-Core rev: c326efeec8f576200728a44c694becdeab4fe2db)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-02-19 07:47:53 +00:00
Martin Jansa
c980c93c5d insane.bbclass: use 4 spaces for indentation
* this block was using just 3

(From OE-Core rev: 4578f2237cb694473eb54ff85af342ee94c9f19d)

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>
2023-02-19 07:47:53 +00:00
Richard Purdie
3c3fd6a65e insane: Improve patch warning/error handling
Currently, whilst patch errors or warnings are shown, the errors don't stop builds.
The configuration isn't very configurable from WARN_QA and ERROR_QA either.

This patch:
 * Uses the standard mechanisms to handle the patch fuzz warnings/errors
 * Makes Upstream-Status checking configurable from WARN/ERROR_QA
 * Allows that checking to be used with non-core layers
 * Makes patch-fuzz an error by default

(From OE-Core rev: 76a685bfcf927593eac67157762a53259089ea8a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-21 07:46:38 +00:00
Ola x Nilsson
c7b64446cb insane: Add QA check for 32 bit time and file offset functions
Check for known symbols that should have been redirected to 64bit
variants when -D_FILE_OFFSET_BITS=64 and -D_TIME_BITS=64 are set.

(From OE-Core rev: 8e2af04f24443fad2040bb32e6033d49e3120517)

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>
2022-12-17 11:10:04 +00:00
Ross Burton
2a9bfc7dc8 insane: add codeload.github.com to src-uri-bad check
GitHub redirects /archive/ URLs to codeload.github.com, a dedicated
service for caching git archives:

$ wget -v https://github.com/unicode-org/icu/archive/refs/tags/release-72-1.zip
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/unicode-org/icu/zip/refs/tags/release-72-1 [following]

This is not the case for uploaded artifacts:

$ wget -v https://github.com/unicode-org/icu/releases/download/release-72-1/icu4c-72_1-data-bin-l.zip.asc
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/49244766/... [following]

Check for codeload.github.com URLs in the src-uri-bad check in case
the SRC_URI contains this final URL, and not the public URI.

(From OE-Core rev: a3b4575259fa304c596ed227ed60769b5f72f0a8)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-07 14:32:42 +00:00
Mark Hatle
5f60768030 insane.bbclass: Allow hashlib version that only accepts on parameter
Some versions of hashlib don't appear to implement the second FIPS
related argument.  Detect this and support both versions.

(From OE-Core rev: 2bbabed51e3aca138486d3feef640f5d3249be40)

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-25 13:42:03 +01:00
Yang Xu
b915b5c282 insane.bbclass: Skip patches not in oe-core by full path
The full path of patch may contain '/meta/' but not in oe-core, skip
patches by checking it starts with oe-core full path or not.

(From OE-Core rev: d8a525afdfb5d371e76b09301c8b2741d23d1d10)

Signed-off-by: Yang Xu <yang.xu@mediatek.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-30 10:33:35 +01:00
Richard Purdie
fd1517e2b5 classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take
advantage of new bitbake functionality to check class scope/usage.

(From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045)

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