aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
AgeCommit message (Collapse)Author
2016-03-06insane/prelink: Handle nonstandard library pathsRichard Purdie
Prelink contains some hardcoded assumptions about the path layout of the target system. Unfortunately if the system doesn't match, prelink doesn't work. This breaks: a) prelink of those images b) the unsafe-references-in-binaries QA test (which uses prelink-rtld) One way to work around this is to construct an ld.so.conf file which lists the library paths in question. We do this in sanity QA check and in the rootfs prelink code, being careful not to trample any existing target ld.so.conf. There is an additional problem that $LIB references in RPATHs won't be handled correctly, I've not see any system use these in reality though so this change at least improves things. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-04insane.bbclass: make the checking stricter for unsafe references in scriptsChen Qi
Previously, the checking for unsafe references is not strict enough. It only checks whether '/usr/' is in the script. As a result, any script containing statements like below will match this check. PATH="/bin:/sbin:/usr/bin:/usr/sbin" However, as we can see, this is actually not an unsafe reference. What we really want to check is something like '/usr/bin/tail', so we should make the checking stricter. This patch solves the QA warning in gzip and nfs-utils. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-28lib/oe/qa: add explicit exception for 'file isn't an ELF'Ross Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-18insane.bbclass: print more info for build-deps and file-rdepsRobert Yang
This is useful for oe newbie: * build-deps: print recipe name, and suggest fixing from DEPENDS or PACKAGECONFIG, for example: WARNING: QA Issue: patch rdepends on libattr, but it isn't a build dependency, missing attr in DEPENDS or PACKAGECONFIG? [build-deps] * file-rdeps: print RDEPENDS_pkg rather than RDEPENDS, for example: WARNING: QA Issue: /sbin/osd_login contained in package nfs-utils requires /bin/bash, but no providers found in RDEPENDS_nfs-utils? [file-rdeps] Fix a bug in file-rdeps, there was "@underscore@" in file-rdeps: WARNING: QA Issue: /sbin/osd@underscore@login_nfs-utils contained in [snip] [YOCTO #8922] [YOCTO #8847] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18insane: wrap autotools checks in inherits_class(autotools) checksRoss Burton
There's no point doing the autotools sanity checks if a recipe didn't inherit autotools, so check the inherits before doing the checks. Also pass -F (fixed strings) and -q (quiet) to grep. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-16lib/qa.py: raise ValueError if file isn't an ELFRoss Burton
Instead of raising a generic Exception that can't be handled specifically, raise a ValueError. Also update the callers so any unexpected exceptions are not ignored. Also, rename isBigEngian() to isBigEndian(). Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15insane: Add --disable-static to UNKNOWN_CONFIGURE_WHITELISTRichard Purdie
With the addition of a common class passing in this option, add it to the list of standard "unknown" configure options which are known about. Its not interesting/productive to go and update every recipe to handle this flag. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11insane.bbclass: Support MicroBlaze with muslNathan Rossi
MicroBlaze is supported by musl, add entries for the 3 variants. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-04insane: Fix populate_sysroot sanity test pathRichard Purdie
This was correct for native/cross paths but not for target ones which meant the tests weren't running in some cases. Fix the path to be correct in both cases. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-02insane: add test for -dev packaging containing real librariesRoss Burton
PN-dev packages should generally contain the link-time symlinks from libfoo.so to the real libraries. If a recipe installs a real library named libfoo.so there's a very good chance that it's a loadable module and should be in another package. Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-26insane: remove unused variable assignmentRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-23insane: Drop do_stage testRichard Purdie
do_stage was obsoleted years ago, drop the test now. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22insane.bbclass: fix package_qa_walk()Robert Yang
The parameter "path" would be redefined inside package_qa_walk() which is useless, so remove it. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-22insane.bbclass: print all the QA messagesRobert Yang
Fixed: If more than one files have the same QA issue, it only prints the last one, others are overrided, for example: messages["host-user-contaminated"] = "foo1" messages["host-user-contaminated"] = "foo2" Only foo2 will be printed. Add package_qa_add_message() to hanlde messages, so that all of them will be printed. The package_qa_add_message() is from RP. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-22insane.bbclass:buildpaths: ignore ipkg/dpkg's CONTROL dirRobert Yang
Fixed race issue when: WARN_QA_append = " buildpaths" PACKAGE_CLASSES = "package_ipk" $ bitbake e2fsprogs [snip] *** 0595: with open(path) as f: 0596: file_content = f.read() 0597: if tmpdir in file_content: 0598: messages["buildpaths"] = "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d) 0599: Exception: IOError: [Errno 2] No such file or directory: '/path/to/tmp/work/core2-64-poky-linux/e2fsprogs/1.42.9-r0/packages-split/e2fsprogs-ptest/CONTROL/control' The similar to package_deb. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-19insane: Start to clean up do_configure_qa codeRichard Purdie
This cleans up the do_configure_qa code so that the exit status from package_qa_handle_error is handled correctly. It also converts package_qa_check_license to use our standard QA check configuration interface through package_qa_handle_error rather than a mix of return values, bb.fatal and bb.build.FuncFailed. Due to the merging of multiple lines into one message, we need to tweak a QA test to account for this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19insane: Clean up horrible return value processing codeRichard Purdie
Whilst in theory return values are nice, handling the complex aggregation of the return values is ugly. The code already uses QA_SANE as a marker to signal problems. Whilst that isn't as idealistic, it makes the code massively cleaner, so rely on this instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-13insane/package: Fix cases where QA errors aren't fatalRichard Purdie
When using package_qa_handle_error(), we need to check QA_SANE and give a fatal error if issues were raised. The main insane checks do this, the anonymous python in insane does not, nor does the code in package.bbclass. This was likely missed when the function was introduced to package.bbclass. The impact is that errors can be shown but don't stop the build (do_package succeeds), the initial build fails due to the errors shown but subsequent builds succeed. This is clearly broken. The solution is to check QA_SANE in places we use the handle_error function. [YOCTO #8907] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-12insane: in libdir test allow libraries in libexecdirJuro Bystricky
Some recipes, such as sudo and gcc, put libraries into libexecdir. Allow this in the sanity test so that we don't have to whitelist the libdir check. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-11-24insane.bbclass: Avoid libdir QA check if ↵Jian Liu
PACKAGE_DEBUG_SPLIT_STYLE='debug-file-directory' If PACKAGE_DEBUG_SPLIT_STYLE='debug-file-directory', debuglibdir will be "/usr/lib/debug". Usually 64bit libs should be put under "/usr/lib64". This often cause an warning, so skip the checking. Signed-off-by: Jian Liu <jian.liu@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-11-24insane: Don't depend on BB_TASKDEPDATARichard Purdie
The dependency data in BB_TASKDEPDATA is encoded into the sstate checksum in a much more reliable format. This dependency runs the risk of depending on the string representation of a dict which is a bad idea. Therefore remove the dependency. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-24classes/insane: rename invalid-pkgconfig QA check to invalid-packageconfigPaul Eggleton
We have enough confusing name clashes already, let's not precipitate another one. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-12insane.bbclass: remove misleading path in warningMaxin B. John
cross-compilation warning from insane.bbclass is slightly misleading. So, remove the misleading path from warning. [YOCTO #7540] Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-23insane.bbclass: make package_qa_clean_path return a relative pathRobert Yang
Make package_qa_clean_path() return something like "work/path/to/file" rather than "/work/path/to/file", the relative path is a little clear. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-21insane: Add nios2 supportMarek Vasut
Add support information for the Altera NIOS-II soft processor. Based on previous work by Walter Goossens <waltergoossens@home.nl> at https://github.com/wgoossens/meta-nios2 . Signed-off-by: Marek Vasut <marex@denx.de> Cc: Walter Goossens <waltergoossens@home.nl> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-21insane.bbclass: drop extra line-feed in pkgname checkMartin Jansa
* it was causing QA checck name to be shown on separate line like this: sblim-sfcCommon-1.0.1: sblim-sfcCommon-dev doesn't match the [a-z0-9.+-]+ regex [pkgname] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-21insane.bbclass: show PN and relative path in package_qa_check_host_userMartin Jansa
* show PN as other QA checks * strip PKGDEST prefix from shown path as other QA checks Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-03insane.bbclass: add host-user-contaminated testChristopher Larson
- Add a test which checks for any paths outside of /home which are owned by the user running bitbake. - Add the test to WARN_QA by default. This test has been in meta-mentor for some time, and in our ERROR_QA for our builds, and has caught a number of issues for us. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03insane.bbclass: handle tests which need fakerootChristopher Larson
If any tests listed in FAKEROOT_QA are enabled (listed in ALL_QA), then run do_package_qa under fakeroot. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02insane.bbclass: Check for invalid characters (non UTF8) on recipe metadataLeonardo Sandoval
Check if invalid characters are present on recipe's metadata. Fields taken into account are: 'DESCRIPTION', 'SUMMARY', 'LICENSE' and 'SECTION'. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24classes/insane: fix QA check message referring to nativesdkPaul Eggleton
nativesdk has been a prefix rather than a suffix for some time now. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-01base.bbclass: move invalid PACKAGECONFIG checking to insane.bbclassRobert Yang
There was a problem when check invalid PACKAGECONFIG in the anonymous function (when parsing), for example, there are two versions of a recipe: foo_1.0.bb foo_2.0.bb While foo_2.0.bb has a "PACKAGECONFIG[item] = 'x,y,z'", but foo_1.0.bb doesn't, if we set PACKAGECONFIG_pn-foo = "item" in a conf file, we would get the warning about invalid PACKAGECONFIG for foo_1.0.bb. Delay the checking to build time will fix the problem. [YOCTO #8065] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16do_unpack: move qa check of unpack into insane.bbclassBian Naimeng
Some source archive are not standard format. For example, sometimes, we still need decompress file once again after base_do_unpack, in such case, the following warning will be caught. WARNING: xxx : the directory ${WORKDIR}/xxxx (xxxxxx) pointed to by the S variable doesn't exist \ - please set S within the recipe to point to where the source has been unpacked to So, we should do this QA check after all of unpack jobs been completed. Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-23meta: Add explict getVar param for (non) expansionRichard Purdie
Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23insane.bbclass: fix false negative in build-deps QA checkPatrick Ohly
When a recipe called 'foobar-test' links against 'foobar' without listing that in DEPENDS, the build-deps check misses that error because it looks for 'foobar' in a package string containing (among others) the 'foobar-test' name, leading to the incorrect conclusion that the package is listed as dependency. The 'packages' string needs to be split into individual package names before the check. Doing that once directly after reading the value is more efficient than splitting inside package_qa_check_rdepends() because the caller also needs the individual components. Also use a set to speed up the 'package in packages' check. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-11multilib.bbclass: use package_qa_handle_errorRobert Yang
Use package_qa_handle_error to handle the QA issue. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
2015-06-11insane: errors out on binaries installed by allarch-inherit recipesCristian Iorga
If a prebuilt binary is installed via a recipe that inherits allarch, an odd-looking traceback is thrown out. Fixed by implementing a proper check and outputting an error message that clarifies the issue. Fixes [YOCTO #7662]. Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-05-07insane: Support aarch64 on muslKhem Raj
musl 1.1.8 supports aarch64 Change-Id: Ie8d39a29dcb7a41c8d59d2a00528b6add8a7655c Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-05insane.bbclass: Add MicroBlaze big endian target infoNathan Rossi
* Add the target info for the 'microblazeeb' target which matches the default MicroBlaze target info Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-24insane.bbclass: Added Epiphany machine definitionsPeter Saunderson
Adding machine definitions for the epiphany (http://www.adapteva.com/) chip using https://github.com/adapteva/epiphany-binutils-gdb. For binutils implementation that defines TARGET_ARCH MACHINE "epiphany": 4643 See https://github.com/adapteva/epiphany-binutils-gdb/blob/epiphany-binutils-2.24/bfd/elf32-epiphany.c For example layer that uses these defines see https://github.com/peteasa/meta-epiphany.git Signed-off-by: Peter Saunderson <peteasa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-13insane.bbclass: Enhance file-rdeps QA checkAlejandro Hernandez
Adds symlink-to-sysroot check to QA_WARN to detect symlinks that point to locations under TMPDIR, which are most likely broken. Changes filerdepends from set() to dict(), hence methods for adding or deleting items had to change too. Now it keeps track of key:value relationship, flags the QA issue; warning the user about which file/package causes the problem, making it easier to debug. [YOCTO #7126] Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-31insane: Add baremetal mappings to the QA arch testRichard Purdie
Add mappings for i586-elf, x86_64-elf and arm-eabi to binary lookup table which allows for a variety of baremetal toolchain generation. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-07insane.bbclass: Added QA test for expanded ${D}Alejandro Hernandez
Checks in FILES and pkg_* variables, solves common mistake of using ${D} instead of $D and warns the user accordingly. [YOCTO #6642] Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-03insane: add unknown-configure-option to default WARN_QARoss Burton
The unknown-configure-option check is generally useful and should be enabled by default. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-01-07insane.bbclass: fix desktopRobert Yang
The desktop-file-utils-native lacks a space. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-06insane.bbclass: add condition for build-depsChong Lu
Add condition for build-deps, then we can use it in INSANE_SKIP. Signed-off-by: Chong Lu <Chong.Lu@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-09-10insane.bbclass: add QA check: file-rdepsRobert Yang
The ipk or deb can't depend on file such as "/bin/bash" or "/usr/bin/perl", so it knows nothing about the pkg depends bash or perl, thus there would be dependencies problems when we run "apt-get install/remove <pkg>" on the target, this check can help us find the issues and then fix them manually. * Benefits: - Help to fix file rdepends issues for ipk and deb - Help to fix abnormal rdepends. - Help to check whether the rdepends is OK or not after build each recipe (don't have to install to the image), for example, a recipe may generate 10 binary packages, only a part of them will be installed to the image by default, we can know whether the rdepends are OK or not for the ones which are installed, but can't know the ones which are not installed, this patch can help check all the 10 binary packages' rdepends. * Basic designs: - Get all the RDEPENDS on the chain. - Get the pkg's FILERPROVIDES from oe.packagedata.read_subpkgdata() and save to set filerdepends. - Get each RPDEPENDS' FILERPROVIDES, RPROVIDES and FILERPROVIDESFLIST, and save to set rdep_rprovides. - Do the set "filerdepends -= rdep_rprovides" and QA issue if filerdepends is not null. [YOCTO #1662] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11test-dependencies, insane.bbclass: improve the messageMartin Jansa
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25insane: Use a warning for FILEEXTRAPATHS issues for nowRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25insane: add checking to standardize how .bbappend files do FILESEXTRAPATHSHongxu Jia
When adding patches or config files from bbappend files, it requires the use of FILESEXTRAPATHS, which has been an issue and failure point for people starting to work with bitbake and oe-core. We add checking to standardize how to use FILESEXTRAPATHS. Only the format of: FILESEXTRAPATHS_append := ":${THISDIR}/Your_Files_Path" or FILESEXTRAPATHS_prepend := "${THISDIR}/Your_Files_Path:" is acceptable. [YOCTO #5412] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>