Commit Graph

241 Commits

Author SHA1 Message Date
Robert Yang e1850048a2 insane.bbclass: print all the QA messages
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.

(From OE-Core rev: 1dcb38ca9d632887dd99ea9fa32dd955561dc18d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:22 +00:00
Robert Yang 68c5e6d4d0 insane.bbclass:buildpaths: ignore ipkg/dpkg's CONTROL dir
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.

(From OE-Core rev: cd4313339853d2eddebf93a49d0f45a305985a31)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:21 +00:00
Richard Purdie 1da8f52b67 insane: Start to clean up do_configure_qa code
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.

(From OE-Core rev: fbdf977a8094bb1e0baca85ffb3ed7f326986639)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:24:46 +00:00
Richard Purdie dd28695320 insane: Clean up horrible return value processing code
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.

(From OE-Core rev: ebee3caeaa18daf4974ea90e264d64467681f57a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:24:46 +00:00
Richard Purdie ea29bec6c7 insane/package: Fix cases where QA errors aren't fatal
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]

(From OE-Core rev: 7e36d13212763fe409747aba011c020c9aeba6d7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 11:54:51 +00:00
Juro Bystricky ec79a19f24 insane: in libdir test allow libraries in libexecdir
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.

(From OE-Core rev: 9f5ad12a9532687a7a82e24b7c4506cabc13bba2)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-12 23:42:52 +00:00
Jian Liu 70ae7a6716 insane.bbclass: Avoid libdir QA check if 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.

(From OE-Core rev: f18a917c1493d4107c7f9db1d9ba19ec368f9b48)

Signed-off-by: Jian Liu <jian.liu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:50:27 +00:00
Richard Purdie 7d8616c2fc insane: Don't depend on BB_TASKDEPDATA
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.

(From OE-Core rev: 1eefc83e6aeb3cd5501b8e593dda052b1e183cc5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:50:27 +00:00
Paul Eggleton 59fdbaed99 classes/insane: rename invalid-pkgconfig QA check to invalid-packageconfig
We have enough confusing name clashes already, let's not precipitate
another one.

(From OE-Core rev: a40e69508e66268e0743502334797374dee31125)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:26 +00:00
Maxin B. John 78b9d2d62f insane.bbclass: remove misleading path in warning
cross-compilation warning from insane.bbclass is slightly misleading.
So, remove the misleading path from warning.

[YOCTO #7540]

(From OE-Core rev: fd0c6de410856ec42e20762163575f0efde44541)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:36:26 +01:00
Robert Yang dd26efba06 insane.bbclass: make package_qa_clean_path return a relative path
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.

(From OE-Core rev: 67a1e4b087a39db04370685616d5b439b0f2b505)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:26 +01:00
Marek Vasut 76a8c74c13 insane: Add nios2 support
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 .

(From OE-Core rev: 4e8175cf0f0a5b9e75e451b030b73643e7b33791)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Walter Goossens <waltergoossens@home.nl>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:06 +01:00
Martin Jansa a96069d410 insane.bbclass: drop extra line-feed in pkgname check
* 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]

(From OE-Core rev: 8df8b942fa570de42910dcd8a1416063cbe1ddbe)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:00 +01:00
Martin Jansa 10fb575d61 insane.bbclass: show PN and relative path in package_qa_check_host_user
* show PN as other QA checks
* strip PKGDEST prefix from shown path as other QA checks

(From OE-Core rev: 39b1bca459d52b58ca055604b5012d9a411e3a59)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:59 +01:00
Christopher Larson 2d4976772c insane.bbclass: add host-user-contaminated test
- 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.

(From OE-Core rev: 1854dc60a4c7e97f0d6d26208fd42bf0dc1bfa7f)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:47 +01:00
Christopher Larson b95c340443 insane.bbclass: handle tests which need fakeroot
If any tests listed in FAKEROOT_QA are enabled (listed in ALL_QA), then
run do_package_qa under fakeroot.

(From OE-Core rev: 1b697a5e92be01725ad20298f54c277c852c974d)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:47 +01:00
Leonardo Sandoval 636d2477b2 insane.bbclass: Check for invalid characters (non UTF8) on recipe metadata
Check if invalid characters are present on recipe's metadata. Fields
taken into account are: 'DESCRIPTION', 'SUMMARY', 'LICENSE' and 'SECTION'.

(From OE-Core rev: f006296c88bacd3ee18559dedf3a1ff313cde8a4)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:22 +01:00
Paul Eggleton d114b561b1 classes/insane: fix QA check message referring to nativesdk
nativesdk has been a prefix rather than a suffix for some time now.

(From OE-Core rev: 940b9d1736dbe63f80b9d46b2b9b1cea77ed35f1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:47:02 +01:00
Robert Yang 1df8af4248 base.bbclass: move invalid PACKAGECONFIG checking to insane.bbclass
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]

(From OE-Core rev: 0a64dfcdb9f5a37771f881895be230392c4d0aff)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:15 +01:00
Bian Naimeng 4012fd3235 do_unpack: move qa check of unpack into insane.bbclass
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.

(From OE-Core rev: 81216da9fa90dc8a67a0f367742b1e73afec0aa1)

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:18 +01:00
Richard Purdie 86d30d756a meta: Add explict getVar param for (non) expansion
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 *`

(From OE-Core rev: ab7c1d239b122c8e549e8112c88fd46c9e2b061b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:57:25 +01:00
Patrick Ohly f677b5893d insane.bbclass: fix false negative in build-deps QA check
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.

(From OE-Core rev: 9f5792088315ab42f77fe1a1af7d2225e7ad5418)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:46:57 +01:00
Robert Yang 041af82379 multilib.bbclass: use package_qa_handle_error
Use package_qa_handle_error to handle the QA issue.

(From OE-Core rev: c925847dea7b0480c901e94b6a071a18f5e00d45)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:16 +01:00
Cristian Iorga 63e62599a6 insane: errors out on binaries installed by allarch-inherit recipes
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].

(From OE-Core rev: a938f2117989b596c50d9d7f3929dd3c0f893d08)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:09 +01:00
Khem Raj 0ea0f6d04a insane: Support aarch64 on musl
musl 1.1.8 supports aarch64

Change-Id: Ie8d39a29dcb7a41c8d59d2a00528b6add8a7655c
(From OE-Core rev: e0fdcfe888236abf5751645e9b5cabcc834354fa)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-07 13:40:36 +01:00
Nathan Rossi 8473de969f insane.bbclass: Add MicroBlaze big endian target info
* Add the target info for the 'microblazeeb' target which matches the
  default MicroBlaze target info

(From OE-Core rev: 9c02b5af28f43b0b8ac825dffdbfa49a71c63132)

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-05 22:15:17 +01:00
Peter Saunderson b16f22b5ec insane.bbclass: Added Epiphany machine definitions
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

(From OE-Core rev: 937471ff2c633865d68e6ee73e0ec462d3768116)

Signed-off-by: Peter Saunderson <peteasa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-24 11:06:55 +01:00
Alejandro Hernandez 1521a3dda0 insane.bbclass: Enhance file-rdeps QA check
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]

(From OE-Core rev: 9946909dc95c3274a98112cf786d171547b3ed75)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-13 22:33:19 +01:00
Richard Purdie 0d0d02af44 insane: Add baremetal mappings to the QA arch test
Add mappings for i586-elf, x86_64-elf and arm-eabi to binary lookup
table which allows for a variety of baremetal toolchain generation.

(From OE-Core rev: bf628a2fb1da704ff2a0f24c774eafdd12a081fb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-31 22:28:09 +01:00
Alejandro Hernandez 24d9d5a6eb insane.bbclass: Added QA test for expanded ${D}
Checks in FILES and pkg_* variables, solves common mistake of

using ${D} instead of $D and warns the user accordingly.

[YOCTO #6642]

(From OE-Core rev: e3ea62b370f69d2435e76f6e444f5d3a3b25eb17)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:26 +00:00
Ross Burton 8ec0347431 insane: add unknown-configure-option to default WARN_QA
The unknown-configure-option check is generally useful and should be enabled by
default.

(From OE-Core rev: 2f1909a6a78dec943800a0e8a39f890c007165b7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:55 +00:00
Robert Yang 4935fe64be insane.bbclass: fix desktop
The desktop-file-utils-native lacks a space.

(From OE-Core rev: 95f7d2c8fd5ee6ad0b7d202906073066f35a268d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-07 14:52:52 +00:00
Chong Lu c60fa73007 insane.bbclass: add condition for build-deps
Add condition for build-deps, then we can use it in INSANE_SKIP.

(From OE-Core rev: 1cb62dbb1ecedc6232be3509a2887e92def2b8db)

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-06 16:45:20 +00:00
Robert Yang 60bfdb0f19 insane.bbclass: add QA check: file-rdeps
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]

(From OE-Core rev: cd5e0f01cdb4e7c759c01cf3f87952a20253737c)

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-09-10 11:33:22 +01:00
Martin Jansa a1fa222d48 test-dependencies, insane.bbclass: improve the message
(From OE-Core rev: b73e6159aed1a9768d02d12e7894ca0f1e72be69)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 11:27:32 +01:00
Richard Purdie e2e82310a1 insane: Use a warning for FILEEXTRAPATHS issues for now
(From OE-Core rev: f907b3a5b414aa53ce8271763f04532d7127006f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 19:36:49 +01:00
Hongxu Jia 68bc4eb778 insane: add checking to standardize how .bbappend files do FILESEXTRAPATHS
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]

(From OE-Core rev: 69e083237e632f7d84a7b218dd12d1a5ad95a229)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 16:54:43 +01:00
Richard Purdie a202f8a663 insane: Add build depends check
Now that we can get the task dependency tree from bitbake, we can start
to use this to strengthen our QA checks. If a dependency is added on
something which isn't in our dependency tree, that is obviously a bad
thing for example.

This patch therefore checks the RDEPENDS against the list of tasks and
ensures we do have a dependency present, if not a QA warning or error
can be issued through the usual mechanism.

The implementation is complicated by needing to resolve the RDEPENDS to
a PN using pkgdata. Its possible that can be an RPROVIDES of another
package so we need to check that too if it isn't a direct RDEPENDS.

To allow this test to work, we need to extend the do_package_qa
dependencies to include all RDEPENDS. In practise the do_package_write_*
tasks already do this so there should be no new circular dependencies or
any issues like that.

For now the issues are warnings as there are issues this finds in
OE-Core which need to be resolved and certainly will be in other layers
too. This change should simplify and assist some of Martin's dependency
scripts, the idea for this came from a discussion with Martin. It has
changed in that it doesn't just cover shlibs dependencies but checks all
dependencies.

(From OE-Core rev: f6cb24cf2255297308ef57399a6be407129d9b8f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 15:33:56 +01:00
Ming Liu a237888427 insane.bbclass: avoid QA errors for n32 kernel
A series of commits had been integrated to avoid qa checking code
throwing the bitsize not matched error for x32 kernel files, the
same logic is also needed by n32 kernel which was not addressed in
that series.

This commit extends the condition for n32 kernel files.

(From OE-Core rev: 6a169be15439f12169869ecef890594796e70e58)

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19 00:09:01 +01:00
Chong Lu bb0b7656fb classes/insane: Show QA check name
QA errors/warnings would show the name of the QA failure in the error/warning message.
The format is listed:

	<message> [QA check name]

You can see which QA check you need to disable if you want to disable it.

[YOCTO #6160]

(From OE-Core rev: a5ea622a8e012d3263bc36b6239ee43a4d1fb0ee)

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-16 10:20:49 +01:00
Richard Purdie 9e99bcffec insane: Ensure do_package_qa happens after do_packagedata
We're relying on the packagedata being available for this task to work
correctly so lets ensure it is with the correct dependency.

(From OE-Core rev: fa325e44f5b429b4038022b31285af9c94672943)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-11 23:20:04 +01:00
Richard Purdie 09898d6074 insane: Split do_package_qa into a separate task (from do_package)
Its possible to run the package QA checks as a separate task rather than
as part of the do_package task. This offers more parallelism but the
fact that made me propose this is that ideally we'd like to access
pkgdata to help add new tests and to do that, we need to run later in
the task list. We also need to add in RDEPENDS to the task which apply
to do_package_write_* but not do_package. See the subsequent patches
for why this is desireable.

If we split into a separate task, we need to add in calls to read
the sub package data, build the cache structure used by do_package and
cover the task with sstate (which is empty and just acts as a stamp
saying it passed package QA). We also need to handle our own
dependencies.

(From OE-Core rev: d31f75a72cb2322f753d945da86d5f3287eef06b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-10 17:38:31 +01:00
Khem Raj 56d4f91fe2 siteinfo, insane: Recognize musl specific triplets
We will use '-musl' to identify musl based systems
this patch lays the foundation for recognising those
and map them to internal variable representations

(From OE-Core rev: 9cd77aed67373e33dc69158ab02b94d7045c1119)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-01 14:29:29 +01:00
Nitin A Kamble d31d2e85cf insane: Special case kernel modules for x32 targets
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]

(From OE-Core rev: a4261ab92735abfba835e916931d2e920f335aaa)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 14:58:46 +00:00
Ross Burton a8dc6aed55 insane: check packages for absolute symlinks to the tmpdir
Add a sanity test that checks for symlinks in packages that point into the
TMPDIR on the host.

(From OE-Core rev: 9e28808a6d6f47dc10ad87b878c7e912c2bbe16f)

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>
2014-03-07 14:58:45 +00:00
Richard Purdie 76f52a81f6 insane: Fix python function whitespace changes
(From OE-Core rev: 9dee6c2fe0d1882521c0f9a6998257a652845854)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-03 16:16:30 +00:00
Paul Eggleton 63fb3587fc classes/insane: restore printing LIC_FILES_CHKSUM checksum if not specified
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.

(From OE-Core rev: e58cdd385584d7449236e6b1dc1bce0cbc8f2a0a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-21 17:22:38 +00:00
Ross Burton cd5d65a83f insane: handle recursive configures when checking for unknown configure options
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 ]

(From OE-Core rev: b226ab4cf7779f4dfaa78210cb6249766ed564c1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-16 12:13:59 +00:00
Hongxu Jia 4cf2d7c32b xorg-driver: fix qa issue while multilib enabled - contains Xorg driver but 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]

(From OE-Core rev: 3132d8b52eb05b03df4d4589f94cff38ab69b81d)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-20 14:03:29 +00:00
Paul Eggleton 8692eebc00 classes/insane: improve LIC_FILES_CHKSUM messages
* 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.

(From OE-Core rev: ec8590aa81e201e28e500935d31cd7266114471f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-14 13:39:48 +00:00
Phil Blundell 790b75f985 insane, license: Trap MalformedUrl exceptions when parsing LIC_FILES_CHKSUM
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.

(From OE-Core rev: ef35e164c62d89806367b822e3baeff482ec237f)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-12 16:00:30 +00:00
Victor Kamensky 5c63fc7a67 classes: add aarch64_be target
Add big endian ARMv8 target to OE infrastructure

(From OE-Core rev: 570ae1afecc88b12a11e62a4341069c125d18403)

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-14 16:55:32 +01:00
Ross Burton 9877df0309 insane: configure option checking
(From OE-Core rev: 1b51688d2ea5174334cc8a8a559461b2c4a15a77)

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-14 16:55:27 +01:00
Martin Jansa f33afade31 bitbake.conf: Remove double slash from PATH_prepend and PKG_CONFIG_DIR
* 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 6ea78d6489
  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

(From OE-Core rev: 0ddaf52e9e344986ae2b016cc068d9eee71b4347)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14 16:55:24 +01:00
Ross Burton 06965e88e6 insane: don't abort if workdir is not TMPDIR/work
The BASE_WORKDIR variable can be used instead of enforcing WORKDIR being
TMPDIR/work (and aborting the build if it isn't).

(From OE-Core rev: 176a36ace1624f3bbe498307aeabbd7935de14e6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-22 12:19:32 +01:00
Richard Purdie 554c892ccf meta: Don't use deprecated bitbake API
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.

(From OE-Core rev: 6a39835af2b2b3c7797fe05479341d71a3f3aaf6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01 15:51:42 +01:00
Martin Jansa 560dac6e7d buildhistory: use package_qa_handle_error for version-going-backwards
* 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

(From OE-Core rev: 44624853de8c88abdcae2ccd0902b390ff546d4c)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-12 13:09:50 +01:00
Paul Eggleton 77742dd0c9 classes/insane: allow libdir QA check to be skipped using INSANE_SKIP
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].

(From OE-Core rev: 3bdbec1bdecc52828cbbf8108786ff076c981845)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-18 21:23:43 +01:00
Paul Eggleton 20d7b27b8f classes/insane: fix regression in libdir QA regex
There was a slight mistake in the recent change to the lib_re regex -
it still needs to begin with a /.

(From OE-Core rev: 194e47e6d8d9b9ee98e0203f0ebb574084277c46)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-18 21:23:43 +01:00
Mihai Prica 64745c27d2 insane.bbclass: Added QA warning for shipping /usr/share/info/dir
/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]

(From OE-Core rev: be93fa1d8fd601d95147980938217142c7d98c62)

Signed-off-by: Mihai Prica <mihai.prica@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-05 15:34:23 +01:00
Paul Eggleton 2f32ef9d1f classes/insane: fix libdir check regexes
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*.).

(From OE-Core rev: 391a361190d7da19ad3381121649a41a28516cb5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-05 15:34:22 +01:00
Paul Eggleton 80b2634304 classes/insane: remove la2 check which no longer exists from ERROR_QA
This check was actually removed a very long time ago in
6656381714, 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.

(From OE-Core rev: ff65497cd9a96d5ab49b16ba1f7e30a216ff4a42)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-28 16:33:08 +01:00
Christopher Larson d4a7820eee insane.bbclass: quiet package errors not in *_QA
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.

(From OE-Core rev: 8f5675e6d3eb8473f367de72d2d3d8a702011a47)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-11 15:55:59 +01:00
Robert Yang 829d6bf005 insane/package: refactor packaging sanity tests
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]

(From OE-Core rev: 2f117ee615b703db07d3274ac592e2bd653743dd)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 16:48:27 +01:00
Robert Yang 43713b9e17 insane/package: let package.bbclass inherit insane.bbclass
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]

(From OE-Core rev: 852dead71387c66ec0cba7c71e3814a74e409560)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 16:48:26 +01:00
Robert Yang 51c3e9df28 bbclass: bb.fatal() clean up
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]

(From OE-Core rev: 4c47525c5a171b1282615c9fbc7d84addef85f92)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-16 00:09:47 +03:00
Paul Eggleton 15aec44b2d classes/insane: add check for PN in OVERRIDES
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].

(From OE-Core rev: c331f0a5cac765174a1b5de5c12aec7e965d4158)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-10 11:37:16 +01:00
Richard Purdie 566628d8cd class/lib: Fix up various file access methods
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

(From OE-Core rev: a43e0a8ecd0441131e929daf998c3cd454d9c8f3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09 22:28:04 +01:00
Richard Purdie e1b5647d2c insane: Open file in binary mode
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.

(From OE-Core rev: 4f47b3a4726dd47e8a6db228fcaf25d1890e3e52)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09 14:06:51 +01:00
Richard Purdie c3d18afaa5 classes/recipes/lib: Fix various python whitespace issues
There are some left over tab characters in the python functions. This
removes them and resolves python 3 errors.

(From OE-Core rev: fafeb381c48291fa65c634c01c244843c8d7fad3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09 14:06:51 +01:00
Björn Stenberg 44120a053c ptest bug fixes
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.

(From OE-Core rev: 01bea4ef932e46eb2fcc8b4be7ff5e2b5b2a0978)

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-11 12:20:35 +01:00
Nathan Rossi 647caeb0fb insane.bbclass: Updated MicroBlaze machine definitions
* 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)

(From OE-Core rev: 0c60d3b04eb77629abc3bbc2a6d8a2b8f0a44309)

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-08 16:56:45 +01:00
Richard Purdie c446bbfa8d insane.bbclass: Add ALLOW_EMPTY to list of package specific variables
ALLOW_EMPTY should have a package specified so extend sanity checks to
cover it.

(From OE-Core rev: 02849a54d38c0b98db7ff6b52b4974ee0d88bfb4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05 13:14:59 +00:00
Kyle Farnsworth 22a5264311 insane.bbclass: Merge linux-gnu entries in machine dictionary and add sh4 machine.
(From OE-Core rev: 6e569c1aa66b2496b18d33803a18b99508152064)

Signed-off-by: Kyle Farnsworth <kyle@farnsworthtech.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-01 13:03:27 +00:00
Peter Seebach 593ee3698e siteinfo/insane: More n32 fixups
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.

(From OE-Core rev: 0c243a550f5a0e539823fe168bcc7b2bbb9f19e1)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-25 05:58:19 -08:00
Ross Burton 5dab6274b1 insane: remove unused variable
(From OE-Core rev: 1165a0b161ffc32258b0726e6ef3082d97dfb32a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-14 23:08:35 +00:00
Martin Jansa 56bc2bb95a insane.bbclass: Add missing R* variables to pkgvarcheck
* check also RSUGGESTS, RCONFLICTS, RPROVIDES, RREPLACES

(From OE-Core rev: 63d9926dde562fd2447fc26482745c3b6f232c12)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 14:44:49 +00:00
Richard Purdie 1e593e92d2 staging/insane.bbclass: Move legacy do_stage check iinto insane.bbclass
We might as well put all the sanity checks in one place.

(From OE-Core rev: 05be11c7508984cc4aa757becb7a8f47c5b7e919)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:12:59 +00:00
Richard Purdie 9244e4471d insane.bbclass: Add documentation headers for logical code blocks
(From OE-Core rev: ac24487a05834cc9c02a95bbd281927d98c5886e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:12:59 +00:00
Richard Purdie 61c51a1a49 insane.bbclass: Add pkgvarcheck to check for suboptimal usages of variables
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.

(From OE-Core rev: 316228948e65f376f6c5be13ccd0c964ea630edf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:12:59 +00:00
Richard Purdie 244f107c1f package: Create global package file list and use throughout PACKAGEFUNCS
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)

(From OE-Core rev: 5c7c8347eb1bc25d194be6f4be142ba0924e2600)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:02 +00:00
Lukas Bulwahn 3f1280da0a insane.bbclass: removing outdated comment
This commit removes an outdated comment that recorded an issue that has been
resolved in the commits 1c75a5df68 and
d2d5456cd3. Probably, the comment was missed
when changing the behavior in those commits.

(From OE-Core rev: fb1b51e902186b6a7d05e511fe3c3f03c10e3444)

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:00 +00:00
Richard Purdie 643bac1e97 insane.bbclass: Fix incorrect getVar call
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.

(From OE-Core rev: a8ba821d0002e4395fc5c80649fe14f93a7971fe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-30 14:09:09 +00:00
Philip Balister 7a7f9489d3 insane.bbclass : Disable tests for unsafe references in binaries and scripts.
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.

(From OE-Core rev: 2fb58da56e8e7044de21fd10fe9164d204587236)

Signed-off-by: Philip Balister <philip@balister.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-24 15:12:29 +00:00
Constantin Musca 86204fbc69 insane.bbclass: add qa package name check
Check if package names match the [a-z0-9.+-]+ regular
expression

[YOCTO #3139]

(From OE-Core rev: 55dd271be1aee21e36d130359f4f21841623c425)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-18 16:42:08 +00:00
Phil Blundell fa73df62c6 insane: detect and warn about relocations in .text
(From OE-Core rev: bc08838ddab0d16d889f81244529a0302a9240bc)

Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-12 13:36:39 +00:00
Robert Yang 51c7ad682f classes: replace virtclass-native(sdk) with class-native(sdk)
The overrides virtclass-native and virtclass-nativesdk are deprecated,
which should be replaced by class-native and class-nativesdk.

[YOCTO #3297]

(From OE-Core rev: 9fbeab63315fef0dbcc91c5e7051665764758a6e)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-02 16:18:27 +00:00
Peter Seebach 8d98171dc2 insane.bbclass and friends: Fix sanity checks and multlib headers for n32
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.

(From OE-Core rev: c8e8e8ba22eaa335ac72f0e5b317f804035133e2)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-27 09:44:56 +01:00
Ross Burton 2df8db417d insane: add a check for Xorg driver ABI dependencies
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.

(From OE-Core rev: 800b256390b22c3d3d8d6a69f6fb668376a5030b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-23 12:28:32 +01:00
Phil Blundell 0fd014eada insane: Don't try to run objdump on symlinks
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.

(From OE-Core rev: 91769af1c1175ac9bb43d16d05fb1c8736dd9287)

Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18 12:13:49 +01:00
Phil Blundell f8c90bce73 insane: Rationalise phdrs-based QA checks
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.

(From OE-Core rev: bf19eeb9f65e91bf2b5d89e7c0b099c55d7c15ff)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18 12:13:49 +01:00
Saul Wold a6052d6e77 insane.conf: add new libexec test
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]

(From OE-Core rev: 4c60c2779dde6962f342f9c9b61713cf2d3a564c)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18 12:13:41 +01:00
Marcin Juszkiewicz 72188f5b8d insane.bbclass: add AArch64 support
(From OE-Core rev: 39d71c8c41276091688decb64d418e1e3637e2b6)

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18 12:13:37 +01:00
Richard Purdie 5fdbda6922 classes: Update to use corrected bb.utils.explode_dep_versions2 API
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>]

(From OE-Core rev: 16a892431d0c0d03f8b561b92909cf2f11af4918)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-02 11:40:53 +01:00
Richard Purdie 0bfb2094e3 insane.bbclass: Remove copy and paste confusion when using OVERRIDES
People keep copying this code and its confusing and unnecessary. Remove the
bad examples to try and stop this happening.

(From OE-Core rev: 48aa4b00cfb7f01195c6d20b7ba660715fe792ef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-02 11:40:52 +01:00
Richard Purdie 30b7781650 insane.bbclass: Improve ability to detect enabled tests
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.

(From OE-Core rev: 069992a502658e8e44b870601e2e189cd9596ec9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-21 11:17:47 +01:00
Radu Moisan 65d1eb7788 insane.bbclass: add library dir sanity check
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]

(From OE-Core rev: 534fa3a55de19f249583207aaeec58fec8154a1d)

Signed-off-by: Radu Moisan <radu.moisan@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-21 11:17:47 +01:00
Paul Eggleton 272cb74d70 Rename task to packagegroup
"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.

(From OE-Core rev: 424dcf7046e4ad09dcc664eb1992201195247fcf)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-04 12:52:55 +01:00
Richard Purdie ad23395cd1 nativesdk: Switch to using nativesdk as a prefix, not a suffix
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.

(From OE-Core rev: 81813c0e322dc04ce4b069117188d8a54dfddb8c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-02 05:52:06 -07:00
Andy Ross 40d3579ced insane.bbclass: Fix RPATH warning in the face of funny path strings
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.

(From OE-Core rev: 72a924d0686389d648338efd3f675fc85ee2d181)

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21 12:15:30 +01:00