Commit Graph

352 Commits

Author SHA1 Message Date
Peter Kjellerstedt 160c4fd9ae bitbake.conf: Add HOSTTOOLS_DIR for ${TMPDIR}/hosttools
The path to where to install and find the tools copied from the host
environment is already used in a couple of places. This warrants it to
get its own variable.

(From OE-Core rev: 8164c466943ffedff399009bf5547dba4f06d6c8)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-01 08:56:35 +01:00
Ross Burton 2a934a3df7 base.bbclass: ensure HOSTTOOLS links point to executables
Use the new executable argument to bb.utils.which() to ensure that the symlinks
point to executable files and not for example directories with the right name
which happened to be on $PATH.

[ YOCTO #11256 ]

(From OE-Core rev: 7f40c934c3aeb1d34f95f30b281e25a17c428fce)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-31 10:10:29 +01:00
Paul Eggleton 8aebe890fd classes/base: reformat HOSTTOOLS error
Adjust the message slightly to make it clearer, in particular mentioning
the HOSTTOOLS variable.

(From OE-Core rev: e022b27d189c1dcc7b3baea2b99dba8d724e6e2b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-16 22:11:32 +00:00
Richard Purdie 94790a8254 base/bitbake.conf: Filter contents of PATH to only allow whitelisted tools
We currently have a determinism problem in that the host tools present
in PATH can influence the build. In particular, the presence of pkg-config
on the build host can mask missing pkgconfig class dependencies.

This adds in a new HOSTTOOLS variable and then uses it to set up a directory
of symlinks to the whitelisted host tools. This directory is placed as PATH
instead of the usual /usr/bin:/bin and so on.

This should improve determinism of builds and avoid the issues which have
been particularly obvious since the introduction of recipe specific sysroots.

If users find there is a tool missing, they can extend HOSTTOOLS from a global
class or global conf file.

Right now the settings should be enough to build everything in OE-Core.

(From OE-Core rev: fa764a403da34bb0ca9fa3767a9e9dba8d685965)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-11 16:09:14 +00:00
Andre McCurdy b41e1c9209 base.bbclass: improve wording when skipping recipes with incompatible licenses
The previous wording, e.g.

  ERROR: wget was skipped: incompatible with license GPLv3

isn't very clear and could be taken to imply that the recipe is
incompatible with its own license.

(From OE-Core rev: c2047067daadb40ff3a944f380c10b2a56b8e080)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-08 11:52:56 +00:00
Joshua Watt 8d8d0a52d5 base.bbclass: Fix OE_IMPORTS
Udpate OE_IMPORTS to include oe.license because it is being used.

(From OE-Core rev: d0902a5c3babbd3b291fa494462e083794ca4bee)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.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
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
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
Paul Eggleton 5942a8dc7c classes/base: fix license file checksumming when source not under TMPDIR
With the changes to the code for extracting source for a recipe, we are
properly executing the tasks for a recipe, which means their stamps (and
therefore signatures) are important. When running devtool extract on
the lsof recipe I noticed that do_fetch and do_unpack were executing a
second time when we called for do_patch, and this turned out to be
because LIC_FILES_CHKSUM in that recipe contains an entry which
is an absolute path (has ${S} at the start). Normally this wouldn't be
an issue since S is under TMPDIR and thus the existing code would ignore
it, however devtool's extraction code extracts to a temporary directory
which is not under TMPDIR; the result was the path to this file was not
being ignored and the second time around when the license file had been
extracted it was incorporated into the signature. We don't want this, so
explicitly exclude S as well as B and WORKDIR for good measure.

(From OE-Core rev: 1c99d74a862f25e23ea6465fab7ddc9ce74d6974)

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>
2016-12-14 12:30:49 +00:00
Ulf Magnusson 4359ef0895 base.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 9635af9785509a39c1ac2509740d46276119a0ca)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Juro Bystricky cf882b6e3a SDK: Allow changing SDKMACHINE without wiping TMP folder
When changing SDKMACHINE, we may encounter an error forcing us to wipe the TMP folder.
Since only SDK_ARCH is captured in the PN of the crosssdk recipes, changes to SDK_OS
result in conflicts. Eventually we hit the error:

ERROR: ...: The recipe <...>  is trying to install files into a shared area when those files already exist.
The build has stopped as continuing in this scenario WILL break things

This patchset addresses the problem by SDK_SYS as the recipe name suffix instead
of SDK_ARCH.

[YOCTO #9281]

(From OE-Core rev: d2eccccb70e809d482c493922f23aef4409cfd82)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:03 +01:00
Richard Purdie 7358cbf36b base.bbclass: Drop unnecessary dirs setting
${D} is listed in cleandirs so no need to list it in dirs as well.
The default directory is ${B} so this is a cleanup which should have
no changes to the execution.

[YOCTO #10017]

(From OE-Core rev: 7e0f95bf359bc3b5bb1578024a993e184de155cd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-22 11:13:24 +01:00
Robert Yang 02e6c1e520 meta: cleanup d.getVar(var, 0)
(From OE-Core rev: 33b0d940b09a5ce1462476614213a58d3d62e80d)

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-09-14 22:22:07 +01:00
Martin Jansa 8dcb8da9e3 base, autotools: Append PACKAGECONFIG_CONFARGS to EXTRA_OECONF only in autotools.bbclass
* recipes which don't inherit autotools or cmake bbclass and want to
  use the configure options from PACKAGECONFIG need to handle
  PACKAGECONFIG_CONFARGS themselves.

(From OE-Core rev: c98fb5f5129e71829ffab4449b3d28082bc95ab4)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03 09:58:39 +01:00
Markus Lehtonen 988f77af3e license: simple verification of LICENSE_<pkg> values
LICENSE should be a superset of all LICENSE_<pkg> values. That is,
LICENSE should contain all licenses and LICENSE_<pkg> can be used to
"filter" this on a per-package basis. LICENSE_<pkg> shouldn't contain
anything that isn't specified in LICENSE.

This patch implements simple checking of LICENSE_<pkg> values. It does
do not do advanced parsing/matching of license expressions, but,
checks that all licenses mentioned in LICENSE_<pkg> are also specified in
LICENSE. A warning is printed if problems are found.

(From OE-Core rev: 0f4163a12ea431d0ba6265880ee1e557333d3211)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-25 22:54:49 +01:00
Markus Lehtonen a56fb90dc3 base.bbclass wipe ${S} before unpacking source
Make sure that we have a pristine source tree after do_unpack.

[YOCTO #9064]

(From OE-Core rev: eccae514b71394ffaed8fc45dea7942152a334a1)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:24 +01:00
Andrew Bradford 40f3099e8e base.bbclass: p4 fetcher supports srcrev
Enable the perforce fetcher to call bb.fetch2.get_srcrev() as it can use
'SRCREV = "${AUTOREV}"'.

(From OE-Core rev: 9d6ac71e4d954d857ecb1708ab4fe4bc552244aa)

Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-17 17:08:25 +01:00
Richard Purdie 3b39971748 classes/lib: Complete transition to python3
This patch contains all the other misc pieces of the transition to
python3 which didn't make sense to be broken into individual patches.

(From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:01 +01:00
Richard Purdie 3ddde5f32a meta: Update to modern exception syntax
Update older exception syntax to modern one required by python 3.
Compatible with python 2.7.

(From OE-Core rev: d13f0ac614f1d1e2ef2c8ddc71cbfcf76a8dc3f2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21 22:26:33 +01:00
Aníbal Limón d28ab58485 classes/base: get_lic_checksum_file_list imporve validaton of url's
When specify an URL different that supported file:// the function
returns an empty path causing an exception without notice the user
that the URL is Malformed.

[YOCTO #9211]

(From OE-Core rev: 6c28251d3d187b60ceb534055dbd8b4fffd06429)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:29 +01:00
Martin Jansa c2f7da23d0 base.bbclass: Introduce PACKAGECONFIG_CONFARGS variable
* add separate variable for configuration options generated from
  PACKAGECONFIG setting, this helps other bbclasses and recipes
  to take advantage of PACKAGECONFIG mechanism, without including
  other options from EXTRA_OECONF
* e.g. meta-qt5 recipes are abusing EXTRA_OECONF to get options
  from PACKAGECONFIG:
  EXTRA_QMAKEVARS_PRE +=
  but with
  conf/distro/include/no-static-libs.inc
  it means getting --disable-static as invalid option inside
  EXTRA_QMAKEVARS_PRE as reported by Alexandre Belloni who tried
  to use poky with meta-qt5.
* once we migrate all bbclasses and recipes to PACKAGECONFIG_CONFARGS
  we should also restrict EXTRA_OECONF append only to autotools.bbclass
  like I did for cmake.bbclass

(From OE-Core rev: 0ea4a47bfc27d02594d489b27c029d3d3badf3d4)

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>
2016-04-19 21:11:24 +01:00
Richard Purdie 370a50a27b base: Fixup PACKAGECONFIG incorrect mappings
PACKAGECONFIG doesn't work in cross-canadian recipes at the moment as
DEPENDS are prepended with mlprefix.

A recipe is either nativesdk, native or target so adjust the if
statements accordingly, use inherits_class for more accurate recipe
classification and add cross-canadian support.

(From OE-Core rev: 4a172868a9423afb8a602413ef4935423ce51a5d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:51:35 +01:00
Andre McCurdy 0012b9057f base.bbclass: avoid duplicate call to d.getVar('LICENSE', True)
Reuse the 'license' variable, instead of calling
d.getVar('LICENSE', True) again.

(From OE-Core rev: 32a1df86877cd8e70baccd858847fa927508f159)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:30 +01:00
Andre McCurdy efe73cb5a7 base.bbclass: drop obsolete HOSTTOOLS_WHITELIST_GPL-3.0
base.bbclass sets 'check_license' to False (and therefore skips
license checking completely) for native, nativesdk, etc recipes
(ie anything which could potentially be classed as "host tools"),
so supporting a dedicated whitelist of GPLv3 host tools is not
necessary.

(From OE-Core rev: 8fc8b60005e7641861324c8541fb45058e7aab8e)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:30 +01:00
Richard Purdie bc5a1d1684 base: Add nodejs-native dependency for npm:// urls
With the addition of the npm fetcher, we add the native dependency
handling too.

(From OE-Core rev: 500c432419739e2be247d6feea3f4d85eb7ddfd0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:32:57 +00:00
Patrick Ohly a12dcc4a1d base.bbclass: fix support for gitsm://
Before the "Improve handling of SRCPV" change, gitsm SRC_URI entries
were merely missing a dependency on git for do_fetch. But after that
change, the special handling for "needsrcrev" was not applied, leading
to a fetcher error (older bitbake) or even a parse error (recent
bitbake).

(From OE-Core rev: 41d06f512504cb24bb727308d08490b8741f332d)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-12 08:57:35 +00:00
Richard Purdie b3a2065d47 base: Make do_cleansstate nostamp
We always want the cleansstate task to run so it should be
'nostamp' like the other clean tasks.

(From OE-Core rev: 187190bfe3f589a7d1acaa22fab4607f976635ce)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:24 +00:00
Richard Purdie 8b5ee367a6 bitbake.conf/base: Improve handling of SRCPV
If SRCPV is set, it can be expanded when SRC_URI doesn't support it
leading to errors. Avoid doing this by setting it only when it makes
sense.

This patch depends on the bitbake python expansion patch series.

[YCOTO #7772]

(From OE-Core rev: ce64da2b80f99c82d96513d8dfb5e572757b0cda)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:21 +00:00
Ross Burton 0c0b07286f meta: add ASSUME_PROVIDED dependency on wget-native for http fetches
For clarity and consistency, add a dependency on wget-native for any URIs that
will be fetched using the wget fetcher, and add wget-native to ASSUME_PROVIDED.

(From OE-Core rev: 91583704383aef3d4742630380fd3f1d38c4b00a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04 23:39:01 +00:00
Markus Lehtonen c6b8227083 Make sure that the directory for CONFIGURESTAMPFILE exists
(From OE-Core rev: bb82dc384bda48d746634ba1f4e315737993c794)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-31 13:29:48 +00:00
Richard Purdie c936bf0dfa base: Move COMPATIBLE_MACHINE out the scope of SOURCE_MIRROR_FETCH
Recipes setting COMPATIBLE_MACHINE are likely to have SRC_URI
entries which can heavily depend on the configured machine. Skipping
them for SOURCE_MIRROR_FETCH is therefore not advised and leads to
build errors whilst not particularly improving source mirrors.

[YOCTO #8802]

(From OE-Core rev: b53038303374debf91ed73039cf79912f266acfe)

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>
2016-01-31 13:29:47 +00:00
Paul Eggleton fd84d0fe35 classes/base: don't print header if BUILDCFG_HEADER not set
If we don't want a header printed at the start of task execution (which
we'd prefer not to within the extensible SDK)  we can accomplish that by
clearing BUILDCFG_VARS and BUILDCFG_HEADER, but that was still printing
a load of blank lines. To keep things simple, check if BUILDCFG_HEADER
is set to something before printing a header.

(From OE-Core rev: d896d77c1d0fc56ff7019bfee3cf06fbc3ede8f3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-28 09:25:12 +00:00
Ross Burton 551cda0bd5 base: check for existing prefix when expanding names in PACKAGECONFIG
When the DEPENDS are added as part of the PACKAGECONFIG logic the list of
packages are expanded so that any required nativesdk-/-native/multilib prefixes
and suffixes are added.

However the special handling of virtual/foo names doesn't check that the prefix
already exists, which breaks under nativesdk as in that situation there's an
explicit nativesdk- prefix *and* MLPREFIX is set to nativesdk-.  This results in
the same prefix being applied twice, and virtual packages such as virtual/libx11
ending up as virtual/nativesdk-nativesdk-libx11.

(From OE-Core rev: 55ca1fb8f0e81ff739b3c46897e43356d1f760c3)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 08:48:24 +00:00
Richard Purdie 0c5d2398fc base: Improve handling of switching virtual/x providers
If you build virtual/kernel, then change PREFERRED_PROVIDER_virtual/kernel from say
"linux-yocto" to "linux-yocto-dev", you see errors from the sysroot about overlapping
files. The automatic uninstall logic doesn't trigger since the other recipes is
still technically parsed/buildable.

What we can do is look at the value of PREFERRED_PROVIDER_virtual/X and raise SkipRecipe
(skip parsing) if it provides this thing and its not selected. We skip cases no preferred
provider is set, or the value is in MULTI_PROVIDER_WHITELIST.We also inform the user
if they try to build something which conflicts with the configuration:

$ bitbake linux-yocto-tiny
ERROR: Nothing PROVIDES 'linux-yocto-tiny'
ERROR: linux-yocto-tiny was skipped: PREFERRED_PROVIDER_virtual/kernel set to linux-yocto, not linux-yocto-tiny

[YOCTO #4102]

(From OE-Core rev: 9a3b992b7339f7aa892f1dff7d159747630b045d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-08 10:20:47 +00:00
Ross Burton 46755cc4b8 base: add automatic dependency on lzip-native for .lz SRC_URI
Now that the SRC_URI is parsed this can be done without false-positives.

(From OE-Core rev: 6fac3caf3d70823c830178f2299ceee275a1edd1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:01 +00:00
Ross Burton 6ea39c26b7 base: decode SRC_URI before adding implicit fetch dependencies
To avoid false positives such as a SRC_URI for http://foo.xz/foo.zip gaining a
dependnecy on xz-native decode the URI so that precise tests can be done.

(From OE-Core rev: a98a14844bc0b2ef8fc0426768fde40516279bf8)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:01 +00:00
Richard Purdie fecb07755c classes: Ensure pass setVar/setVarFlag strings, not integers
This doesn't cause any issues right now but it make sense to standardise
on consistently using strings in the data store.

(From OE-Core rev: 99203fbe5ad470ef65cff93cec9d7f332883b5ee)

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:26 +00:00
Jian Liu d492a70c72 base.bbclass: considering multilib when setting LICENSE_EXCLUSION
The PACKAGES is not mapped with MLPREFIX when setting LICENSE_EXCLUSION
in base.bbclass. For example,
  For libgcc-dev,
    LICENSE_EXCLUSION-libgcc-dev=1
   but for lib32-libgcc-dev,
    LICENSE_EXCLUSION-libgcc-dev=1
Obviously it is wrong for lib32-libgcc-dev.

Add MLPREFIX before the package name during setting LICENSE_EXCLUSION

(From OE-Core rev: 6597130256a1609c3e05ec5891aceaf549c37985)

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-10-27 07:24:27 +00:00
Joe MacDonald ae7703f21a classes/base: provide hints on PACKAGECONFIG error
Commit 771f89498c introduces an error message that is very rarely hit and
when it is, it is usually easy to trace the root cause very quickly.  The
information provided in the error message isn't enough to lead you back to
the actual failure, however, so expand upon it a bit, pinpointing the
specific package and flag that fails.

(From OE-Core rev: ead4a552464309e6ef3381590994b6cea225ca20)

Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-19 17:57:58 +01:00
Ross Burton 161180b8f4 Revert "base.bbclass/blacklist.bbclass: remove doc item when d.getVarFlags()"
This deletes and therefore breaks PACKAGECONFIG[doc], so revert.

This reverts commit b741780d43.

(From OE-Core rev: 45cff248f5f9f4fb2498c34963e6652cc1166737)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-11 09:28:52 -07:00
Robert Yang b741780d43 base.bbclass/blacklist.bbclass: remove doc item when d.getVarFlags()
The FOO[doc] is set in meta/conf/documentation.conf, we need remove it
from d.getVarFlags()'s return dict when it causes many loops.

(From OE-Core rev: 595a7af8d0a52b24e2bdb5c373c64d27b54bb25b)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:16 +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
Beth Flanagan 5c76072804 base.bbclass: Note when including pn with INCOMPATIBLE_LICENSES
We need to be able to tell people if we WHITELIST a recipe
that contains an incompatible licese.

Example: If we set WHITELIST_GPL-3.0 ?= "foo", foo will end
up on an image even if GPL-3.0 is incompatible. This is the
correct behaviour but there is nothing telling people that it
is even happening.

(From OE-Core rev: c9da529943b2f563b7b0aeb43576c13dd3b6f932)

Signed-off-by: Beth Flanagan <elizabeth.flanagan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:08 +01:00
Richard Purdie e384d9ba0c pixbufcache: Use sceneQueueComplete event to simplify usage
Ensuring the native pixbuf cache is correct after new loaders have
been installed is tricky. This needs to be done without races
and work regardless of whether the build is from sstate or freshly
built for one or more modules.

This adds a hook into base.bbclass which is then triggered by the
code from pixbufcache. This patch is an improved version which
means base.bbclass has no pixbuf knowledge and the mechanism can
be reused in other cases.

(From OE-Core rev: b411085fefc8582d24c172db5f6610705eb44c2f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31 10:32:45 +01:00
Paul Eggleton 757be608a5 classes/base: fix die() to print the full log
The recent change to connect through the shell logging functions caused
a regression - bb.error() and bb.fatal() cause a flag to be set
internally such that BitBake's UI will not print the full task log on
failure; unfortunately we have in a lot of places called die() or
bbfatal() within shell functions with a very terse message as a means of
exiting out, where we still want to see the full log (and we were
previously). We do still want to have fatal errors with proper messages
that don't result in the full log being printed, however we can't ignore
the typical usage of die(). Having added a mechanism to BitBake to log an
error and reset the flag, create a bbfatal_log() function that uses this
and call it from die() to restore the previous behaviour.

(From OE-Core rev: beec1cf3d22d7dbe85f332a055c72649f4bd3e92)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:23 +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 e9817d59d3 oeqa/sstatetests: Add NATIVELSB sstate signature equivalence test
The sstate checksums should be independent of whichever NATIVELSBSTRING is
detected. Add an automated QA test which tests this using bitbake -S.

To make this possible, we need to be able to override the value of
NATIVELSBSTRING so make a small change to allow this.

(From OE-Core rev: 2da156d491caf25dfa3efd567d6dbb451dd7e9dc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:38 +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
Robert Yang 04a1fea952 base.class: warn for invalid PACKAGECONFIG
There may be typos or out of date values in PACKAGECONFIG, check and
warn them.

(From OE-Core rev: be085657bbab34bb8a822682897f96871bb2d8f4)

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>
2015-06-23 11:46:57 +01:00