summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
AgeCommit message (Collapse)Author
2022-08-12classes: Update classes to match new bitbake class scope functionalityRichard Purdie
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12insane: Update to allow for class layout changesRichard Purdie
Make the code more generic to allow for the potential incomming class layout changes. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12classes: Add SPDX license identifiersRichard Purdie
As stated in our top level license files, the license is MIT unless otherwise stated. Add SPDX identifers accordingly. Replace older license statementa with the standardised syntax. Also drop "All Rights Reserved" expression as it isn't used now, doesn't mean anything and is confusing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12classes: Add copyright statements to files without oneRichard Purdie
Where there isn't a copyright statement, add one to make it explicit. Also drop editor config lines where they were present. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-04classes/sanity: Add comment about github & gitlab archivesJoshua Watt
Add a comment so that users grepping for "github" or "gitlab" will find this code (since the regex wont). Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-15insane: Drop debug exclusion from buildpaths testRichard Purdie
Once, we didn't have reproducible debug info and weren't sure how we'd get it. This is long since fixed so we can drop this exclusion as obsolete. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-15insane: Reword staging to refer to populate_sysrootRichard Purdie
'staging' is a term lost in time. This code now operates on the sysroots, adjust the naming and messages to be more correct/appropriate. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-15insane: Add buildpaths to WARN_QA by defaultRichard Purdie
This was never enabled originally as there were a ton of warnings and we weren't able to fix them. Now we have reproducibile builds, this can be enabled by default as there shouldn't be such paths any longer. This is known to work well for OE-Core, other layers may have variable quaility but enabling it will start to hint to other layers and maintainers that these issues need fixing. It also will give developers early warning of reproducibility issues, rather than us catching them on the YP autobuilder. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-04insane: Fix buildpaths test to work with special devicesRichard Purdie
If enabled, the buildpaths test hangs in psplash as it tries to open a fifo and read from it, hanging indefinitely. Tweak the test to ignore fifo/socket/device files. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-01insane.bbclass: Make do_qa_staging check shebangsPaulo Neves
As reported in the bug report [1], there was no check for shebang sizes on native scripts and now this is fixed. The path scope of the qa_staging was increased from just checking libdir to all the relevant SYSROOT_DIRS. It is possible to skip this check through INSANE_SKIP. [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=11053 Signed-off-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-25insane.bbclass: host-user-contaminated: Correct per package home pathAhmed Hossam
The current home path that is compared against is incorrect as it is missing the package name, this patch adds it. [YOCTO #14553] Signed-off-by: Ahmed Hossam <Ahmed.Hossam@opensynergy.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2022-05-28insane.bbclass: make sure to close .patch filesMartin Jansa
* fixes: DEBUG: Executing python function do_qa_patch /OE/build/oe-core/openembedded-core/meta/classes/insane.bbclass:1189: ResourceWarning: unclosed file <_io.TextIOWrapper name='/OE/build/oe-core/openembedded-core/meta/recipes-bsp/keymaps/files/GPLv2.patch' mode='r' encoding='utf-8'> content = open(fullpath, encoding='utf-8', errors='ignore').read() ResourceWarning: Enable tracemalloc to get the object allocation traceback DEBUG: Python function do_qa_patch finished Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-03insane.bbclass: Make changes to QA_EMPTY_DIRS trigger package_qa to rerunPeter Kjellerstedt
If "empty-dirs" is in ERROR_QA, then changes to QA_EMPTY_DIRS should trigger the package_qa tasks to be rerun. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-03insane.bbclass: Make do_qa_patch() depend on if patch-fuzz is in ERROR_QAPeter Kjellerstedt
Adding "patch-fuzz" to ERROR_QA should trigger the patch tasks to rerun to make sure any already existing fuzz is caught. This is achieved by using bb.utils.filter() to see if "patch-fuzz" is in ERROR_QA/WARN_QA as it adds whether the filtered strings are set or not to the task hash. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-09meta/scripts: Improve internal variable namingSaul Wold
Update internal variable names to improve the terms used. Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-04insane: Accomodate llvm-objdumpKhem Raj
llvm-objdump emite MIPS_XHASH where as GNU objdump emits DT_MIPS_XHASH, checking for shorted sequence makes this check work in both cases mips-yoe-linux-objdump -p libx264.so.163 | grep XHASH DT_MIPS_XHASH 0x00000168 mips-yoe-linux-llvm-objdump -p libx264.so.163 | grep XHASH MIPS_XHASH 0x00000168 both are same things Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-02license/insane: Show warning for obsolete license usageRichard Purdie
We want to use SPDX identifiers in LICENSE variables. There is now a conversion script to make most of the translations. Add a list of strings which have been replaced so we can show warnings to users if they're still used anywhere. Add checks to the package as insane check. This is currently a warning by default but can be turned off or made an error as per the other standard checks. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-01insane.bbclass: Update insane.bbclass to work on FIPS enabled hostsMark Hatle
hashlib.md5() is not permitted on a FIPS enabled host system. This is due to md5 not being an approved hash algorithm. Instead use: hashlib.new('MD5', usedforsecurity=False) This is allowed, as it's clear the hash is used for a non-security purpose. Using an md5 to identify when a license has changed is permitted, as we're not using it for file integrity. Signed-off-by: Mark Hatle <mark.hatle@xilinx.com> Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-25insane: use HOST_ variables, not TARGET_ to determine the cross systemAlexander Kanavin
Almost everywhere those are the same, except when making a cross toolchain where HOST_ is where it's going to run, and TARGET_ is what it's going to produce. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-21meta/scripts: Automated conversion of OE renamed variablesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-17features_check/insane: Use hasOverrides datastore methodRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-08insane.bbclass: use multiprocessing for collecting 'objdump -p' outputAlexander Kanavin
This was prompted by ltp's unreasonably long package_qa times; it has a massive amount of executables and insane runs objdump for all of them, serially. This reduces the time from 4 minutes to 1m20s on my machine. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-17insane: move src-uri-bad checks to unpack stageKonrad Weihmann
previously used package_qa_check_src_uri was triggered during package_qa stage, which implies having packages. This isn't the case for native-only recipes or recipe that inherit nopackages. Still the checks performed (src-uri-bad) apply to those as well. Therefore move the check from package_qa stage to unpack stage. Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-17insane: add Inactive-Upstream to Upstream-StatusKonrad Weihmann
as defined by latest addition to the commit message guideline Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-01insane.bbclass: add a check that Upstream-Status patch tag is present and ↵Alexander Kanavin
correctly formed Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-13insane: remove unrecognised option check for MesonRoss Burton
Meson 0.60 onwards no longer simply warns when an unrecognised option is passed, it errors out instead. This means we can remove the logic in insane.bbclass to check for the warnings. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03insane.bbclass: Add a check for directories that are expected to be emptyPeter Kjellerstedt
The empty-dirs QA check verifies that all directories specified in QA_EMPTY_DIRS are empty. It is possible to specify why a directory is expected to be empty by defining QA_EMPTY_DIRS_RECOMMENDATION:<path>, which will then be included in the error message if the directory is not empty. If it is not specified for a directory, then "but it is expected to be empty" will be used. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-17insane,license,license_image: Allow treating license problems as errorsMike Crowe
Use the same WARN_WA and ERROR_QA variables as insane.bbclass to allow individual recipes, the distro or other configuration to determine whether the various detected license errors should be treated as a warning (as now) or as an error. oe.qa.handle_error isn't immediately fatal, so oe.qa.exit_if_errors must be called at the end of do_populate_lic to fail the task. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-17lib/oe/qa,insane: Move extra error handling functions to libraryMike Crowe
Extract package_qa_write_error, package_qa_handle_error and package_qa_add_message functions from insane.bbclass to lib/oe/qa.py and drop the package_qa_ prefixes. Update various bbclasses to use the new functions. No import is required since base.bbclass puts oe.qa in OE_IMPORTS. Stop requiring callers to manually track whether a fatal error has been encountered via a "sane" flag. Instead replace the QA_SANE variable with QA_ERRORS_FOUND and call oe.qa.exit_if_errors or oe.qa.exit_with_message_if_errors at the end of each task. Inspired by discussion resulting from https://lists.openembedded.org/g/openembedded-core/message/156793 and https://lists.openembedded.org/g/openembedded-core/message/156900 Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14base/insane: Import oe.qa by defaultRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-16insane.bbclass: add FILERDEPENDS related check backMingli Yu
Instead of FILERDEPENDS_*, the FILERDEPENDS should be FILERDEPENDS:* such as FILERDEPENDS:/usr/bin/python3.9:lib32-python3-core as an example, so switch to new override syntax to make sure the related check in effect. Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-02ptest: allow the ptest-packagelists.inc warning to be disabledRoss Burton
ptest.bbclass has a sanity check that all recipes in oe-core which inherit ptest are also listed in the ptest-packagelists.inc file, and the build fails if this is not the case. Whilst this is a laudable goal, it is over-zealous as if the recipe has a bbappend in another layer which inherits ptest, the build will fail. By changing the combination of anonymous Python and bb.error() to a recipe-scope QA test, this can be handled with the other sanity checks and bbappends can skip the test if desired. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-17package/scripts: Fix FILES_INFO handlingRichard Purdie
There is a long standing bug where FILES_INFO isn't written into pkgdata with a package suffix. This means if the files are read into the datastore as intended, the last one "wins". Fix this to work as intended. Most of the call sites using the data need to be updated to handle this and the overrides change correctly. Also fix some other problematic references noticed along the way. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-13insane.bbclass: fix new override syntax migrationQuentin Schulz
A few variables and messages were not migrated over to the new override syntax (_ to :). Let's fix that. Signed-off-by: Quentin Schulz <foss@0leil.net> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-04insane.bbclass: fix the file-rdeps QA message for the new override syntaxChen Qi
Instead of replacing '_<pkg>', we should be replacing ':<pkg>'. Otherwise, when we meet a 'file-rdeps' QA error, the error message would be like below. QA Issue: /usr/lib64/libatopology.so.2.0.0:libatopology contained in package libatopology ... The ':libatopology' should not be in the error message. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30meta: Manual override fixesRichard Purdie
The automated conversion of OE-Core to use the new override sytax isn't perfect. This patches some mis-converted lines and some lines which were missed by the automation. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30Convert to new override syntaxRichard Purdie
This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-18insane: clean up some more warning messagesRoss Burton
Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-10insane: don't check for a warning string that is never outputRoss Burton
insane has checks that the compiler isn't printing "CROSS COMPILE Badness" during configure/compile/install, but this message hasn't been output by GCC since 2010 (23f522e7). The current warning is "include location [...] is unsafe for cross- compilation" and as that is a proper GCC warning, we can make it fatal in follow-up patches. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-28insane: native-last: Only print classes inherited after native/nativesdkTomasz Dziendzielski
For usability, only print the classes inherited after native/nativesdk which makes it easier for the user to see where the problem is. Realted to [YOCTO #5729]. Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-28insane: Add missing INSANE_SKIP mechanism for native-last QA checkTomasz Dziendzielski
Ensure that the native-last QA check can be controlled by the INSANE_SKIP variable (realted to [YOCTO #5729]). Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-27insane: Add test for native/nativesdk inherit orderTomasz Dziendzielski
Classes native/nativesdk should be inherited last to prevent unexpected behaviour. [YOCTO #5729] Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-30insane.bbclass: allow fifosTrevor Woerner
Allow recipes to create fifos. If insane.bbclass tries to read() a fifo, the process will hang waiting for something to read(). Therefore, skip any check that would try to read() the object, if the object is a fifo. Signed-off-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-02insane: add GitLab /archive/ testsAndrey Zhizhikin
Archives produced by GitLab should be avoided in the same way as those produced by GitHub. Extend SRC_URI check to include GitLab and inform user that recipe should be converted to use git protocol. Link: https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg73109.html Link: https://lists.openembedded.org/g/openembedded-core/message/144035 Cc: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-15insane: check for missing update-alternatives inheritAndrey Zhizhikin
Add a package QA check to test if the recipe sets ALTERNATIVE variable for any of its packages, and does not inherit update-alternatives class. This causes the do_rootfs to fail since a proper alternative cannot be created. Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-05insane: only load real files as ELFRoss Burton
The file path checks are passed an ELF object if the file is an ELF. It doesn't make a lot of sense to load symlinks to ELFs as if they're in the same package then the real file will be checked too. This should speed up do_package_qa slightly as libraries won't be scanned repeatedly. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-02insane: improve gnu-hash-style warningRoss Burton
Instead of showing a filename under packages-split, show the package name and filename inside the package. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-02insane: fix gnu-hash-style checkSumit Garg
Fix gnu-hash-style check that always returned True after commit [1] leading to false positive presence of "GNU_HASH" in objdump output. Fixes: 9ff90bf04a4c ("mips: Enable gnu-hash-style on glibc") [1] Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-18insane: improve arch test messagesRoss Burton
The messages from the ELF 'arch' test are not obvious, clarify the messages and prune output paths. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-12insane: consolidate skipping of temporary do_package filesRoss Burton
During the course of do_package_rpm and friends the tools create a top-level CONTROL or DEBIAN directory in the package directory. do_package_qa needs to be aware of these files and ignore them, this was previously done in just one check but instead should be done once when building the file list so all the checks don't see the temporary files. [ YOCTO #13804 ] Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>