Commit Graph

134 Commits

Author SHA1 Message Date
Robert P. J. Day 6b210e74b7 autotools.bbclass: Replace "grep ... >/dev/null" with "grep -q"
For aesthetic style reasons, use "grep -q" instead of ">/dev/null".

(From OE-Core rev: 39a7bfde92211b3546ff0a8e6a3e549714996b28)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 11:08:34 +01:00
Dengke Du f6eec55982 autotools.bbclass: delete the extra varflag set for autotools_copy_aclocals
The autotools_copy_aclocals has been droped, so the varflag set for that should
be removed.

(From OE-Core rev: 2940340cc3c8581d16acdaec3ba1dbfd3e88f840)

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:19 +00:00
Khem Raj 27c106e087 autotools.bbclass: Change acpaths defaults to be a weak assignment
We currently have to override the default setting using a particular
assignment order in the recipe, setting it weakly helps to get rid
of this problem.

(From OE-Core rev: 57be81156f74666ff2ed2755f5faa48edf00e4dc)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00: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 f7259298a2 classes/externalsrc: re-run do_configure when configure files change
If the user modifies files such as CMakeLists.txt in the case of cmake,
we want do_configure to re-run so that those changes can take effect. In
order to accomplish that, have a variable CONFIGURE_FILES which
specifies a list of files that will be put into do_configure's checksum
(either full paths, or just filenames which will be searched for in the
entire source tree). CONFIGURE_FILES then just needs to be set
appropriately depending on what do_configure is doing; for now I've set
this for autotools and cmake which are the most common cases.

