aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
AgeCommit message (Collapse)Author
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>
2012-10-02classes: Update to use corrected bb.utils.explode_dep_versions2 APIRichard Purdie
The bb.utils.explode_dep_versions function has issues where dependency information can be lost. The API doesn't support maintaining the correct information so this changes to use a new function which correctly handles the data. This patch also fixes various points in the code to ensure that we do not have any duplicates in things that use explode_dep_versions. A new sanity test to test the contents of the R* variables is also added. [Some changes from Mark Hatle <mark.hatle@windriver.com>] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-02insane.bbclass: Remove copy and paste confusion when using OVERRIDESRichard Purdie
People keep copying this code and its confusing and unnecessary. Remove the bad examples to try and stop this happening. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-21insane.bbclass: Improve ability to detect enabled testsRichard Purdie
Define an ALL_QA variable which can be used to determine which tests to run. Improve the libdir test to work in the case it is set to raise an error rather than a warning. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-21insane.bbclass: add library dir sanity checkRadu Moisan
Check in ${PKGD} for libraries in wrong locations. Trigger a warning if so. Eg. Catch recipe installing /lib/bar.so when ${base_libdir}="lib32" or installing in /usr/lib64 when ${libdir}="/usr/lib" [Yocto #2038] Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-03Rename task to packagegroupPaul Eggleton
"Package group" is a much more appropriate name for these than task, since we use the word task to describe units of work executed by BitBake. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-08-31nativesdk: Switch to using nativesdk as a prefix, not a suffixRichard Purdie
As discussed on the mailing lists, using a suffix to package names is hard and has lead to many recipes having to do PKGSUFFIX games. Its looking extremely hard to scale nativesdk much further without hacking many recipes. By comparison, using a prefix like multilib does works much better and doesn't involve "hacking" as many recipes. This change converts nativesdk to use a prefix using the existing multilib infrastructure. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21insane.bbclass: Fix RPATH warning in the face of funny path stringsAndy Ross
In toolchain edge cases it's possible for the RPATH of a library to be set to something like "/usr/lib/../lib". This should be detected as "/usr/lib" and generate a warning. Signed-off-by: Andy Ross <andy.ross@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21meta/classes: Various python whitespace fixesRichard Purdie
It was pointed out we have a number of weird indentations in the python functions. This patch cleans up 3, 7 and other weird indentations for the core bbclass files. It also fixes some wierd (odd) shell function indentation which my searches picked up. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-08insane.bbclass: Make ldd exec_prefix error reporting easier to readMark Hatle
Remove the long obtuse sysroot path from the ldd output. Make the error message significantly easier to read and understand. Old Style: WARNING: QA Issue: keyutils: /home/mhatle/git/oss/oe-core/build-i386/tmp-eglibc/work/i586-oe-linux/keyutils-1.5.5-r1/packages-split/keyutils/sbin/request-key links to something under exec_prefix WARNING: QA Issue: ldd reports: libkeyutils.so.1 => /home/mhatle/git/oss/oe-core/build-i386/tmp-eglibc/sysroots/qemux86/usr/lib/libkeyutils.so.1 (0xdead1000) libc.so.6 => /home/mhatle/git/oss/oe-core/build-i386/tmp-eglibc/sysroots/qemux86/lib/libc.so.6 (0xdead2000) /lib/ld-linux.so.2 => /home/mhatle/git/oss/oe-core/build-i386/tmp-eglibc/sysroots/qemux86/lib/ld-linux.so.2 (0xdead3000) New style: WARNING: QA Issue: keyutils: /sbin/request-key, installed in the base_prefix, requires a shared library under exec_prefix (/usr): libkeyutils.so.1 => /usr/lib/libkeyutils.so.1 (0xdead1000) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30Revert "meta: replace os.popen with subprocess.Popen"Richard Purdie
This reverts commit e83d8e58a6b107eea87df0ec233a1bc932b2c6e as the conversion is not correct. Its replacing readlines() calls which generate an array with what are effectively strings. There are split("\n") calls missing in many cases so this needs to be reverted until it gets fixed.
2012-05-30meta: replace os.popen with subprocess.PopenRobert Yang
Replace os.popen with subprocess.Popen since the older function would fail (more or less) silently if the executed program cannot be found There are both bb.process.run() and bb.process.Popen() which wraps the subprocess module, use it for simplifying the code. Note: We don't need the "2>/dev/null" or "2>&1" since bb.process.run() can handle it, it will raise exception when error occurs, we should handle the exception ourselves if we want to ignore the error. More info: http://docs.python.org/library/subprocess.html#subprocess-replacements [YOCTO #2454] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30meta: replace os.system with subprocess.callRobert Yang
Replace os.system with subprocess.call since the older function would fail (more or less) silently if the executed program cannot be found More info: http://docs.python.org/library/subprocess.html#subprocess-replacements [YOCTO #2454] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-20insane.bbclass: Add mips64{el} to known machinesKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2012-04-11insane.bbclass: Add missing variable bpnNoor Ahsan
* bpn variable was used but it was not defined. Add bpn to resolve that issue. Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-22insane.bbclass: maybe no log.do_compile or log.do_installRobert Yang
The insane.bbclass grep in log.do_compile and log.do_install unconditionally, but there maybe no such logs when mirror the pkg from sstate cache file. We should check whether the log file exists or not before grep in it. Additionally, break the one too long line into two (Add a "\n"). [YOCTO #2153] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05meta: Replace bb.data.expand(xxx, d) -> d.expand(xxx)Richard Purdie
sed \ -e 's:bb.data.\(expand([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data.expand *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24insane.bbclass: Only depend on desktop-file-utils-native when we need itRichard Purdie
There is no point in depending on desktop-file-utils if we're not going to use it. This patch makes the dependency conditional upon the desktop tests being enabled. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-26insane.bbclass: Add test for static .a libraries in non-staticdev packagesSaul Wold
This check verifies that non staticdev and non pic packages do not have static libraries in them. There are a few exceptions for the libgcc-dev and libgcov-dev packages which are whitelisted, also the *_nonshared.a need to be part of their respective -dev packages. This is currently a warning to work out any other issues in the upper layers but will be moved to ERROR at somepoint in the future. [YOCTO #663] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-17insane.bbclass: fix elf.arch not matching error for x32 kernelNitin A Kamble
For x32 the user space is 32bit and the kernel is 64bit. So the elf.arch for vmlinuz is x86_64 and not x86. This commit fixes this QA error thrown for x32 kernel. | ERROR: QA Issue: Architecture did not match (62 to 3) on /work/qemux86_64-poky-linux-gnux32/linux-korg-3.1+git1+e2bf8464ddbf5da24d3d320cded5691828a91a0b-r1/packages-split/kernel-vmlinux/boot/vmlinux-3.1.0-yocto-standard-01628-ge2bf846 Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2012-01-05insane.bbclass: use bb.process.Popen instead of subprocess.check_outputScott Garman
subprocess.check_output was only introduced in Python v2.7, so we cannot use it. This refactors the QA test to use bb.process.Popen instead. This fixes the error: AttributeError: 'module' object has no attribute 'check_output' It no longer checks the return status of prelink-rtld, as that case was simply adding noise. This QA test is intended to only warn about specific paths that binaries could be linking to, not handle the case where there is a missing library. Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-05insane.bbclass: add QA tests for unsafe references to exec_prefixScott Garman
Files under exec_prefix (commonly /usr) may not be available during system recovery. exec_prefix may also be kept on a separate partition that is mounted late in the boot process. This QA test throws an warning if a binary in base_[bindir|sbindir|libdir] is dynamically linked to a file under exec_prefix. The intention is to turn this into an error in the near future. It also checks executable non-binaries (e.g, shell scripts) in the above base directories with a simple grep test to look for references to exec_prefix. This test only produces a warning, since false positives are likely. This fixes [YOCTO #1008] Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-17insane.bbclass: avoid errors for x32 kernelNitin A Kamble
x32 abi of x86_64 has 32bit userspace and the kernel is 64bit. The qa checking code was reporting this as errors for x32 kernel files and modules. This commit extends the condition in the checking code to avoid throwing the bitsize not matched error for x32 kernel files. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10Convert to use direct access to the data store (instead of bb.data.*Var*())Richard Purdie
This is the result of running the following over the metadata: sed \ -e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \ -e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-10-19insane.bbclass: print full path on invalid LICENSE_FILES_CHKSUMDarren Hart
Currently only the basename is printed when os.path.isfile() returns a failure for the license file. If the file is present, but in the wrong directory, this can be non-obvious to debug. Use the full path instead. Make a minor grammatical correction in the error message while we're at it. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2011-09-29insane: Promote most warnings into QA errors by defaultRichard Purdie
We agreed a while back that we'd start ERRORing on QA issues, not just WARNING about them. This patch changes the default QA levels to error on everything except ldflag and useless rpath issues. It also stops giving out QA warnings about desktop files since it adds noise to the build and until someone plans to seriously tackle that problem, its pointless. We can promote the ldflag and rpath warnings too, when the issues in OE-Core are resolved (they're mostly there now, just a few more to go). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-22insane.bbclass: don't warn on .so files in -nativesdk packagesDmitry Eremin-Solenikov
There is no point in warning against .so symlinks in -nativesdk packages. They have to contain such links, so shut up the warning. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-12insane: add linux-gnu to the platform dataChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-08-08insane.bbclass: add entries for linux-gnux32Nitin A Kamble
For x86_64 new ABI : x32, there is a new name for the TARGET_OS: linux-gnux32 Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2011-07-27multilib: Add support for compiling recipes against multiple ABIsRichard Purdie
This patch adds the core multilib class which can be used along with a parameter specifying the mutlilib to use in BBCLASSEXTEND. The MLPREFIX variable is added and can be used in cases where its too difficult to dynmaically work out where a mutltilib prefix is needed to be added to a variable. This includes: * SHLIBSDIR and PACKAGE_ARCH fixes from Lianhao Lu. * PACKAGE_DYNAMIC mapping from Yu Ke * PACKAGE_INSTALL mapping from Yu Ke * RPROVIDES mapping from Yu Ke * TARGET_VENDOR fix from Mark Hatle * Ignorning *-native-runtime dependnecies as well as *-native from Yu Ke * Map PKG and ALLOW_EMPTY from Dongxiao Xu * Ensure RCONFLICTS and PKG field dependencies are remapped (from Dongxiao Xu) * Ensure PN and MLPREFIX are set at the same time to ensure consistent BPN values (Yu Ke) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com> Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-22insane.bbclass: Recognise powerpc64Kumar Gala
Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-20insane: improve diagnostic for redundant rpathPhil Blundell
Make it more obvious which file, and which recipe, are at issue. Signed-off-by: Phil Blundell <philb@gnu.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-14insane: make GNU_HASH check slightly more robust (avoids false negatives ↵Phil Blundell
with gold); add check for useless rpaths It isn't safe to make assumptions about the order of the entries in the dynamic section. Fix the ldflags test to cope with the case where GNU_HASH comes before NEEDED and/or INIT. Also, add a new warning for binaries which contain useless (but benign) rpath entries pointing to the default search locations. Signed-off-by: Phil Blundell <philb@gnu.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-12insane.bbclass: skip rdepends QA checks for kernel / modulesPaul Eggleton
The kernel and module recipes have very few dbg/dev packages, however they can easily have false positive results from the rdepends QA checks (e.g. kernel-module-lirc-dev). Thus disable these tests for any recipe that inherits kernel or module-base. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-08insane.bbclass: fix error/warning status being invertedPaul Eggleton
Fix package_qa_handle_error so that it returns the correct values in order to determine error/warning status. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-08insane.bbclass: allow dev-deps to be skipped via INSANE_SKIPPaul Eggleton
Add the missing check in package_qa_check_rdepends to allow dependencies from non-development packages on development packages to be skipped. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-07insane: add microblaze little endian target infoAdrian Alonso
* Add microblaze little endian target info to package_qa_get_machine_dict Signed-off-by: Adrian Alonso <aalonso@secretlab.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-05insane.bbclass: Fix indentation errorRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-05insane.bbclass: Add warnings for packages which are not -dev packages which ↵Richard Purdie
depend on -dev packages Based on some code from Phil Blundell but reworked against insae.bbclass changes. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-05insane.bbclass: Allow INSANE_SKIP to work on a per test basisRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01insane.bbclass: Start to rework this so specific checks can be easily made ↵Richard Purdie
warnings/errors This patch means the warning/error handling can be controlled from local.conf and/or from the distro level and no longer uses numbers but strings instead. The system becomes extensible so that other classes can extend the path QA checks at least. It also removes all th duplicate error message code, we should have *one* good error message. Much work remains including making INSANE_SKIP take the classes of QA test to skip but its a start. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-10insane.bbclass: skip license checksum if LICENSE is "CLOSED"Otavio Salvador
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2011-05-10insane: add micrblaze target infoAdrian Alonso
* package_qa_get_machine_dict * Add microblaze dic entry for QA * Prebuilt toolchain triplet microblaze-unknown-linux-gnu- * TARGET_OS is linux-gnu for this toolchain Signed-off-by: Adrian Alonso <aalonso@secretlab.ca>
2011-05-04insane.bbclass: Checking for NLS too when checking gettext dependencyKhem Raj
Checking for gettext is not needed when --disable-nls is used Let user know what variant of gettext is missing e.g. gettext-native, gettext-nativesdk etc, reveals a bit more for user Check for virtual/gettext Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-05-04gettext.bbclass: Updates to better handle gettext alternativesRichard Purdie
* Change gettext dependency to virtual/gettext * Ensure INHIBIT_DEFAULT_DEPS removes gettext dependencies * Use BASEDEPENDS to ensure dependencies are added in native/nativesdk cases Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-28insane.bbclass: Move code to add function to tasks toward the endKhem Raj
Cosmetic change to make syntax highlighters happy Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-04-04classes: Use linux-uclibceabi instead of linux-uclibgnuceabi for os portion ↵Khem Raj
of triplet Signed-off-by: Khem Raj <raj.khem@gmail.com>