summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
AgeCommit message (Collapse)Author
2020-02-07package.bbclass: Support stripping and debug copy of static librariesmgh/pkg-stripMark Hatle
By default, we won't copy and strip static libraries. However, this functionality can be useful in some cases where people are doing development on the target, and don't generally want the larger debug capable static libraries. To enable the new functionality set: PACKAGE_DEBUG_STATIC_SPLIT = '1' Add a new function splitstaticdebuginfo. Thus function will copy the unmodified static library into the specific debug directory location. By keeping an unmodified version, it is possible for a user trying to debug something to use -L /usr/lib/.debug-static and their existing build commands to switch from stripped to full debug versions. The PACKAGE_DEBUG_SPLIT_STYLE will select between two different approaches, /usr/lib/debug-static or <path>/.debug-static. Additionally you can now choose to strip static libraries to conserve space. If either 'PACKAGE_DEBUG_STATIC_SPLIT' or 'PACKAGE_STRIP_STATIC' is set to 1, the static library will be stripped. (This is not on by default, as it could make diagnosing static library usage difficult in some cases.) Add to insane.bbclass a skip to the staticdev warning for the specific -dbg package versions. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
2020-01-19insane.bbclass: Spawn warning for missing mime-xdg in inheritAndreas Müller
If a package signals that it can open mime-types but does not inharit mime-xdg, a warning is created. Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19insane.bbclass: introduce a warning for mime missing in inheritAndreas Müller
* looking through layers it looks that usage of mime.bbclass is somewhat orphaned * now that update-mime-database is called once only at image creation time, costs of mime.bbclass are limited Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19mips: Enable gnu-hash-style on glibcKhem Raj
latest glibc 2.31 [1] and binutils [2] has finally added the needed support for gnu hash-style, which brings mips into same fold as other architectures Fix check for MIPS specific section for gnu hash information [1] https://sourceware.org/ml/libc-alpha/2019-06/msg00456.html [2] https://sourceware.org/ml/binutils/2019-07/msg00098.html Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-12-28insane: don't use cachedpathRoss Burton
Unless cachedpath is used correctly then it's just a glorified clone of os.walk, but without any of the recent optimisations in os.walk. In this codepath there is no point to using cachedpath. Signed-off-by: Ross Burton <ross.burton@intel.com>
2019-11-29insane: fix GitHub /archive/ testRoss Burton
This test was failing to split the URL list to individual URLs, so if SRC_URI is something like this then the test incorrectly triggers: SRC_URI = "git://github.com/foo http://example.com/archive/foo" Fix this by splitting the SRC_URI list and iterating through the URIs one at time. [ YOCTO #13660 ] Signed-off-by: Ross Burton <ross.burton@intel.com>
2019-11-14insane: improve textrel warning messageRoss Burton
Clean the displayed path so it clearly shows the package name and path in that package. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-08insane: add check for perllocal.podRoss Burton
perlocal.pod is an index file of locally installed modules and so shouldn't be installed by any distribution packages. cpan.bbclass already sets NO_PERLOCAL to stop this file being generated by most Perl recipes, but if a recipe is using MakeMaker directly (such as rrdtool) then they might not be doing this correctly. To avoid multiple packages shipping this file and then failing to install together, add a QA test to check if this file exists and by default emit an error if it does. [ YOCTO #13491 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-14insane.bbclass: in file-rdeps do not look into RDEPENDS recursivelyAlexander Kanavin
Recursive RDEPENDS resolution requires that all of the dependent recipes' packaging has completed. There is no mechanism to ensure that and therefore races were observed. This change effectively requires recipes to list their runtime file dependencies explicitly rather than have them pulled indirectly. This may require a bit of fixing in layers, but should result in a better definition of runtime file dependencies. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-03insane: check if the recipe incorrectly uses DEPENDS_${PN}Ross Burton
Some people mistakenly use DEPENDS_${PN} and wonder why the dependencies don't work. Check for this and tell the user to use DEPENDS. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-05insane: use clean_path for the host contamination warningsRoss Burton
We've a nice function to clean up absolute build paths for display, so use it. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-18insane: remove empty test that does nothingRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-18insane: improve buildpath warning messagesRoss Burton
Instead of reporting large chunks of the work directory and not the package name: "File /work/corei7-64-poky-linux/libidn2/2.2.0-r0/packages-split/libidn2-dev/usr/lib/pkgconfig/libidn2.pc in package contained reference to tmpdir" We can clean up the paths and be more useful: "File /usr/lib/pkgconfig/libidn2.pc in package libidn2-dev contains reference to TMPDIR" Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-21insane: add sanity checks to SRC_URIRoss Burton
The SRC_URI almost definitely shouldn't be using ${PN}, and GitHub */archive/* tarballs are dynamically generated so the checksums will change over time. Detect both of these, and emit a QA warning if found. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-11insane.bbclass: Trigger unrecognzed configure option for mesonAndreas Müller
Tested with 'unknown-configure-option' in ERROR_QA: For meson (glib-2.0-native): 1. add 'EXTRA_OEMESON_append = "-Dschnitzel=true -Dwurst=true"' | ERROR: glib-2.0-native-1_2.58.3-r0 do_configure: QA Issue: glib-2.0-native: configure was passed unrecognised options: schnitzel wurst [unknown-configure-option] 2. add 'UNKNOWN_CONFIGURE_WHITELIST_append=" schnitzel"' | ERROR: glib-2.0-native-1_2.58.3-r0 do_configure: QA Issue: glib-2.0-native: configure was passed unrecognised options: wurst [unknown-configure-option] 3. change to 'UNKNOWN_CONFIGURE_WHITELIST_append=" schnitzel wurst"' => builds without issues For autotools (readline-native): 1. add 'EXTRA_OECONF = "--with-schnitzel --with-wurst"' | ERROR: readline-native-8.0-r0 do_configure: QA Issue: readline-native: configure was passed unrecognised options: --with-wurst --with-schnitzel [unknown-configure-option] 2. add 'UNKNOWN_CONFIGURE_WHITELIST_append=" --with-schnitzel"' | ERROR: readline-native-8.0-r0 do_configure: QA Issue: readline-native: configure was passed unrecognised options: --with-wurst [unknown-configure-option] 3. add 'UNKNOWN_CONFIGURE_WHITELIST_append=" --with-schnitzel --with-wurst"' => builds without issues Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-10insane: fix gettext dependency warningRoss Burton
This message was using %s markers but nothing was being passed in. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-09patch/insane: Rework patch fuzz handlingAndreas Müller
Currently there are three issues which can be enhanced: 1. Fuzz warnings cannot be configured as errors for hardening. It happened often to me that these warnings were overseen and detected after commits were already out. 2. The output is too verbose - particularly when more than one file is affected. Meanwhile all users should know why patch fuzz check is performed. So move links with background information to insane.bbclass. 3. Reduce copy & paste effort slightly by printing PN (nit: <recipe> was not a correct suggestion e.g for native extended recipe - see example below) To achieve patch.py drops patch-fuzz info encapsulated by a header- and footer- string into log.do_patch. With this insane.bbclass can drop warnings/errors depending on 'patch-fuzz' in ERROR_QA or WARN_QA. Default remains unchanged: Spit out warnings only. A message for two fuzzed patches and 'pact-fuzz' in ERROR_QA now looks like: | ERROR: autoconf-native-2.69-r11 do_patch: Fuzz detected: | | Applying patch autoreconf-exclude.patch | patching file bin/autoreconf.in | Hunk #1 succeeded at 73 with fuzz 1 (offset -3 lines). | Hunk #2 succeeded at 143 (offset 6 lines). | Hunk #3 succeeded at 167 (offset 6 lines). | Hunk #4 succeeded at 177 (offset 6 lines). | Hunk #5 succeeded at 281 (offset 15 lines). | Hunk #6 succeeded at 399 (offset 15 lines). | Hunk #7 succeeded at 571 (offset 20 lines). | Hunk #8 succeeded at 612 (offset 20 lines). | Hunk #9 succeeded at 636 (offset 20 lines). | Hunk #10 succeeded at 656 (offset 20 lines). | Hunk #11 succeeded at 683 (offset 20 lines). | | Applying patch autoreconf-gnuconfigize.patch | patching file bin/autoreconf.in | Hunk #1 succeeded at 55 with fuzz 1 (offset -3 lines). | Hunk #3 succeeded at 663 (offset 18 lines). | | The context lines in the patches can be updated with devtool: | | devtool modify autoconf-native | devtool finish --force-patch-refresh autoconf-native <layer_path> | | Don't forget to review changes done by devtool! | | ERROR: autoconf-native-2.69-r11 do_patch: QA Issue: Patch log indicates that patches do not apply cleanly. [patch-fuzz] Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-24insane: improve license checksumming logicRoss Burton
Instead of opening files as bytes and battling decoding to UTF-8 which can throw exceptions, open directly as strings and replace invalid codepoints. This handles licenses in encodings which are not UTF-8 but are based on ASCII much better. Also instead of extracting the license lines, writing them to a file, and then hashing the file, hash the lines directly. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-07insane.bbclass: Add configure-unsafe and configure-gettextRobert Yang
So that the errors can be controlled by ERROR_QA or WARN_QA, and make them work with INSANE_SKIP. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-07insane.bbclass: Make INSANE_SKIP work for qa pkgconfig and laRobert Yang
The INSANE_SKIP = "pkgconfig" or "la" didn't work, this patch fixes the problem. [YOCTO #13087] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-14insane.bbclass: add package specific skips to sstate hashMichael Ho
The bbclass currently adds INSANE_SKIP to the sstate hash dependencies however the package specific skips such as INSANE_SKIP_${PN} are not added automatically because of how the class references them. This causes the problem that modifying INSANE_SKIP_${PN} does not invalidate the sstate cache and can mask build breaking warnings. Add an anonymous python snippet to explicitly include these additional relevant skips to the sstate hash. Singed-off-by: Michael Ho <Michael.Ho@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-13insane.bbclass: BPF objects may mismatch in endianness and bitness tooKhem Raj
This ensures that bitness and endianness is ignored for BPF objects Fixes QA issues like Bit size did not match (32 to 64) kernel-selftest on /work/qemumips-yoe-linux/kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/bpf/test_btf_nokv.o Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08classes: Correctly markup regex stringsRichard Purdie
There are various escape characters in these stings which python warns about so use the correct regex markup for them. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05insane: Clarify GNU_HASH warningRoss Burton
We have a fatal error if ELF objects don't have GNU_HASH segments but it doesn't explain what the problem is. At least give a hint to users by suggesting that LDFLAGS wasn't passed to the compiler. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-13insane: Recognise BPF as a valid EM_MACHINE typeKhem Raj
BPF Linux ELF objects are generated with kernel-selftests with >= 4.18 kernel and when clang is enabled which packages BPF objects into packages, therefore recongnise this as a valid ELF target Add a selftest for BPF Do not flag BPF objects in target, since they pretty much will be ok for most of kernels architectures we care do support BPF Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-26lib/oe: split out machine to ELF data dictionaryRoss Burton
2018-07-18insane: optimise buildpath searchRoss Burton
Instead of decoding every file we open as UTF-8 (with many errors as machine code isn't UTF-8), convert the build path to the UTF-8 byte representation and search for that instead. Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-06-28insane.bbclass: Don't let warnings make previous errors non-fatalOlof Johansson
package_qa_handle_error() returns True on non-fatal issues and False on fatal issues. But the current usage has been to do sane = package_qa_handle_error(...) which would always reset sanity status to be that of the last issue identified. This change the assignments to use the &= operator instead: sane &= package_qa_handle_error(...) As far as I can tell, this is not a real problem in practice, because warnings of different levels (WARN_QA, ERROR_QA) does not seem to have been mixed in a way that triggered this issue. Signed-off-by: Olof Johansson <olofjn@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-28insane.bbclass: Make missing license file fatalOlof Johansson
If a license file referenced from LIC_FILES_CHKSUM doesn't exist, insane.bbclass would output an error message, but would continue the build. This change makes this error fatal (as I suspect has been the intention). Signed-off-by: Olof Johansson <olofjn@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-15insane.bbclass: Adds powerpc to elf headers machine dictionaryAlejandro Enedino Hernandez Samaniego
This patch adds makes it possible to build elf for powerpc by adding this combination to the elf headers machine dictionary, this can be useful when trying to build baremetal applications where the TARGET_OS=elf Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
2018-03-15insane.bbclass: Fix typos in 32bit risc-v machine typeKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-03-15insane.bbclass: add support for RISC-V baremetalKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-03insane: add support for ARM64 ILP32Daniel Díaz
Add aarch64 32-bits (ILP32) ELF header into dictionary and check binaries for 32-bitness. Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-21insane.bbclass: add microblaze-*-elf to machine dictionaryNathan Rossi
Add the definitions for microblaze-*-elf targets to the machine dictionary. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-05insane: Add entries for riscv 32bit/64bitKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-13insane: consider INSANE_SKIP without package-specifier tooRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-13insane: don't pass skip list to functions which don't respect itRoss Burton
When these functions are being called INSANE_SKIP has already been taken into account, so don't confuse the code by passing the skip list. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11insane.bbclass: write QA issues to log file only when they are in ERROR_QA ↵Martin Jansa
or WARN_QA * QA check which aren't included in WARN_QA and ERROR_QA are shown during the build only as NOTE message (not shown at all with default knotty setting), so it might be surprising to see them later in qa.log file Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-01insane.bbclass: Warn if ${COREBASE}/LICENSE is usedSaul Wold
The top level LICENSE file is not actually a license, it refers other licenses that are used by Bitbake and Meta-data. Relying on this file could cause problems for recipes when this file changes, which it is about to. (From OE-Core rev: a1948ab38c9cb7f0b16cce9dadc03ae6e2fe44ad) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-29gettext.bbclass: do not add virtual/gettext to DEPENDSAlexander Kanavin
gettext has a notoriously slow configuration step, and so in my testing this greatly speeds up building core-image-minimal: from 21m36s to 19m2s (empty sstate and tmp, but pre-populated downloads). I have also built world, and core-image-sato to make sure it doesn't break or modify the build, and there is no difference whatsoever in packages and images content. Target gettext seems not to be used for anything. Also fix up insane.bbclass to remove the corresponding QA check. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-29insane: add qa check for uppercase recipe nameYeoh Ee Peng
Since we disabled uppercase characters in overrides a few releases ago, uppercase characters in recipe names (and for that matter, distro and machine names) cannot be supported due to their reliance upon overrides including the name. QA check will produce an warning message when it verify that recipe name is uppercase. [YOCTO# 11592] Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-11insane: remove last remnants of unsafe-references-in-binaries checkRoss Burton
The test itself was removed but there were a few explicit checks and dependencies for it, so remove those too. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-08-11insane: remove unsafe-references-in-scripts checkRoss Burton
We've already removed unsafe-references-in-binaries (which was fundamentally broken) and nobody really cares about / and /usr being on different filesystems anymore (at least if they, they're keeping very quiet and not fixing the bugs). As this test was a minor detail in the scope of supporting separate / and /usr which we don't support, it can be removed. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-08insane.bbclass: Support musl-x32sweeaun
Added musl-x32 elf header into dictionary. Signed-off-by: sweeaun <swee.aun.khor@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-06insane.bbclass: Add package QA check for merged /usr.Amarnath Valluri
This check makes sure that, when usrmerge distro feature enabled, no package installs files to root (/bin, /sbin, /lib, /lib64) folders. Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-28insane: add extensible framework for recipe-wide QA testsRoss Burton
Following QAPATHTEST (QA hook for each file in each package) and QAPKGTEST (QA hook for each package), add QARECIPETEST: a hook which is executed once per recipe in do_package_qa. This makes it trivial to add recipe-wide QA tests that integrate with the existing tests. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-28insane: rename pkg to pn because that is what it isRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-23insane.bbclass: Ignore perl as dependency for nativesdk packagesPeter Kjellerstedt
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-16meta: Remove further uclibc remnants (inc. patches and site files)Richard Purdie
Some of these are clearly dead, e.g. one binutils patch reverts the effects of the earlier one. This also removes the uclibc site files. We now have mechanisms to allow these to be extended from another layer should someone ever wish to do that. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14insane: Don't depend on OVERRIDESRichard Purdie
In common with the other package handling functions, don't depend on the value of OVERRIDES. This means when we change MACHINE, we don't have to repackage everything. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>