Fixes [YOCTO #7617].

(From OE-Core rev: 923fc20c2862a6d75f949082c9f6532ab7e2d2cd)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 23:04:44 +01:00
Markus Lehtonen 7ff051c2fb autotools.bbclass: use python3 instead of python (v2)
(From OE-Core rev: 97b21645fdcdb39a58546b5f4d763b920fe5fbd6)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:02 +01:00
Richard Purdie 577ff4e3dd autotools/siteinfo: Tweak CONFIG_SITE handling for determism/races
As things stand there are multiple races in the CONFIG_SITE handling
where checksums can change depending on whether site directories
exist or not when parsing happens. This is bad.

Secondly, there is a build race that occurs if you build virtuals
in parallel with the "main" recipe, since the main recipe is parsed
when the virtual is (since it sets variables like BBCLASSEXTEND)
and with the current code, it may look for files and directories
which could be created/destroyed which the loop is executing. This
is also bad.

The aclocal-copy directory should only ever be accessed by the call
from autotools.bbclass. This changes the parameter name to make it
clear and ensures all callers have the right usage, neatly avoiding
all the problems above. Also added better comments.

(From OE-Core rev: 3207244004c612c1a0e13921251003e5e635d1b1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-22 11:13:24 +01:00
Richard Purdie c77f114e24 autotools: Correctly filter m4 files view to setscene dependencies
Currently when you run builds from sstate, you can see warnings like:

WARNING: systemd-1_230+gitAUTOINC+3a74d4fc90-r0 do_configure: /data/poky-master/tmp-glibc/sstate-control/manifest-intel-corei7-64-glibc-initial.populate_sysroot not found
WARNING: systemd-1_230+gitAUTOINC+3a74d4fc90-r0 do_configure: /data/poky-master/tmp-glibc/sstate-control/manifest-intel-corei7-64-libgcc-initial.populate_sysroot not found

This is due to co_configure wanting to copy a limited number of m4 macros,
only listed in a recipes DEPENDS but that set is still larger than the set of
recipes which get restored from sstate.

For build determinism and to avoid these warnings, we need to make this
function match what the sstate code does. We really don't want to duplicate
the functionality since keeping things in sync would be hard so we create
a data structure which can be passed into the same underlying function,
setscene_depvalid().

[YOCTO #10030]

(From OE-Core rev: 37ffb1f7d812e40d6fa23b44782eaa8436d9ab76)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-14 22:22:12 +01:00
Stefan Müller-Klieser 734a49baef autotools.bbclass: remove EXTRA_OEMAKE workaround
The default of EXTRA_OEMAKE is already empty since commit:

OE-Core rev: aeb653861a0ec39ea7a014c0622980edcbf653fa
bitbake.conf: Remove unhelpful default value for EXTRA_OEMAKE

(From OE-Core rev: 4fca6c95895d7d17cdfb637d383b28ee939fbd99)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03 09:58:40 +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
Ross Burton 77e5a89df3 autotools.bbclass: remove intltool.m4 from ${S}
We need to ensure that builds use our intltool.m4 as there is a bug in
upstream's macros when the host doesn't have XML::Parser installed.

So generalise the m4 pruning logic that we already have from gettext and add
intltool.m4.

(From OE-Core rev: 342fa2b8407552a962e7c78d0e4de7b2d0b30041)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Ross Burton 63cb0eec1f autotools: move aclocal-copy to WORKDIR
To save time move the temporary copy of the autoconf macros, aclocal-copy, from
${B} to ${WORKDIR}.  This ensures that it can't conflict with anything in ${S}
and means the pruning code doesn't need to know about it.

(From OE-Core rev: d7249c5cce6fbc7875c46f2452ca8cd045773898)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Ross Burton e04da4b954 autotools: ensure Makefile exists in do_compile
If a recipe is using the autotools class then presumably it is using Makefiles.
However the default do_compile() is forgiving and silently handles a missing
makefile, which means that if a recipe is using a hand-coded static Makefile
(e.g. git) but doesn't use brokensep the recipe will fail in do_install.

To make debugging this easier, override do_compile in autotools so that it fails
if a Makefile isn't present.

(From OE-Core rev: 14839515301754e0b512fe3054d95dabc77ad829)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Tim Orling 144c5175b8 autotools.bbclass: fix py3 SyntaxError in cfgscript print()
Update so this works with python3.

(From OE-Core rev: f533a1f78411f5537f1395496aa39f453fee581c)

Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-15 09:06:00 +01:00
Ross Burton e93254b482 autotools: add default for CACHED_CONFIGUREVARS
Ensure that this variable has a default value so that we don't get debug
messages that the variable couldn't be expanded.

(From OE-Core rev: 27fd1bb7969b558864463450e1837c4400a03f9c)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:12 +01:00
Ross Burton 002847ab0b autotools: warn when running intltoolize if intltool isn't a dependemcy
(From OE-Core rev: 7ba90d2083970cb2a04afb8fa2ee2d485fef4e4d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29 07:58:43 +01:00
Richard Purdie 2eba066ccb autotools: Fix interaction with bitbake -b
If you run bitbake -b on something using autotools with dependencies on

m4 files, it currently fails as the TASKDEPDATA is incomplete for
bitbake -b
and this means the relevant macros aren't found.

Work around this by adding *all* m4 files for the -b case (and show a warning).

[YOCTO #8890]

(From OE-Core rev: 60207e0cf3a5bce9123d3631a10a9540c72a9034)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-14 11:42:18 +00:00
Richard Purdie 9c8fee9c62 autotools: Correct dependency search logic error
We go to the effort of finding the value of start, we should then use it
rather than relying on the value of dep being preserved from the previous
loop. Took me far too long to notice this issue when changing the code.

Also drop an unused variable.

(From OE-Core rev: c546cced50ce8b72fe55f9a7cfe7fdb23c51d1ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-14 11:42:18 +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
Markus Lehtonen ca0617963a autotools.bbclass: use oe_runmake instead of ${MAKE}
Use oe_runmake like in base.bbclass so that EXTRA_OEMAKE will be
respected.

(From OE-Core rev: 5e89a79ae7f26735e523917555251313995d01d4)

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
Andre McCurdy 85b66791aa autotools.bbclass: don't create subshell to delete configure scripts
(From OE-Core rev: 107ab45444bfaa2d287bb490f76b44fc827048b5)

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>
2016-01-30 11:37:04 +00:00
Ross Burton ba837f1055 autotools: don't output the full config.log on configure failure
The config.log written by autoconf includes many pages of useless output,
followed by an obfuscated error message, and then more pages of every variable
that's been set.  It's only understandable if you're well versed in how autoconf
behaves, and often in simple failure modes doesn't actually make it clear what
the problem was.

Instead of outputting the whole config.log to the console when do_configure()
fails, use bbfatal_log so the human-readable configure output (not the
config.log) is shown to the user, and tell the user where config.log can be
found if they need it.

[ YOCTO #8856 ]

(From OE-Core rev: 55e263c559098cce99d8c3ef57ccc39f1d4a6848)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:20 +00:00
Robert Yang 44d283a13d autotools.bbclass: use relative path to run configure script
The absolute path (/path/to/configure) caused VPATH in Makefile to be an
absolute path, and then it will be in elf files, use relative path to
run configure can fix the problem.

This will reduce a lot of buildpaths QA issues in a world buld.

[YOCTO #8894]

(From OE-Core rev: 2c6ad43af0a0c4db5d7fd342be8585bec66debfb)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-18 11:47:03 +00:00
Jens Rehsack 753f31e3d1 autotools: Allow recipe-individual configure scripts
OpenJDK-8 has it's configure script at common/autotools - which will cause
the entire assumption of ${S}/configure is regenerated by autoreconf, intltoolize or alike
fails heavily.

Also - other configure mechanisms can be supported more similar (see how pkgsrc
manages different ones ...)

(From OE-Core rev: fe506eddb0790e37ac1e50f37fa2e32ad81d5493)

Signed-off-by: Jens Rehsack <sno@netbsd.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:55:40 +00:00
Christopher Larson 6adffd09e5 autotools: fix traversal bug in aclocal copying
The logic is supposed to avoid following dependencies when we depend on
a target recipe which depends on a native recipe. The problem is, we were
marking the dep (the native recipe) as already processed when we avoided
traversal, meaning that even when that recipe would be pulled in via
a different dependency, we skipped it there too, and whether it was skipped
entirely depended on the non-deterministic dep processing order. If the first
one to be encountered was via the indirect target dep, it wouldn't end up in
configuredeps, otherwise it would.

As we want to avoid traversing that particular dependency relationship, not
*every* dependency on the native, we should continue, but not add it to done,
so it can be traversed from other avenues.

This fixes an intermittent bug in some of my non-GPLv3 builds, where one
dependency upon gettext-minimal-native was skipped, but others should not have
been, resulting in it being removed from configuredeps entirely, and no
gettext macros being available.

Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
(From OE-Core rev: e6d4f8198a8708f54fc17333ae643b51ed9100b6)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
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
Robert Yang 96795000ea autotools.bbclass: mkdir ${B} -> mkdir -p ${B}
${B} is the default cwd of tasks, so there might be race issues such as:
| mkdir: cannot create directory `${B}': File exists
[snip]
NOTE: recipe perf-1.0-r9: task do_configure: Failed

(From OE-Core rev: 72682d72b52355c3fed947167ca3c6064340ead1)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:31 +01:00
Roy Li 6874f5e72f autotools.bbclass: Allow dependency tracking option to be overridden
CONFIGUREOPT_DEPTRACK can not be overridden since it is set by =

(From OE-Core rev: 758abeb219520ab5556186babcdb7e6660ce6e40)

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:06 +01:00
Paul Eggleton ddc1df3e80 Use die() or bbfatal_log() where the log should definitely be printed
Change calls to bbfatal() to either die() or bbfatal_log() where we know
we want the full log to be printed by the UI (calling bberror or bbfatal
would otherwise suppress it since the change to connect these functions
through to the UI.) bbfatal() is still fine to use where there is enough
context information in the message such that the log isn't needed.

(From OE-Core rev: 04ed9a19e1b08003329138b8ab83691d13c11fd9)

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
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
Richard Purdie a9cb4dd158 autotools: Use space with prepend to clean up variable whitespace
Correct the whitespace in this variable to make this more readable when
debugging, no functional change.

(From OE-Core rev: 4bb586a470a15cf3b93538e8c749a6fb8479c990)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:57:50 +01:00
Richard Purdie 527b28c109 autotools: Fix find races on source directory
In a similar way to http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=aa1438b56f30515f9c31b306decef7f562dda81f
there are more find races in the autotools class.

For recipes with PACKAGES_remove = "${PN}", the find which removes
.la files can race against deletion of other directories in WORKDIR
e.g.:
find: '/home/autobuilder/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0-r7/sstate-build-populate_lic': No such file or directory
| WARNING: /home/autobuilder/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0-r7/temp/run.do_configure.6558:1 exit 1 from
| find /home/autobuilder/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0-r7 -name \*.la -delete

Fix the remaining races in the same way.

[YOCTO #7522]

(From OE-Core rev: 79770ca14a0cc2f4112fb4d8dc2d8832701b6d5d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:58:54 +01:00
Richard Purdie aa1438b56f autotools: Avoid find race for S = "${WORKDIR}"
For recipes with PACKAGES_remove = "${PN}", the find which removes .la files
can race against deletion of other directories in WORKDIR e.g.:

find: '/home/autobuilder/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0-r7/sstate-build-populate_lic': No such file or directory
| WARNING: /home/autobuilder/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0-r7/temp/run.do_configure.6558:1 exit 1 from
|   find /home/autobuilder/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0-r7 -name \*.la -delete

The simplest fix is to add the find option which ignores these kind of races.

[YOCTO #7522]

(From OE-Core rev: dd8099ca3092fbd5c685e5ef1b1c5a8185a6893d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-31 22:23:15 +01:00
Richard Purdie cefc40389e autotools/siteinfo: Avoid races over siteinfo files
If a siteinfo enabled tasks re-executes at the wrong moment whilst something else is
in do_configure, the _config files can be removed which upsets autoconf and
causes build failures.

Use the same approach as we do for dealing with the aclocal files. We already
parse the manifests so look out any *_config files and if so, copy them, then
reference the copy from siteinfo instead. This has the advantage of also being
more deterministic.

[YOCTO #7101]

(From OE-Core rev: c8b7aad133c3e3319345d50f85a91cbd5116f842)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-13 14:49:36 +00:00
Robert Yang 4bbe189d5d autotools.bbclass: print make clean
It makes us easier to see make clean failed.

(From OE-Core rev: c34d9e66a1a97952965128ab84c691202a60985b)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-16 23:08:24 +00:00
Ross Burton a1abb63f0b autotools.bbclass: respect CLEANBROKEN
autotools.bbclass should respect CLEANBROKEN as it invokes 'make clean' on
configure.

(From OE-Core rev: ffbcb440c43e5e00e73ced67a2c888e9863a1d00)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-05 18:01:07 +00:00
Richard Purdie 444ae98131 autotools: Use make clean for builds not supporting B != S
If the build doesn't support B != S, we can try running "make clean" instead
to try and clean up previous objects if the hash for the task has changed.

This tries to ensure that when variables like ${baselib} change, the changes are
correctly accounted for.

(From OE-Core rev: c2f761e2010857e2a2aad1dccf06ec39d15c1c86)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:11:51 +00:00
Paul Eggleton 76070017cd classes/autotools: avoid error if recipe is first in task dependency tree
If the recipe being built is listed first in BB_TASKDEPDATA (i.e. item
0) this is still valid and should not trigger an error.

(From OE-Core rev: 945c98969bcfe5516b89ac6dfbe4552fb5d68a48)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23 09:26:09 +01:00
Richard Purdie 83775dcc90 autotools: Exclude SDK_OS from autotools task signatures
The change to handle SDKs of different types resulted in the signatures
becoming SDK specific which wasn't intended. Exclude the variable from the
hash values to avoid this.

(From OE-Core rev: add7b9cb20282f837c90a785f04ca690a9bbe87e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-04 16:25:46 +01:00
Richard Purdie 55379f29a6 autotools: Fix warning for odctools-crosssdk
odcctools-crosssdk doesn't use the suffixed naming the rest of crosssdk does
and this results in a annoying build warning. Avoid this.

(From OE-Core rev: b6b66f987168615598c980996a1692ca5753b4eb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-03 12:40:40 +01:00
Richard Purdie 03af60ede9 sstate: Allow switching between linux and non-linux SDK builds within the same tmpdir
Currently if you try and switch between linux/darwin/mingw SDK builds in the
same TMPDIR, things break. This is due to sstate not reflecting the SDK_OS in
the manifest names.

Since they are different, reflect this in the manifest naming and allow
this to work.

(From OE-Core rev: 7a0e1233ba196797f5f9bf862685dfae5511e751)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-03 12:40:40 +01:00
Richard Purdie 419daaaf0a autotools: Improve configure dependency code for finding m4 files
We have an open bug about the warnings issues in builds from an sstate
cache when something like glib-2.0 gets rebuilt. The issue is that
sstate is "clever" and prunes unneeded dependencies out the tree.

For example is X depends on pkgconfig-native but we've already build X
and installed it from sstate, it will not get installed when you build Y
which depends on X.

This patch changes the logic to match the sstate behaviour and prune out
unnecessary dependencies from the scope of aclocal. This in turn removes
the warning about missing manifest files.

The issue is that this patch exposes holes in our DEPENDS in recipes,
specifically that some native tools are not listed, specifically, and
problematically, pkgconfig, gtk-doc and intltool-native in particular.

I've sent out patches against OE-Core that address the bulk of the
issues there however I'm conscious this is probably going to a bug issue
in other layers and may be too annoying to consider at this point. The
other alternative is simply to turn the warning into a debug statement.

I appreciate the code below has commented blocks, this is simply debug
I've left around for now. It will be cleaned from any final version.

(From OE-Core rev: 6d2dc279faa8b28a00895dc6a620d80e2dbac685)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 16:54:42 +01:00
Matthieu Crapet 5a7f510a68 autotools.bbclass: Enhance sed regexp to avoid extra subshell
head -n1 can be done using sed.

(From OE-Core rev: 38d50331acbc1e279449ae6b313ff0116b6c44e8)

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 15:34:00 +01:00
Ross Burton 96748199f5 autotools.bbclass: remove autotools_set_crosscompiling
The only reference to this function is a commented-out assignment, and nothing
in oe-core nor meta-oe uses autotools_set_crosscompiling directly.  As it's
unused, remove it.

(From OE-Core rev: adaa0568390d0dfef1c4d87809601aab85299e97)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-03 17:41:18 +01:00
Richard Purdie e078edbf99 binutils/gcc/gdb: Add TARGET_ARCH to PN for all cross recipes
This allows them to co-exist together in the native sysroot, with one
set of cross tools per target architecture.

(From OE-Core rev: a2c5509520d5c3e082f55844e6545d0309565f8f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-30 16:39:06 +01:00
Richard Purdie 69b6eaca3d autotools: Enable separate builddir by default
(From OE-Core rev: baf5b230af919b6b0fd14ac5fc3e734bf7c464d5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-24 17:55:13 +01:00
Richard Purdie 08303af44a autotools: Exclude variables from autotools_copy_aclocals
The autotools aclocal copy function should not depend on various variables, these
are accounted for in other parts of the system. Therefore exclude them.

This was causing differences in sstate checksums between different systems and meaning
the sstate cache wasn't being reused as much as it should.

(From OE-Core rev: b7193fadb1a53c86ffe4982a2fa9c1179a74de46)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-18 23:05:52 +00:00
Richard Purdie 12d613f9a9 alsa-tools/autotools: Ensure that aclocal files can be present with AUTOTOOLS_COPYACLOCAL variable
Introduce a AUTOTOOLS_COPYACLOCAL variable which forces the copy of the aclocal
files even when a configure.ac/.in file isn't present.

Use this new feature in alsa-tools.

(From OE-Core rev: 07db5222a970e40bff51c5df793f0021b0e2aba8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-05 15:50:19 +00:00
Richard Purdie b924b499ec autotools: Limit aclocal files to those in dependencies
We still occasionally see race issues with cp-noerror, and it copies
too many files, we should limit the the m4 files to those explicitly in
the DEPENDS for the recipe.

This change takes advantage of the BB_TASKDEPDATA data from bitbake to
only copy in those files listed in the manifest of the recipes in DEPENDS.

I've had this testing locally for some time, its ready for wider
review/testing.

(From OE-Core rev: 79ea036de331bde65a88fb777647dc099ef05acf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-05 15:50:19 +00:00
Richard Purdie 641a80d760 autotools: Remove .la files if rebuilding non out of tree software
(From OE-Core rev: bcf83bb604906361db98003127b90c422e822322)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17 14:35:16 +01:00