summaryrefslogtreecommitdiffstats
path: root/meta/classes-global/insane.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* base/insane: Move S/B checks to more logical place in insane classRichard Purdie4 days1-0/+4
| | | | | | (From OE-Core rev: f8f3315d58f9ec7824961d1f6f96d39c449b9578) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Add error for B = WORKDIRRichard Purdie4 days1-0/+3
| | | | | | | | | 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>
* insane: Error for S == WORKDIRRichard Purdie5 days1-0/+5
| | | | | | | | | 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>
* insane: Fix case where S doesn't existRichard Purdie2024-05-131-1/+1
| | | | | | | | | 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>
* insane: handle dangling symlinks in the libdir QA checkRoss Burton2024-05-021-2/+2
| | | | | | | | | | | | | | | 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>
* insane.bbclass: Allow the warning about virtual/ to be disabledPeter Kjellerstedt2024-02-201-6/+7
| | | | | | | | | | | 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>
* insane: Clarify runtime/ warningRichard Purdie2024-02-131-1/+1
| | | | | | | | | | 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>
* classes-global/insane: Add check for "virtual/" in RPROVIDES and RDEPENDSSimone Weiß2024-01-191-0/+6
| | | | | | | | | | | | | 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>
* insane.bbclass: Python code cleanup in check_32bit_symbolsOla x Nilsson2024-01-151-3/+3
| | | | | | | | (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>
* insane.bbclass: Check for adjtime in check_32_bit_symbolsOla x Nilsson2024-01-151-0/+1
| | | | | | | | | | 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>
* classes-global/insane: Look up all runtime providers for file-rdepsJoshua Watt2023-12-241-18/+12
| | | | | | | | | | | | 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>
* insane: ensure more paths have the workdir removedRoss Burton2023-12-091-10/+10
| | | | | | | | | | | 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>
* insane: Move unpack tests to do_recipe_qaRichard Purdie2023-11-081-24/+22
| | | | | | | | | 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>
* package_qa_check_rdepends: Allow /usr/bin/sh if usrmergeJörg Sommer2023-10-231-0/+4
| | | | | | | | | | | | 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>
* insane: unimplemented-ptest: ignore source file errorsYoann Congal2023-10-171-10/+16
| | | | | | | | | | | | | | | In some cases, pathlib.Path.glob() might throw FileNotFoundError when file/directory disappear while it is iterating over them. This "warning" is not important enough to crash build in this case so just take a bb.note of the problem and move on. (From OE-Core rev: 85ddbb67f0f6f823cac0966db78e5b74c5a54c4c) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Reported-by: Mark Hatle <mark.hatle@amd.com> Closes: https://lists.openembedded.org/g/openembedded-core/message/189254 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: skip unimplemented-ptest on S=WORKDIR recipesYoann Congal2023-10-171-0/+2
| | | | | | | | | | | | On S=WORKDIR recipes, the unimplemented-ptest check will scan the whole WORKDIR and "see" disappearing file and directory. (From OE-Core rev: 9a2d2f7c2b7236667a6d80355f73db4c27e6582e) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Reported-by: Mark Hatle <mark.hatle@amd.com> Closes: https://lists.openembedded.org/g/openembedded-core/message/189254 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Add a naive heuristic to detect test subdirectoriesJérémy Rosen2023-10-151-0/+4
| | | | | | | | | | | | | | | | | if there is a "test" or "tests" subdirectory at toplevel, this usually means we have some unit tests available. This test is very good at detecting handcrafted tests and I was not able to find any false positive. False positive can be dealt with the usual INSANE_SKIP mechanism (From OE-Core rev: 0c91ad29f7ea313bc25481be9d40f216c0770b98) Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr> Reviewed-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Detect build-system test harnessesJérémy Rosen2023-10-151-0/+12
| | | | | | | | | | | | | | | | | | | most build-systems have a way to implement a "make check" or equivalent command that will run tests in the source directory. This heuristic will detect the keywords in the build-system configuration that activates tests. Note that in the case of autotools, we use Makefile.in as our source instead of Makefile.am to easily follow includes. Filenaming conventions for autotools files are not reliable enough to do naive matching. (From OE-Core rev: bc9013295256443e877f29b7e00605ffa5177efa) Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr> Reviewed-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Detect python and perl based testsJérémy Rosen2023-10-151-0/+22
| | | | | | | | | | | | | | | | | | | | match_line_in_files will look for a regex in all files matching a glob. we use iglob to avoid a complete, recursive scan of all source. iglob is based on python iterators and will scan as we walk through the directories pytest are detected by looking for "import pytest" or "from pytest" in any python file. perl Test:: is detetected by looking for any t/*.t in the toplevel source directory. (From OE-Core rev: 00d64ac38ae4af6193fae3b02375a16b1821f29e) Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr> Reviewed-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Add unimplemented-ptest infrastructureJérémy Rosen2023-10-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | This infrastructure will use heuristics to detect when package sources seem to have unit tests implemented but no ptest have been implemented in the recipe. No heuristics have been implemented at this point, only the infrastructure to skip the test when ptest are implemented. This is part of python_do_qa_patch since we need the sources in their final state but do not need any configuration done A missing-ptest QA test already existed but it was used for a different purpose and overridden by ptest.bbclass. Thus, a new QA keyword was added Note: The QA test is not enabled by default and may be enabled to hunt down potential ptests with: WARN_QA += "unimplemented-ptest" (From OE-Core rev: 282ae38543e22cbdcbf69c64eace551997927ce3) Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr> Reviewed-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane.bbclass: Count raw bytes in shebang-sizeJan Garcia2023-09-221-2/+1
| | | | | | | | | | 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>
* insane.bbclass: Remove an unused variablePeter Kjellerstedt2023-08-241-1/+0
| | | | | | | | | | | 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>
* insane.bbclass: add a RECIPE_MAINTAINER check (oe-core recipes only)Alexander Kanavin2023-07-301-1/+10
| | | | | | | | | | | | | | 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>
* insane.bbclass: add a SUMMARY/HOMEPAGE check (oe-core recipes only)Alexander Kanavin2023-07-301-0/+16
| | | | | | | | | | | | | | | | | 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>
* insane.bbclass: add do_recipe_qa taskAlexander Kanavin2023-07-301-0/+14
| | | | | | | | | | | | | | | | | 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>
* insane.bbclass: enable 32 bit time API check (as a warning) on affected ↵Alexander Kanavin2023-06-271-0/+6
| | | | | | | | | | 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>
* insane: Improve patch-status layer filteringRichard Purdie2023-06-201-13/+3
| | | | | | | | | | 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>
* insane.bbclass: simplify exceptions for 32 bit time API checkAlexander Kanavin2023-05-051-11/+3
| | | | | | | | | | | | | | | | 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>
* insane.bbclass: move Upstream-Status logic to oe.qaMartin Jansa2023-02-191-16/+3
| | | | | | | | | | * 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>
* insane.bbclass: use 4 spaces for indentationMartin Jansa2023-02-191-25/+25
| | | | | | | | | | * 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>
* insane: Improve patch warning/error handlingRichard Purdie2023-01-211-9/+17
| | | | | | | | | | | | | | | 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>
* insane: Add QA check for 32 bit time and file offset functionsOla x Nilsson2022-12-171-0/+128
| | | | | | | | | | | 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>
* insane: add codeload.github.com to src-uri-bad checkRoss Burton2022-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* insane.bbclass: Allow hashlib version that only accepts on parameterMark Hatle2022-10-251-1/+4
| | | | | | | | | | | | 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>
* insane.bbclass: Skip patches not in oe-core by full pathYang Xu2022-08-301-1/+2
| | | | | | | | | | | 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>
* classes: Update classes to match new bitbake class scope functionalityRichard Purdie2022-08-121-0/+1453
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>