aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
AgeCommit message (Collapse)Author
2014-03-07insane: Special case kernel modules for x32 targetsNitin A Kamble
The Kernel module packages for x32 target have 64 bit binaries, which breaks the QA_check expecting all the packages to be 32bit. Make a special case for kernel module packages for x32 targets, to avoid this false error. Fixes Bug: [YOCTO #5903] Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2014-03-07insane: check packages for absolute symlinks to the tmpdirRoss Burton
Add a sanity test that checks for symlinks in packages that point into the TMPDIR on the host. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-02-03insane: Fix python function whitespace changesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-21classes/insane: restore printing LIC_FILES_CHKSUM checksum if not specifiedPaul Eggleton
OE-Core rev ec8590aa81e201e28e500935d31cd7266114471f (by me) unintentionally disabled printing the actual checksum value if no checksum was specified, i.e.: LIC_FILES_CHKSUM = "file://COPYING;md5=" Printing the actual checksum in this case is really useful when writing a new recipe, so put this back in. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-16insane: handle recursive configures when checking for unknown configure optionsRoss Burton
Some recipes have configure scripts that recursively call other configure scripts (e.g. dropbear). These multiple-line matches were not being handled correctly, so iterate over every matching line instead of assuming only one line was found. [ YOCTO #5646 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-20xorg-driver: fix qa issue while multilib enabled - contains Xorg driver but ↵Hongxu Jia
no xorg-abi ... WARNING: QA Issue: Package lib32-xf86-video-vesa contains Xorg driver (vesa_drv.so) but no xorg-abi- dependencies WARNING: QA Issue: Package lib32-xf86-video-intel contains Xorg driver (intel_drv.so) but no xorg-abi- dependencies WARNING: QA Issue: Package lib32-xf86-video-omap contains Xorg driver (omap_drv.so) but no xorg-abi- dependencies WARNING: QA Issue: Package lib32-xf86-video-vmware contains Xorg driver (vmware_drv.so) but no xorg-abi- dependencies WARNING: QA Issue: Package lib32-xf86-video-fbdev contains Xorg driver (fbdev_drv.so) but no xorg-abi- dependencies WARNING: QA Issue: Package lib32-xf86-video-modesetting contains Xorg driver (modesetting_drv.so) but no xorg-abi- dependencies ... In oe-core 87be2314fe0e67a616b4f713106b4ae46931f5cb, it fixed add_abi_depends issue while enable multilib. We did the same thing for qa check: package_qa_check_xorg_driver_abi. [YOCTO #5545] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-11-14classes/insane: improve LIC_FILES_CHKSUM messagesPaul Eggleton
* If the md5 parameter is specified with no value, report that the checksum is not specified instead of reporting that it has changed * If the md5 checksum has changed, point directly to the license file in a way that is easy to copy and paste and give the line numbers in an easy to read form, as well as asking the user to verify that the new contents matches the current LICENSE value. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-12insane, license: Trap MalformedUrl exceptions when parsing LIC_FILES_CHKSUMPhil Blundell
bb.fetch.decodeurl() will throw if it doesn't like the look of the URL that it's given. (Bitbake's idea of what constitutes a valid URL is somewhat idiosyncratic so it is fairly easy to trip over this by mistake when writing a recipe.) If these exceptions are allowed to propagate all the way up to better_exec() then we will get a large amount of python stack trace spew when they are finally caught. Avoid that by catching them locally and throwing bb.build.FuncFailed() with a suitable explanation instead. Signed-off-by: Phil Blundell <philb@gnu.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14classes: add aarch64_be targetVictor Kamensky
Add big endian ARMv8 target to OE infrastructure Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org> Signed-off-by: Koen Kooi <koen.kooi@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14insane: configure option checkingRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14bitbake.conf: Remove double slash from PATH_prepend and PKG_CONFIG_DIRMartin Jansa
* we correctly have ${STAGING_DIR_NATIVE}${base_sbindir_native} and then double slash in ${STAGING_DIR_NATIVE}/${base_bindir_native} * similar in PKG_CONFIG_DIR where libdir also starts with slash ${STAGING_DIR_HOST}/${libdir}/pkgconfig * also fix double slash in insane.bbclass and staging.bbclass * I was a bit nervous about staging change (in case the / was important in some weird use-case, but the extra slash is there since following commit where other extra slashes were removed only the one before libdir was kept: commit 6ea78d648951e5bbe9669412c0863daaf7f49ca5 Author: Richard Purdie <rpurdie@linux.intel.com> Date: Mon Nov 2 17:10:51 2009 +0000 autotools.bbclass: Separate out useful staging functions into base.bbclass and call from autotools classes * this isn't fixing any real-world issue AFAIK, I was just trying to debug one weird case where debugedit fails with canonicalization unexpectedly shrank by one character and it's easier to grep for '//' without many harmless instances already in run* scripts etc Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-20insane: don't abort if workdir is not TMPDIR/workRoss Burton
The BASE_WORKDIR variable can be used instead of enforcing WORKDIR being TMPDIR/work (and aborting the build if it isn't). Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01meta: Don't use deprecated bitbake APIRichard Purdie
These have been deprecated for a long time, convert the remaining references to the correct modules and prepare for removal of the compatibility support from bitbake. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-09buildhistory: use package_qa_handle_error for version-going-backwardsMartin Jansa
* this way it's easier for distro to select if such issue should be error, warning or ignored and also it gets recorded in qa.log Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-18classes/insane: allow libdir QA check to be skipped using INSANE_SKIPPaul Eggleton
This path check isn't handled in the normal way where a QA check function is called for every file (there's some minor setup that we want to avoid doing for every file) so we need to check INSANE_SKIP explicitly. In the process, change the code structure a little bit so that we can report the package that contains the errant file. Fixes [YOCTO #4822]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-18classes/insane: fix regression in libdir QA regexPaul Eggleton
There was a slight mistake in the recent change to the lib_re regex - it still needs to begin with a /. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-05insane.bbclass: Added QA warning for shipping /usr/share/info/dirMihai Prica
/usr/share/info/dir should be generated at install time in a postinst. Added QA warning to check at build time for this file. The warning is disabled by default. [YOCTO #3969] Signed-off-by: Mihai Prica <mihai.prica@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-05classes/insane: fix libdir check regexesPaul Eggleton
Ensure these do not pick up e.g. /lib/systemd/system/uuidd.socket, but ensure we pickup e.g. /usr/lib/libnss3.so.1d (example from Debian). This also fixes the broken exec_re regex (lib*.). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-06-28classes/insane: remove la2 check which no longer exists from ERROR_QAPaul Eggleton
This check was actually removed a very long time ago in 6656381714c5956f71ca634f5a5f4aa4661bbf7e, before we even changed the QA checks to use names instead of numbers - the name was probably added ERROR_QA mistakenly because it hadn't also been removed from the comment listing the QA checks or the function that determined which ones were errors. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-11insane.bbclass: quiet package errors not in *_QAChristopher Larson
Currently, if a package QA type from package.bbclass is not listed in ERROR_QA, it gets shown, regardless of whether it's in WARN_QA. This differs from the behavior of the rest of the QA handling (which doesn't call package_qa_handle_error at all if it's in neither _QA variable), and is nonintuitive. Change this to use bb.note() if it's listed neither in ERROR_QA nor WARN_QA, so it ends up in the task logs, but doesn't clutter up the user's output. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07insane/package: refactor packaging sanity testsRobert Yang
Refactor packaging sanity tests from package.bbclass to insane.bbclass so that the message can respect WARN_QA (print the warning message and go on the task) and ERROR_QA (print the error message and fail the task). - For the bb.warn(), give it a message name and add it to WARN_QA, then use package_qa_handle_error() to handle it. - For the bb.error(), give it a message name and add it to ERROR_QA, then use package_qa_handle_error() to handle it. - All the bb.warn() and bb.error() have been replaced in package.bbclass. - A few bb.warn() and bb.error() in insane.bbclass have been kept since they can not be replaced or doesn't have to, for example the bb.error() in package_qa_check_license(), it will print the error message and then invoke bb.fatal() to fail the task, I think that we don't have to replace it with package_qa_handle_error(). - Put all the WARN_QA and ERROR_QA in one line, so that they can be redefined by the user easily. [YOCTO #3190] [YOCTO #4396] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-06-07insane/package: let package.bbclass inherit insane.bbclassRobert Yang
RP's comment: "What we're trying to do is move everything to use a standard mechanism for reporting issues of this type (do_package). With insane.bbclass, you can elect whether a given type of error is a warning or error and fails the task." * The package.bbclass had used package_qa_handle_error() which is from insane.bbclass, and we will use it for handling other warnings and errors, so let package.bbclass inherit insane.bbclass, this change will make the insane as a requirement (always included). * Change the "PACKAGEFUNCS ?=" to "+=", otherwise there would be an error like: Exception: variable SUMMARY references itself! This is because we let package.bbclass inherit insane.bbclass, and PACKAGEFUNCS has been set in insane.bbclass, so the "PACKAGEFUNCS ?=" will set nothing, then the "emit_pkgdata" doesn't run which will cause this error. * Add a QA_SANE variable in insane.bbclass, once the error type is ERROR_QA, it will fail the task and stop the build. [YOCTO #3190] [YOCTO #4396] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-16bbclass: bb.fatal() clean upRobert Yang
The bb.fatal() is defined as: def fatal(*args): logger.critical(''.join(args)) sys.exit(1) So anything after bb.fatal() in the same code block doesn't have any effect, e.g.: bb.fatal("%s_%s: %s" % (var, pkg, e)) raise e The "raise e" should be removed. I searched all the files which use bb.fatal(), only the following 3 classes have this issues: insane.bbclass package.bbclass package_rpm.bbclass [YOCTO #4461] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-10classes/insane: add check for PN in OVERRIDESPaul Eggleton
If a recipe is named such that its PN value matches something already in OVERRIDES (such as when PN happens to be the same as MACHINE or DISTRO), it can have unexpected consequences. Assignments such as FILES_${PN} = "xyz" effectively turn into FILES = "xyz". Implements [YOCTO #4288]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09class/lib: Fix up various file access methodsRichard Purdie
There are various bits of cruft that have built up around our file accesses. This patch cleans some of them up, specifically: * Remove pointless "from __builtin__ import file" * Use open(), not file() * Wrap file usage in a with container to ensure files are closed * Add missing .close() calls in some cases Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09insane: Open file in binary modeRichard Purdie
We open the file we're writing to in binary mode so open the input stream with the same mode so things match. This avoids errors with python3. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09classes/recipes/lib: Fix various python whitespace issuesRichard Purdie
There are some left over tab characters in the python functions. This removes them and resolves python 3 errors. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-11ptest bug fixesBjörn Stenberg
Move ${PN}-ptest to start of PACKAGES to ensure all ptest files are packaged in the -ptest package. Add QA exclusions to insane.bbclass to ensure -ptest packages can contain any files they need. Disable ptest for native packages. Don't emit errors on missing _ptest functions. Signed-off-by: Björn Stenberg <bjst@enea.com> Signed-off-by: Anders Roxell <anders.roxell@enea.com> Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-08insane.bbclass: Updated MicroBlaze machine definitionsNathan Rossi
* Removed existing definition with machine 47787, this definition is outdated, a sanity error should occur if an ELF uses this value. * Added new definition with machine 189. This value replaces the existing value since August 2009. See binutils thread for more information. (http://sourceware.org/ml/binutils/2009-08/msg00127.html) Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05insane.bbclass: Add ALLOW_EMPTY to list of package specific variablesRichard Purdie
ALLOW_EMPTY should have a package specified so extend sanity checks to cover it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-01insane.bbclass: Merge linux-gnu entries in machine dictionary and add sh4 ↵Kyle Farnsworth
machine. Signed-off-by: Kyle Farnsworth <kyle@farnsworthtech.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-02-25siteinfo/insane: More n32 fixupsPeter Seebach
For perfectly sound reasons, n32 MIPS is a mips64 subset denoted by an ABI change, thus, "mips64-vendor-linux-gnun32" rather than "mips-vendor-linux-gnu". A previous change had fixed up insane.bbclass to recognize these, which mostly worked, but left SITEINFO_BITS set to 64. Since bit-32 is processed first, and there are specific checks for linux-gnun32, modify the mips64-linux-gnun32 lines to specify "bit-32", so things that check SITEINFO_BITS get the right answer. Also, drop the mips{,el}-linux-gnun32 lines, because that's not a valid combination; n32 only makes sense for mips64. Also, the insane.bbclass change spelled "mips64el" as "mipsel64", which no one noticed because no one's using little-endian n32, apparently. Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-14insane: remove unused variableRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06insane.bbclass: Add missing R* variables to pkgvarcheckMartin Jansa
* check also RSUGGESTS, RCONFLICTS, RPROVIDES, RREPLACES Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06staging/insane.bbclass: Move legacy do_stage check iinto insane.bbclassRichard Purdie
We might as well put all the sanity checks in one place. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06insane.bbclass: Add documentation headers for logical code blocksRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06insane.bbclass: Add pkgvarcheck to check for suboptimal usages of variablesRichard Purdie
Check through the variables: 'RDEPENDS', 'RRECOMMENDS', 'FILES', 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm' and if there is a variable set which isn't package specific, inform the user of this. Using these variables without a package suffix is bad practise and complicates dependencies of packages unnecessarily as well as complicates the code. Lets convert the remaining issues and then we can take the small performance gain. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package: Create global package file list and use throughout PACKAGEFUNCSRichard Purdie
Currently we do a signficant amount of tree traversal in many different places which in inefficient. We can assume that the files don't change and cache the file list which gives an efficiency improvement which this patch does using a global variable. (From OE-Core rev: 2d7608842d2dab07065e60aab729a5c8fd6b7907) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01insane.bbclass: removing outdated commentLukas Bulwahn
This commit removes an outdated comment that recorded an issue that has been resolved in the commits 1c75a5df6845090480deff20f469f177501d2182 and d2d5456cd3b3bd3e52a5dedccca4d46e3a7986d1. Probably, the comment was missed when changing the behavior in those commits. Signed-off-by: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-30insane.bbclass: Fix incorrect getVar callRichard Purdie
On a trace I was a bit puzzled why getVar was making 180 calls to len(d). This is an expensive operation that should be very rarely called and certainly not by getVar. In perl's do_package it was resulting in ~1.5 million function calls from those 180 cases. Ultimately this typo was why. Lets fix it and save the CPU cyles. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-24insane.bbclass : Disable tests for unsafe references in binaries and scripts.Philip Balister
These test look for programs in / that depend on programs in /usr. After a brief discussion in #oe, we decided these tests should be disabled so we can focus on more serious QA issues. If you are working on a system where / and /usr are on different partitions, you should turn these tests back on and resolving the QA warnings. Signed-off-by: Philip Balister <philip@balister.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-18insane.bbclass: add qa package name checkConstantin Musca
Check if package names match the [a-z0-9.+-]+ regular expression [YOCTO #3139] Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-12insane: detect and warn about relocations in .textPhil Blundell
Signed-off-by: Phil Blundell <pb@pbcl.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-02classes: replace virtclass-native(sdk) with class-native(sdk)Robert Yang
The overrides virtclass-native and virtclass-nativesdk are deprecated, which should be replaced by class-native and class-nativesdk. [YOCTO #3297] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-10-27insane.bbclass and friends: Fix sanity checks and multlib headers for n32Peter Seebach
The n32 architecture is odd, in that it's a mips64 ABI which happens to be 32-bit. To handle this, we need something in the environment which can be used to distinguish it. The obvious place to stash this is the ABI suffix, so we use "n32" as an ABI suffix. This allows a couple of improved checks: 1. In insane.bbclass, we can use "linux-gnun32" to discern that it's okay for a mips64 binary to be a 32-bit binary in some cases. 2. In multilib_header, we can check for the n32 ABI, and use a distinct value. 3. In siteinfo, add linux-gnun32 as a synonym for linux, similar to what's done for linux-gnux32, and tell the mips*-linux-gnun32 variants to pick up the corresponding mips-linux site configs. Note that the multilib header wrapper already has n32 hooks in it, there was just nothing creating -n32 header variants. Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-10-23insane: add a check for Xorg driver ABI dependenciesRoss Burton
Now that xserver provides driver ABI names, all drivers should depend on the ABI version that they have been built against. All drivers that include xorg-driver-input.inc or xorg-driver-video.inc will get these automatically, so this should only impact binary drivers. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18insane: Don't try to run objdump on symlinksPhil Blundell
If the link is absolute then we might end up reading from a host binary or a nonexistent path, neither of which will produce useful results and may result in objdump failure and python backtrace spew. If the link does point to a binary within the installation root then we will scan the pointed-to file at some point anyway so there is no need to do it again. Signed-off-by: Phil Blundell <pb@pbcl.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18insane: Rationalise phdrs-based QA checksPhil Blundell
Various different QA checks are based on essentially the same data from the ELF program headers. Calling objdump to extract it repeatedly is inefficient, particularly if the shell is involved. Instead, let's cache the output from objdump inside the qa.elf object and allow it to be reused by multiple tests. Also, using objdump instead of scanelf to check for bad RPATHs (in the same way that the useless-rpaths check was doing already) allows the dependency on pax-utils-native to be dropped. Signed-off-by: Phil Blundell <philb@gnu.org> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-10-18insane.conf: add new libexec testSaul Wold
This tests for /usr/libexec as we are moving things to /lib/. the test is ignored if the distro defaults to /usr/libexec. Currently this test will be disabled by default since the current value of ${libexecdir} is "/usr/libexec". Also this tests needs to be enabled in the WARN_QA list. [YOCTO #2915] Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-10-18insane.bbclass: add AArch64 supportMarcin Juszkiewicz
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> Signed-off-by: Saul Wold <sgw@linux.intel.com>