Commit Graph

241 Commits

Author SHA1 Message Date
Ross Burton 2c3e0bb792 insane: consider INSANE_SKIP without package-specifier too
this is needed for the updated linux-firmware as it needs this INSANE_SKIP support

(From OE-Core rev: 618093c6b7c919f25094f56b82610bee7c97f99f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
(cherry picked from commit 604939186cc08ab0429ebe00f3e32661847f0cf0)

Adjusted for pyro context
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-20 22:52:58 +00:00
Peter Kjellerstedt 6c17b29db1 insane.bbclass: Ignore perl as dependency for nativesdk packages
(From OE-Core rev: 33d79cb5d35274e2925d8acb0f30530013e37545)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31 17:57:12 +01:00
Peter Kjellerstedt b539afa655 insane.bbclass: Improve the handling of runtime file dependencies
This makes the file-rdeps test support:
* versioned dependencies, e.g., "perl (>= 5.000)", and
* package dependencies among the file dependencies, e.g., "perl".

It also ignores all "perl(...)" dependencies since it is expected that
these are generated and handled by rpm itself and there is no reason
to second guess what it is doing.

(From OE-Core rev: 6d64b110ed0c22f2bcd10cde437a13e03c15b23e)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31 17:57:11 +01:00
Peter Kjellerstedt 9d33b246ca insane.bbclass: Report all file-rdeps errors, not just the first
(From OE-Core rev: ee6f208a780062365e53fb9546eef55749e1c654)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31 17:57:11 +01:00
Gan Yau Wai b4ea7bfad6 insane.bbclass: fix override handling in RDEPENDS QA
The package_qa_check_rdepends() in insane.bbclass has
incorrectly replace its localdata OVERRIDES value with
the package name. Fixing it by appending the package name
to the existing OVERRIDES value. This resolves RDEPENDS QA
error when setting PACKAGECONFIG using a pn- override at
local.conf.

Cherry picked from master 60d28dd72daee235150ab6605cbf953f1ea691df

[YOCTO #11374]

(From OE-Core rev: ca84390b7894adb32a89ccfbd83fbb3fb7e808fc)

Signed-off-by: Gan Yau Wai <yau.wai.gan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-29 11:57:29 +01:00
Stephano Cetola b907e25fd9 insane.bbclass: error if file-rdeps not met
Missing runtime dependencies should result in an error rather than a
warning. Indeed, if RPM is listed in PACKAGE_CLASSES, it will throw
an error rather than install packages with missing dependencies. This
functionality should be consistent across package types. This patch
ensures that an error will be thrown.

[YOCTO #10949]

(From OE-Core rev: 90bc7bfa1b27cd5ea2480463f7631f179a296b10)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:43:13 +01:00
Ross Burton 3a1e31d714 insane: remove broken unsafe-references-in-binaries test
This test aims to detect binaries in /bin which link to libraries in /usr/lib,
for the case where the user has /usr on a separate filesystem to /.

However it doesn't scan both image/ and the sysroot, so if a binary in /bin
links to a library in /usr/lib that was built by the same recipe then it will
error out.

This test isn't enabled by default, and because of this serious bug I suspect
nobody else is enabling it either.  As /usr being on a separate partition to /
is a very rare configuration these days I think we should delete the test: if
someone cares sufficiently they should write a test that actually works.

(From OE-Core rev: a6af5bbf3dad6f0951c67a0aae13ef86a8906893)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:21 +00:00
Mariano Lopez f786def0ec insane.bbclass: Add missing dependencies
package_qa task requires some tools installed in sysroot; with
the introduction of recipe specific sysroot this task won't
have such tools installed if it's forced to run.

(From OE-Core rev: cf351eb49c44d9cbba82392f3331e7cba0c0d0ee)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:10 +00:00
Stephano Cetola 2c74929555 insane.bbclass: print QA message correctly
Replace call to non-existent method "messages" with call to correct
QA logging method.

Fixes [YOCTO #11014]

introduced in OE-core revision 1dcb38ca9d6

(From OE-Core rev: 7f3e6d7ce94659447e1b1cdcb2440305581c8cbb)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:40 -08:00
Richard Purdie bfd0a39bdf classes: Drop now unneeded update_data calls
Now that the datastore works dynamically we don't need the update_data calls
so we can just remove them. They're not actually done anything at all for
a while.

(From OE-Core rev: 8de0c5d3bd01919e2bf0394f9c485936d6098cec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:55 -08:00
Richard Purdie 9107d6ca14 Switch to Recipe Specific Sysroots
This patch is comparatively large and invasive. It does only do one thing, switching the
system to build using recipe specific sysroots and where changes could be isolated from it,
that has been done.

With the current single sysroot approach, its possible for software to find things which
aren't in their dependencies. This leads to a determinism problem and is a growing issue in
several of the market segments where OE makes sense. The way to solve this problem for OE is
to have seperate sysroots for each recipe and these will only contain the dependencies for
that recipe.

Its worth noting that this is not task specific sysroots and that OE's dependencies do vary
enormously by task. This did result in some implementation challenges. There is nothing stopping
the implementation of task specific sysroots at some later point based on this work but
that as deemed a bridge too far right now.

Implementation details:

* Rather than installing the sysroot artefacts into a combined sysroots, they are now placed in
  TMPDIR/sysroot-components/PACKAGE_ARCH/PN.

* WORKDIR/recipe-sysroot and WORKDIR/recipe-sysroot-native are built by hardlinking in files
  from the sysroot-component trees. These new directories are known as RECIPE_SYSROOT and
  RECIPE_SYSROOT_NATIVE.

* This construction is primarily done by a new do_prepare_recipe_sysroot task which runs
  before do_configure and consists of a call to the extend_recipe_sysroot function.

* Other tasks need things in the sysroot before/after this, e.g. do_patch needs quilt-native
  and do_package_write_deb needs dpkg-native. The code therefore inspects the dependencies
  for each task and adds extend_recipe_sysroot as a prefunc if it has populate_sysroot
  dependencies.

* We have to do a search/replace 'fixme' operation on the files installed into the sysroot to
  change hardcoded paths into the correct ones. We create a fixmepath file in the component
  directory which lists the files which need this operation.

* Some files have "postinstall" commands which need to run against them, e.g. gdk-pixbuf each
  time a new loader is added. These are handled by adding files in bindir with the name
  prefixed by "postinst-" and are run in each sysroot as its created if they're present.
  This did mean most sstate postinstalls have to be rewritten but there shouldn't be many of them.

* Since a recipe can have multiple tasks and these tasks can run against each other at the same
  time we have to have a lock when we perform write operations against the sysroot. We also have
  to maintain manifests of what we install against a task checksum of the dependency. If the
  checksum changes, we remove its files and then add the new ones.

* The autotools logic for filtering the view of m4 files is no longer needed (and was the model
  for the way extend_recipe_sysroot works).

* For autotools, we used to build a combined m4 macros directory which had both the native and
  target m4 files. We can no longer do this so we use the target sysroot as the default and add
  the native sysroot as an extra backup include path. If we don't do this, we'd have to build
  target pkg-config before we could built anything using pkg-config for example (ditto gettext).
  Such dependencies would be painful so we haven't required that.

* PKDDATA_DIR was moved out the sysroot and works as before using sstate to build a hybrid copy
  for each machine. The paths therefore changed, the behaviour did not.

* The ccache class had to be reworked to function with rss.

* The TCBOOTSTRAP sysroot for compiler bootstrap is no longer needed but the -initial data
  does have to be filtered out from the main recipe sysroots. Putting "-initial" in a normal
  recipe name therefore remains a bad idea.

* The logic in insane needed tweaks to deal with the new path layout, as did the debug source
  file extraction code in package.bbclass.

* The logic in sstate.bbclass had to be rewritten since it previously only performed search and
  replace on extracted sstate and we now need this to happen even if the compiled path was
  "correct". This in theory could cause a mild performance issue but since the sysroot data
  was the main data that needed this and we'd have to do it there regardless with rss, I've opted
  just to change the way the class for everything. The built output used to build the sstate output
  is now retained and installed rather than deleted.

* The search and replace logic used in sstate objects also seemed weak/incorrect and didn't hold
  up against testing. This has been rewritten too. There are some assumptions made about paths, we
  save the 'proper' search and replace operations to fixmepath.cmd but then ignore this. What is
  here works but is a little hardcoded and an area for future improvement.

* In order to work with eSDK we need a way to build something that looks like the old style sysroot.
  "bitbake build-sysroots" will construct such a sysroot based on everything in the components
  directory that matches the current MACHINE. It will allow transition of external tools and can
  built target or native variants or both. It also supports a clean task. I'd suggest not relying on
  this for anything other than transitional purposes though. To see XXX in that sysroot, you'd have
  to have built that in a previous bitbake invocation.

* pseudo is run out of its components directory. This is fine as its statically linked.

* The hacks for wayland to see allarch dependencies in the multilib case are no longer needed
  and can be dropped.

* wic needed more extensive changes to work with rss and the fixes are in a separate commit series

* Various oe-selftest tweaks were needed since tests did assume the location to binaries and the
  combined sysroot in several cases.

* Most missing dependencies this work found have been sent out as separate patches as they were found
  but a few tweaks are still included here.

* A late addition is that extend_recipe_sysroot became multilib aware and able to populate multilib
  sysroots. I had hoped not to have to add that complexity but the meta-environment recipe forced my
  hand. That implementation can probably be neater but this is on the list of things to cleanup later
  at this point.

In summary, the impact people will likely see after this change:

* Recipes may fail with missing dependencies, particularly native tools like gettext-native,
  glib-2.0-native and libxml2.0-native. Some hosts have these installed and will mask these errors

* Any recipe/class using SSTATEPOSTINSTFUNCS will need that code rewriting into a postinst

* There was a separate patch series dealing with roots postinst native dependency issues. Any postinst
  which expects native tools at rootfs time will need to mark that dependency with PACKAGE_WRITE_DEPS.

There could well be other issues. This has been tested repeatedly against our autobuilders and oe-selftest
and issues found have been fixed. We believe at least OE-Core is in good shape but that doesn't mean
we've found all the issues.

Also, the logging is a bit chatty at the moment. It does help if something goes wrong and goes to the
task logfiles, not the console so I've intentionally left this like that for now. We can turn it down
easily enough in due course.

(From OE-Core rev: 809746f56df4b91af014bf6a3f28997d6698ac78)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Patrick Ohly 1f6e6455fe insane.bbclass: print license text as part of QA message
It it is hard to select exactly the right lines from a file, in
particular because the documentation did not specify the exact
semantic (YOCTO #10898).

When the QA license check fails, it now includes the license text for
which the md5sum was calculated. When adding a new entry to
LIC_FILES_CHKSUM, developers can then verify that they picked the
desired lines. When the checksum of an older entry changes, the developer
does not have to manually look up the changed text.

Here's an example which probably has an endline which is too large
(message triggered by changing the md5sum in the recipe):

ERROR: cmake-native-3.7.1-r0 do_populate_lic: QA Issue: cmake-native: The LIC_FILES_CHKSUM does not match for file://Source/cmake.h;beginline=1;endline=3;md5=deadbeef
cmake-native: The new md5 checksum is 4494dee184212fc89c469c3acd555a14
cmake-native: Here is the selected license text:
vvvvvvvvvvvvvvvvvvvvvvvvvvvv beginline=1 vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ endline=3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cmake-native: Check if the license information has changed in .../cmake.h (lines 1 through to 3) to verify that the LICENSE value "BSD" remains valid [license-checksum]

The beginline/endline values are only repeated in the borders if set.

License snippets larger larger than 20 lines (configurable with
QA_MAX_LICENSE_LINES) are truncated in the middle.

(From OE-Core rev: b5b869348adc8e932eb58ecdfdff93d1d63e775c)

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>
2017-01-16 18:05:13 +00:00
Richard Purdie 022a8b58c8 meta/scripts: Various getVar/getVarFlag expansion parameter fixes
There were a few straggling expansion parameter removals left for
getVar/getVarFlag where the odd whitespace meant they were missed
on previous passes. There were also some plain broken ussages such
as:

d.getVar('ALTERNATIVE_TARGET', old_name, True)
path = d.getVar('PATH', d, True)
d.getVar('IMAGE_ROOTFS', 'True')

which I've corrected (they happend to work by luck).

(From OE-Core rev: 688f7a64917a5ce5cbe12f8e5da4d47e265d240f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Zubair Lutfullah Kakakhel 6eb35af19a arch-mips: Add MIPS 64r6 N32 tune
Add MIPS64R6-n32 tuning options.

(From OE-Core rev: e723dbb9614f7d7e7e158bc9afd0b2bfac0fbee2)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22 08:50:16 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Vladimir Zapolskiy 56b4aa820c insane: Add SH4 musl mapping to the QA arch tests
This change allows to pass QA for packages built with sh4-oe-linux-musl
toolchain, the problem is reproted while building core-image-minimal target:

  ERROR: readline-7.0-r0 do_package_qa:
  Error executing a python function in exec_python_func() autogenerated

(From OE-Core rev: dff25cb16ffca0876e5a747644bd6223129df402)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:30 +00:00
Ross Burton bfcf8770d0 insane: rewrite the expanded-d test as a QAPKGTEST
Instead of being executed for every file in every package, this is now just
called for each package.  It is also now correctly called for packages which
don't have any content but do have postinst scripts.

[ YOCTO #10711 ]

(From OE-Core rev: afda72b2424528eaff9054327530bdf5654bec66)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:07 +00:00
Ross Burton b8f0acf70d insane: add QAPKGTEST, a package-wide equivilant to QAPATHTEST
QAPATHTEST defines a function that is executed for every file in every package.
For tests which just need to look at the datastore this is massive overkill.

Add QAPKGTEST, which is invoked for each package in the recipe.

(From OE-Core rev: acc3cc26099c77e4eeb44c75bc7167ab58ef1147)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:07 +00:00
Ross Burton 4a7a2b4777 insane: factor out the test matrix processing
Pull the test matrix processing out as a function so it can be reused.

(From OE-Core rev: 3caccd3f6079b7e284d32e1eb0217107425e7bf8)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:07 +00:00
Ross Burton 56d3c77ebe insane: fix expanded-d test
This test should be looking for the expanded value of ${D} in the expanded value
of pkg_postinst and so on, but one of the getVar() calls was passing
expand=False so the test would never be true.

(From OE-Core rev: cc545044cba51317bee32e3bf674723e422e3a8a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:07 +00:00
Alexandre Belloni 20020cb1d5 insane: Add aarch64 baremetal mappings to the QA arch test
Add mappings for aarch64-elf and aarch64_be-elf to binary lookup table
which allows for the generation of baremetal toolchains.

(From OE-Core rev: e90a1c4b8fd7baa738eb4683e5eac60905e04296)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:06 +00:00
Robert Yang 970436f546 insane.bbclass:buildpaths: open() file with 'rb'
open() is default to 'rt' which may cause decoding errors when open
binary file:
$ bitbake xcursor-transparent-theme
[snip]
Exception: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfd in position 18: invalid start byte
[snip]

(From OE-Core rev: ddbab61f47efd9b4fde38ef8f0f3482c78abe37c)

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-11-06 23:35:33 +00:00
Robert Yang 901e632a49 insane.bbclass: fix package_qa_check_arch() for mips64-o32
Fixed:
MACHINE = "qemumips64"
DEFAULTTUNE = "mips64-o32"

$ bitbake linux-yocto
ERROR: linux-yocto-4.8+gitAUTOINC+03bf3dd731_674818dad5-r0 do_package_qa: QA Issue: Bit size did not match (32 to 64) linux-yocto on
    /work/qemumips64-poky-linux/linux-yocto/4.8+gitAUTOINC+03bf3dd731_674818dad5-r0/packages-split/kernel-module-parport/lib/modules/4.8.0-yocto-standard/kernel/drivers/parport/parport.ko [arch]

The mips64-n32 works since it would set ABIEXTENSION to "n32" so that
TARGET_OS is linux-gnun32, and it will skip the check, but "mips64-o32"
doesn't set ABIEXTENSION to "o32", "n32" or "32", so the error happend.

Skip the check if mips64.*32 matches DEFAULTTUNE can fix the problem.
Another way to fix the problem is define ABIEXTENSION to "o32" or "32"
for mips64-o32, but that may make things confused since "o32" is purely
32 bit.

[YOCTO #10305]

(From OE-Core rev: 4e61d8d6f4619dbfaeb5ca642449de7cf4b3e92d)

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-10-15 10:01:44 +01:00
Juro Bystricky a35493d0fc insane.bbclass: Additional "mips" and "mipsel" machine definitions
Add "mips" and "mipsel" to "machdata" table.
Although there is a way to add entries to the "machdata" table
from a BSP without modifying the insane.bbclass directly, MIPS is
already supported in poky and as such the relevant entries should be
present in insane.bbclass.

(From OE-Core rev: 3ba03d1affa6f647e9a03c8ba4389606a0da8e8b)

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>
2016-10-15 10:01:43 +01:00
Ross Burton a003a929d0 insane: display names instead of ELF machine numbers
The 'arch' QA test currently simply outputs the ELF machine field as a number
which isn't helpful.  Display this as a human-readable name to make it clearer
to the user what the problem is.

(From OE-Core rev: 607a2a1de4b77818c3e801a4de7ff0888229e036)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 22:19:21 +01:00
Zubair Lutfullah Kakakhel 4ec02b3e54 insane.bbclass: Add mipsisa{32, 64}r6{el, }
Add support for MIPS release 6 of the ISA

(From OE-Core rev: 6613ee0155de1e0afd30cd8d8290eda3f7486337)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
Ross Burton cfe4112347 sanity: make license QA failures fatal again
Previous work to clean up the license QA code (oe-core fbdf977) had the side
effect that failing the license sanity check (bad or missing LIC_FILES_CHKSUM)
would emit an error message but wouldn't actually abort the build.

Solve this by changing populate_lic_qa_checksum() so that it tracks if the
message class was in ERROR_QA and if so, aborts the function.

[ YOCTO #10280 ]

(From OE-Core rev: 5ba1a7505b904a4aa2118fa9614d76df97597af8)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-16 15:24:02 +01:00
Ross Burton edec1c4e1d insane: improve package_qa_clean_path
Instead of just removing TMPDIR from the path for display, optionally allow a
package to be passed and remove PKGDEST/package too.

This means that messages that specify a package name can pass that name and the
resulting path will be absolute inside that package.

(From OE-Core rev: 55061a43926baf6ff0e17aed02efd299ebba3c24)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-23 17:44:40 +01:00
Ross Burton 7d04a4dbfd insane: only check ${S} exists if we had sources to fetch
Only check that ${S} actually exists if there was something in ${SRC_URI} to
fetch, the argument being that if SRC_URI is empty the the recipe won't be using
${S} at all.

In general recipes that have no sources can remove the unpack task, but
expecting all recipes to do this relatively advanced operation isn't realistic.

(From OE-Core rev: 8cba511ab6ea557fab9f7838dfe1fc8284bbdd68)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
Richard Purdie e693f2e641 insane: Add mechanism to extend QA machine information from BSP layer
In order to add a new architecture or sub-architecture to OE, you currently
need to tweak the table in insane.bbclass. This adds a mechanism so this
can be done from a BSP layer. It needs a function definition which needs
a class file but can then be done with something like:

def my_testfunc(machdata, d):
    machdata["testmachine"] = {
                        "test64":       ( 8,     0,    0,          False,         32),
                        "testel":     ( 8,     0,    0,          True,          32),
                      }
    return machdata

PACKAGEQA_EXTRA_MACHDEFFUNCS = "my_testfunc"

[YOCTO #8554]

(From OE-Core rev: c57550c9cca598315ba4408e44b138cecc22b8a0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:25 +01:00
Richard Purdie a7309d5790 classes/lib: Update to use python3 command pipeline decoding
In python3, strings are unicode by default. We need to encode/decode
from command pipelines and other places where we interface with the
real world using the correct locales. This patch updates various
call sites to use the correct encoding/decodings.

(From OE-Core rev: bb4685af1bffe17b3aa92a6d21398f38a44ea874)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:00 +01:00
Martin Jansa 37688b329e insane: return line-feeds to qa.log
(From OE-Core rev: f97c40fd6cf0a722c5355623e0392755cb0a0107)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:38:43 +01:00
Richard Purdie 88972114a6 meta/scripts: python3: rename file -> open
file() API doesn't exist in python 3, convert to open(). Also handle
some cases where files aren't closed. Compatible with python 2.7.

[Contributions from Ed and Richard]

(From OE-Core rev: 0f4ec13e11bb8abe21aba2a28547dfb9372bc377)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21 22:26:33 +01:00
Paul Eggleton 296c7e11f1 classes/insane: do not force LIC_FILES_CHKSUM unless SRC_URI is set
Recipes such as images and packagegroups don't actually fetch or build
any source, so there's really no point having LIC_FILES_CHKSUM set.
Forcing users to set it (as we have done for images inheriting
image.bbclass) just makes things more difficult for the user for no
discernable benefit. The easiest way to adjust this check is simply to
skip it if SRC_URI is not set since this is a pretty good indicator that
no source is being pulled in.

(From OE-Core rev: c269547ae8e90a78349f6003385137e4145e145f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:33:42 +01:00
Robert Yang a8b35766d4 insane.bbclass: package_qa_check_license -> populate_lic_qa_checksum
The package_qa_check_license() was in do_qa_configure which had a
potential problem, when the recipe sets do_configure[noexec] = "1", then
the license checking won't run, which may hidden license issues. Rename
it to populate_lic_qa_checksum() and run in do_populate_lic[postfuncs] which
is more reasonable (when no populate license, no license checking).

(From OE-Core rev: b7811bbec1ba373d62ace5c4fc56918e53c69d50)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:16 +01:00
Robert Yang 0bf6d578b4 insane.bbclass: remove workdir from package_qa_check_license()
The parameter workdir is not used in package_qa_check_license()

(From OE-Core rev: 9da177c149c657dc337a1f0d241175f1496fa07d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:14 +01:00
Bill Randle a2bf9e39b6 insane.bbclass: avoid false positives on library location
package_qa_check_libdir() reports that the file libsoletta.so.0.0.1-gdb.py
in /usr/share/gdb/auto-load is in the wrong location. Before generating
a warning for files in non-standard locations, check that the file is an
actual elf file (and hence a real library file).

[YOCTO #9215]

(From OE-Core rev: a3ad36b9a435e7c3d97f114809561198b8abe6cf)

Signed-off-by: Bill Randle <william.c.randle@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:51:36 +01:00
Richard Purdie 0b84897ea8 insane/prelink: Handle nonstandard library paths
Prelink contains some hardcoded assumptions about the path layout of
the target system. Unfortunately if the system doesn't match, prelink
doesn't work. This breaks:

a) prelink of those images
b) the unsafe-references-in-binaries QA test (which uses prelink-rtld)

One way to work around this is to construct an ld.so.conf file which
lists the library paths in question. We do this in sanity QA check and
in the rootfs prelink code, being careful not to trample any existing
target ld.so.conf.

There is an additional problem that $LIB references in RPATHs won't be
handled correctly, I've not see any system use these in reality though
so this change at least improves things.

(From OE-Core rev: 7fd1d7e639c2ed7e0699937a5cb245c187b7c811)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 00:11:39 +00:00
Chen Qi 4284fdfe5e insane.bbclass: make the checking stricter for unsafe references in scripts
Previously, the checking for unsafe references is not strict enough. It
only checks whether '/usr/' is in the script. As a result, any script
containing statements like below will match this check.

	   PATH="/bin:/sbin:/usr/bin:/usr/sbin"

However, as we can see, this is actually not an unsafe reference. What
we really want to check is something like '/usr/bin/tail', so we should
make the checking stricter.

This patch solves the QA warning in gzip and nfs-utils.

(From OE-Core rev: f818f7359c1a5db2c5c041c42eecb9f0434d9800)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 00:11:37 +00:00
Ross Burton 4495e8bae0 lib/oe/qa: add explicit exception for 'file isn't an ELF'
(From OE-Core rev: 4c1fe0cbcb98b0a69ad5b3a04432055d773ee4ba)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:32:59 +00:00
Robert Yang 8bcf139150 insane.bbclass: print more info for build-deps and file-rdeps
This is useful for oe newbie:
* build-deps: print recipe name, and suggest fixing from DEPENDS or
  PACKAGECONFIG, for example:
  WARNING: QA Issue: patch rdepends on libattr, but it isn't a build dependency, missing attr in DEPENDS or PACKAGECONFIG? [build-deps]

* file-rdeps: print RDEPENDS_pkg rather than RDEPENDS, for example:
  WARNING: QA Issue: /sbin/osd_login contained in package nfs-utils requires /bin/bash, but no providers found in RDEPENDS_nfs-utils? [file-rdeps]

Fix a bug in file-rdeps, there was "@underscore@" in file-rdeps:
WARNING: QA Issue: /sbin/osd@underscore@login_nfs-utils contained in [snip]

[YOCTO #8922]
[YOCTO #8847]

(From OE-Core rev: f8754281451bbb64c3d26bbdbf1e596271534469)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 01:01:25 +00:00
Ross Burton f770a6e0c2 insane: wrap autotools checks in inherits_class(autotools) checks
There's no point doing the autotools sanity checks if a recipe didn't inherit
autotools, so check the inherits before doing the checks.

Also pass -F (fixed strings) and -q (quiet) to grep.

(From OE-Core rev: 75ae572427d9cd3f0b3e9e7d4d0e7a93a4f04690)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:39:30 +00:00
Ross Burton 7a700f59d9 lib/qa.py: raise ValueError if file isn't an ELF
Instead of raising a generic Exception that can't be handled specifically, raise
a ValueError.  Also update the callers so any unexpected exceptions are not
ignored.

Also, rename isBigEngian() to isBigEndian().

(From OE-Core rev: c136652f9c0b35aafa393e63567daf029ae03929)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-16 11:17:10 +00:00
Richard Purdie ce0f8ab3b4 insane: Add --disable-static to UNKNOWN_CONFIGURE_WHITELIST
With the addition of a common class passing in this option, add it to
the list of standard "unknown" configure options which are known about.
Its not interesting/productive to go and update every recipe to handle
this flag.

(From OE-Core rev: f879f452dc69989aa227b8dc60b7cb0354203575)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15 16:28:45 +00:00
Nathan Rossi d7faf673a4 insane.bbclass: Support MicroBlaze with musl
MicroBlaze is supported by musl, add entries for the 3 variants.

(From OE-Core rev: 1c4a5dbcc738434bbd31f41c99e8acc72655839e)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11 12:27:47 +00:00
Richard Purdie 86851d543b insane: Fix populate_sysroot sanity test path
This was correct for native/cross paths but not for target ones which
meant the tests weren't running in some cases. Fix the path to be
correct in both cases.

(From OE-Core rev: 3739aaf644d5a0f28e85fd07c67cecbfa5b8fb8a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04 23:40:23 +00:00
Ross Burton 70ec8671ec insane: add test for -dev packaging containing real libraries
PN-dev packages should generally contain the link-time symlinks from libfoo.so
to the real libraries.  If a recipe installs a real library named libfoo.so
there's a very good chance that it's a loadable module and should be in another
package.

(From OE-Core rev: 47d38d4d86ec6a8c143603ef4d0f056f5a5d9ceb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-02 14:44:17 +00:00
Ross Burton 4ead707b6c insane: remove unused variable assignment
(From OE-Core rev: 6b3cfcf90a0eb51356318f197faf6db4dc06a3e9)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26 22:31:59 +00:00
Richard Purdie 4833bee9fb insane: Drop do_stage test
do_stage was obsoleted years ago, drop the test now.

(From OE-Core rev: 59360521880a6ffbf893235bdc556533fab0a152)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:34 +00:00
Robert Yang eb418c37ce insane.bbclass: fix package_qa_walk()
The parameter "path" would be redefined inside package_qa_walk() which
is useless,  so remove it.

(From OE-Core rev: b07d06d02cb675f5ed00ebe603441254f5671088)

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