Commit Graph

124 Commits

Author SHA1 Message Date
Ross Burton 541c5c7fc0 populate_sdk: install UTF-8 locales in SDKs
As glibc 2.27 can't read older locale-archives, SDKs using glibc 2.27 on hosts
using glibc earlier than 2.27 won't be able to find any locales, so bitbake
won't start and Python can't use UTF-8.

So by default install all locales into the SDK.  Special-case Extensible SDKs by
installing no locales as they ship glibc in a buildtools, and that will have the
locales.

Locale installation requires cross-localedef, so add that to DEPENDS.

Also remove the explicit en_US addition in buildtools-tarball as it is now
redundant.

(From OE-Core rev: 96896568d197cd06302713c24c0f7d91bfaea6c1)

(From OE-Core rev: af9eb2ef36cb5bfd87ea61ff3390949810097c9b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-02 17:06:24 +01:00
Richard Purdie b9ad197bbc populate_sdk_ext: Set cleandirs correctly
The current conflicting use of SDKDEPLOYDIR causes a race between do_populate_sdk
and do_populate_sdk_ext potentially causing the SDK to either go missing or the
build to fail.

(From OE-Core rev: 2c61e60cc5fe635774e88c1e34646a32a9ad918b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-22 10:40:08 +00:00
Richard Purdie b366f7eccc populate_sdk_ext: Use prebuilt uninative tarball
For uninative to work, it relies on it being updated to new versions as
newer glibcs are built. This means the uninative generated by the current
build may not be as recent as the uninative that is being downloaded by
uninative.bbclass.

If this occurs, we can get symbol mismatch errors.

Ultimately, the sstate and the uninative versions need to match so we
should use the same tarball as uninative.bbclass is using, not the one
we built.

[YOCTO #12405]

(From OE-Core rev: 1bde969058f7e832db0e7eb9c6f7ef00f027628c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-11 21:47:34 +00:00
Paul Eggleton 9e267ad173 classes/populate_sdk_ext: work around runqemu behaviour within the eSDK
Currently, in order to figure out variable values when run within the
eSDK, runqemu does not use the standard SDK method nor is it able to run
bitbake (since the eSDK environment isn't initialised like the normal
OE build environment). runqemu really ought to be fixed, but the quick
workaround is to set DEPLOY_DIR_IMAGE in the environment so that runqemu
can find image files.

Fixes [YOCTO #10447].

(From OE-Core rev: 1ef833b6393366a10f4bb65df89725ad65761386)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-19 10:38:37 +01:00
Richard Purdie 045d01c63d populate_sdk_ext: Add do_addto_recipe_sysroot to BB_SETSCENE_ENFORCE_WHITELIST
Without this, eSDK builds are failing due to qemu-helper-native's dependency on this
task. It makes sense to allow this to execute in eSDK contexts (its a non-sstate task
intentionally).

(From OE-Core rev: 3e8ade8c0772c4492efd93824f78cb043281d235)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-14 09:47:09 +01:00
Mikko Ylinen a84a323e4d classes/populate_sdk_ext: reset TCLIBCAPPEND to get consistent TMPDIR
populate_sdk_ext sets TMPDIR to a known static value with '/tmp' directory
name and that name is hard coded in a few places (e.g., in
meta-environment-extsdk.bb that writes the eSDK environment variables).

Distros that do not reset TCLIBCAPPEND (poky does) end up getting
TMPDIR = /tmp-${TCLIBCAPPEND} via defaultsetup.conf and that breaks
the functionality in eSDK that expects everything is in /tmp.

To get TMPDIR consistent, we also need to reset TCLIBCAPPEND in
populate_sdk_ext.bbclass.

Fixes: [YOCTO #11298]

(From OE-Core rev: 9ec29153f279bb9e1dbcddc2c66e00fdbe3fd6e9)

Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-14 09:47:08 +01:00
Patrick Ohly caf1c90871 populate_sdk_ext.bbclass: enhance compatibility with rm_work.bbclass
"bitbake -c populate_dsk_ext" must not trigger do_rm_work, because it
is impossible to declare that the additional tasks activated by "-c
populate_dsk_ext" must run before do_rm_work. When do_populate_dsk_ext
and do_rm_work are both active, the resulting race condition breaks
do_populate_dsk_ext.

The existing bitbake dependencies can't be used for that, because
"addtask populate_dsk_ext before do_rm_work" would then always execute
populate_dsk_ext also in normal builds.

do_populate_dsk_ext triggers do_rm_work indirectly through the
dependency on do_build of the SDK_TARGETs. Using the new
do_build_without_rm_work instead (when available, with do_build as
before if not) avoids the problem.

However, one has to be careful to not trigger do_rm_work in the same
build in some other way.  "bitbake core-image-sato:do_populate_sdk_ext
core-image-sato:do_build" still fails, for example. Doing one after
the other works.

Fixes: [YOCTO 11042]

(From OE-Core rev: 00b1911c65fa1b21c3dedec40170998573b62178)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-31 10:10:29 +01:00
Richard Purdie 32e1eac492 populate_ext_sdk: Merge auto.conf into local.conf
auto.conf is included before local.conf. Instead of keeping them separate, merge
them into the extsdk local.conf. As it happens we can do this quite neatly, more
neatly than the current code IMO and it makes the configuration easier for the end
user to understand too.

This means auto.conf is then available for the testsdk code to use for testing
purposes.

(From OE-Core rev: fb625e555707478d5b4931c6bc83ab06b17a8ca9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03 11:16:12 +00:00
Richard Purdie 7fefdc1e11 populate_ext_sdk: Append to SSTATE_MIRRORS
We need to appent to SSTATE_MIRRORS in case other areas of code are also
setting the variable.

(From OE-Core rev: 9cab832b1e85822fa9be5ea9fa0415f48fba86f2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03 11:16:12 +00:00
Richard Purdie 28430385ad populate_sdk_ext: Allow generation of meta-extsdk-toolchain even for minimal SDKs
If you build a minimal eSDK currently, you don't build meta-extesdk-toolchain
even if you will have built most of its dependencies. This means when you try
and install a toolchain into the eSDK, it fails, breaking our automated testing
of the eSDK.

Therefore add the dependency unconditionally even when a minimal eSDK is being
built and allow the automated testing to work.

(From OE-Core rev: 6e4ae81d76c5a61e7603ff4ca94452a6e724c244)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:11 +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
Paul Eggleton 014278d370 classes/populate_sdk_ext: account for custom image tasks
Any custom tasks that were added on the image between do_image_complete
and do_build were not being taken into account. Use the newly added
bb.build.tasksbetween() function to take care of that.

(From OE-Core rev: c966dee6208d3b7a9fa3c1b8aa1266058dcb65ff)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Paul Eggleton 4b870ed47b classes/populate_sdk_ext: remove unnecessary dependencies breaking SDK_TARGETS
Up until recently it was possible to set SDK_TARGETS to include a native
recipe you wanted installed into the sysroot when installing the eSDK.
I'm not sure what happened but now when you try to add a native recipe
to SDK_TARGETS you get a missing task error because this recipe has no
do_package_write_* task. Of course such a task dependency is erroneous
and is apparently caused by setting SDK_RDEPENDS. I've checked and it
turns out that we no longer need to set SDK_RDEPENDS anyway (probably
because we explicitly set up task dependencies further down in the
class, which I don't think we were fully doing in early versions of the
eSDK). Thus, drop setting this variable to restore the functionality.

(From OE-Core rev: fe8268ede33a8c76492b85da0f41062f47a5279c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Patrick Ohly a15895dac1 populate_sdk_ext: fix == bashism
Found via verify-bashisms.

(From OE-Core rev: b690b8dc634844b4f6672d524f0e6f1d86dc4e20)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 15:28:41 +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
Richard Purdie d6b3f722c7 populate_sdk_ext: Add wic-tools to BB_SETSCENE_ENFORCE_WHITELIST
wic-tools has tasks which would always rerun and not come from sstate
to ensure we have a correctly populated sysroot. This is low overhead
and can be ignored from an eSDK perspective.

(From OE-Core rev: b631fe91b3939b7981dbf62cb2fb70f7baebe403)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie 60d8ca3e96 Revert "populate_sdk_ext: whitelist do_package tasks"
Since Paul reverted the sstate.bbclass change which was checking the sstate
mirror test results, this change should also not be needed anymore.

This reverts commit e30f5002c4.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Paul Eggleton 785bec81ef classes/populate_sdk_ext: force a known value for TMPDIR
If TMPDIR is configured to be somewhere outside of TOPDIR (a not
uncommon configuration where you have multiple disks and space on /home
is at a premium) then our attempt to find out the location of paths
under TMPDIR by using a relative path led to horribly broken paths
ending up in the eSDK. To save pain, just force a known value for TMPDIR
(i.e. ${TOPDIR}/tmp) and then we can assume that everywhere else.

Fixes [YOCTO #10797].

(From OE-Core rev: 4fe60d526a94f30b201c434994e80fef0f7392f0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +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
Ed Bartosh e30f5002c4 populate_sdk_ext: whitelist do_package tasks
With enabled SSTATE_MIRRORS sstate code expects mirrors to
contain entries for all tasks, which is not the case for ext
installer as it uses reduced sstate cache.

Added do_package tasks to BB_SETSCENE_ENFORCE_WHITELIST to prevent
installer failing with ERROR: Sstate artifact unavailable

[YOCTO #10832]

(From OE-Core rev: 2ed46ada4b8e496493835e84b36f7e9c367f59d2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-05 13:54:06 +00:00
Ed Bartosh 556725188f populate_sdk_ext: fix working with uninative sstate
Mapped uninative sstate directories to make ext SDK installer to
use them when it's run on systems with gcc version different from
gcc version used to build installer.

[YOCTO #10832]

(From OE-Core rev: 549df5f82c9b2d4feb6f459cb3b2f240efb9a981)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-05 13:54:06 +00:00
Joshua Lock 3c59b1bf93 meta: remove True option to getVarFlag calls
getVarFlag() now defaults to expanding by default, thus remove the
True option from getVarFlag() calls with a regex search and
replace.

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

(From OE-Core rev: 2dea9e490a98377010b3d4118d054814c317a735)

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
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
Ed Bartosh c21cec8488 uninative: rebuild uninative for gcc 4.8 and 4.9
Some c++ libraries fail to build if uninative is built
with gcc 5.x and host gcc version is either 4.8 or 4.9.

The issue should be solved by making separate uninative sstate
directory structure sstate-cache/universal-<gcc version> for host gcc
versions 4.8 and 4.9. This causes rebuilds of uninative if host gcc
is either 4.8 or 4.9 and it doesn't match gcc version used to build
uninative.

[YOCTO #10441]

(From OE-Core rev: d36f41e5658bbbb6080ee833027879c119edf3e0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.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
Ross Burton 71b7c3a88e Revert "classes/populate_sdk_ext: require uninative"
The change to move C++ ABI tweaks to bitbake.conf should make this redundant, so
revert it.

This reverts commit c56cd49a12.

(From OE-Core rev: af280990bff4a484fd8a18e3442b56a0a39b7611)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-28 15:49:15 +00:00
Robert Yang 37da91e4fc populate_sdk_ext.bbclass: use weak assignment for TOOLCHAINEXT_OUTPUTNAME
The TOOLCHAINEXT_OUTPUTNAME is different from TOOLCHAIN_OUTPUTNAME, it
is used for eSDK only, so that it doesn't mix with SDK, use "?=" for it
so that other conf file can define it.

If we don't use "?=" here, then we need use forcevariable to redfine it:
TOOLCHAINEXT_OUTPUTNAME_forcevariable = "foo"

(From OE-Core rev: 933539a07af3f1cca79e49b0ea92cb7699095f96)

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-23 11:10:13 +00:00
Robert Yang 16011c5d4f populate_sdk_ext.bbclass: check unfsd before create it
Fixed when nativesdk-unfs3 is installed:
$ bitbake <image> -c populate_sdk_ext
| Traceback (most recent call last):
|   File "/path/to/oe-core/scripts/lnr", line 21, in <module>
|     os.symlink(target, linkname)
| FileExistsError: [Errno 17] File exists: '../../../../tmp/sysroots/x86_64-linux/usr/bin/unfsd' -> '/path/to/9.0/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/unfsd'

(From OE-Core rev: a400c130037497f08a1645984129c5ddba76c031)

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-15 15:19:54 +00:00
Paul Eggleton c56cd49a12 classes/populate_sdk_ext: require uninative
It seems that possibly due to OE-Core commit
ac59063bee0e32d0737340974f657341717a6abe, binaries produced without
uninative aren't compatible with the uninative glibc. I did try earlier
to ensure that the eSDK could work without uninative since the default
configuration in OE-Core does not enable it, but it seems like I didn't
go far enough. Given the practical considerations, just give up and
require uninative to be enabled in order to build the eSDK. I'm not
particularly happy about this, but I don't seem much of an alternative.

Fixes [YOCTO #10566].

(From OE-Core rev: b59eee7bebd413c7abe5626f69508e1fe47dd0ac)

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-11-06 23:35:35 +00:00
Paul Eggleton b95bd4ebe3 classes/populate_sdk_ext: prevent invalid TEMPLATECONF entering eSDK
If you are using a repository which contains a .templateconf file that
sets TEMPLATECONF to point into a layer it contains, but you aren't
using that layer in your bblayers.conf, the eSDK would produce an error
during the preparation step of the installation. An example would be
using the poky repository but setting DISTRO to your own custom distro
and removing meta-poky from your bblayers.conf. The eSDK doesn't
support creating new build directories, so we don't care about the
templates and can thus force a known good value to prevent this from
happening.

Fixes [YOCTO #10568].

(From OE-Core rev: 5ee32191a18013061dfa72e64713a94c5d321496)

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-11-06 23:35:35 +00:00
Ross Burton b2726f7515 populate_sdk_ext: explicitly set DL_DIR
The eSDK generation assumes that DL_DIR is downloads/ under the build directory,
and puts files such as a freshly buily uninative tarball in there expecting
bitbake will find it later.

Whilst ${TOPDIR}/downloads/ is in fact the default value for DL_DIR in
bitbake.conf, and any instances of DL_DIR are removed from the original
local.conf, there is still the possibility that other layers could contain a
site.conf that assigns DL_DIR.

If this happens the errors are quite mysterious as it fails to find the
uninative tarball and so the hashes all change, and eSDK building fails.

Ensure that this cannot happen by explicitly assigning the DL_DIR that we
require, instead of assuming that the default value will be used.

[ YOCTO #10439 ]

(From OE-Core rev: bc2e6f5eab47e869dbc4a3eacfe759b9b1cacaee)

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
Paul Eggleton 35362715b1 classes/populate_sdk_ext: add symlinks and unfsd to support Eclipse plugin
The Yocto Project Eclipse plugin requires that runqemu and unfsd are
accessible within the SDK, and indeed the standard SDK has these. This
turns out to be fairly easy to do - we just need to add unfsd and symlink
it, runqemu and a few other scripts into the SDK's bin directory.

Fixes [YOCTO #10214].

(From OE-Core rev: 9007e0e3fce7e09b043fead54b17f69c1661d162)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:52:54 +01:00
Paul Eggleton ca107522eb classes/populate_sdk_ext: ensure we clean the right temporary TMPDIR path
After we run the build system within the eSDK internally as part of the
sstate filtering that happens during do_populate_sdk_ext, we need to
ensure that the TMPDIR created during that process gets deleted. However
we were using the TMPDIR path for the build producing the eSDK which may
not be the same (since that value would typically be filtered out) thus
if the user had set TMPDIR to something other than the default, the
temporary TMPDIR would not be deleted which not only led to extraneous
junk entering the SDK but also failures during install because the
TMPDIR path was different. In order to fix this, force TMPDIR to a known
value during the sstate filtering run so we know what to delete
afterwards.

Fixes [YOCTO #10210].

(From OE-Core rev: 038d9db66e69c9de12eb8581acb28a8facd726b6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-14 22:22:12 +01:00
Amarnath Valluri 05602d9c48 classes/populate_sdk_ext: exclude image tasks from locked signatures
Tasks for image recipes cannot be locked and should be excluded from eSDK
generated locked-sigs.inc. get_sdk_install_targets() was not returning right
image targets to be excluded incase of 'minimal' sdk. This change fixes the issue.

(From OE-Core rev: 46401034f017d234833997d2fb3122190f9029bf)

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-14 22:22:09 +01:00
Richard Purdie e1de696674 populate_sdk_ext: Put populate_sdk_ext under sstate control
Adding populate_sdk task to SSTATE_TASKS should make sstate machinery
to generate manifest for deployed ext sdk artifacts and do final deployment
to SDK_DEPLOY.

This is done in a similar way to do_populate_sdk in a previous patch.

(From OE-Core rev: ea3587e626a184c53dc0f484d1a0299b2b00641d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-04 00:07:29 +01:00
Ed Bartosh 3c3962d27e populate_sdk_base: Put populate_sdk under sstate control
Adding populate_sdk task to SSTATE_TASKS should make sstate machinery
to generate manifest for deployed sdk artifacts and do final deployment
to SDK_DEPLOY.

Set stamp-extra-info flag for do_populate_sdk task. This flag is used
in the name of sstate manifest. Setting it to predetermined value for
populate_sdk task should help to get correct manifest filenames when
processing runQueueTask events.

The do_populate_sdk function is also executed by do_populate_sdk_ext
so in order to avoid conflicts with the sstate postfuncs, split
the main code into a separate function.

We also need to set SDKDEPLOYDIR as do_populate_sdk_ext expects
it in order not to break ESDK generation.

(From OE-Core rev: 8361376b8ef0147276c9ee31349e904d86900593)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-04 00:07:29 +01:00
Paul Eggleton 99d109cdbc classes/populate_sdk_ext: drop duplicated error message
The preparation script itself prints out an error on failure, and we
aren't redirecting its output anymore, so we no longer need to print out
a message here when it fails. At the same time, make the message printed
out by the script a little clearer - we're just writing the log out to
the file, we shouldn't give the user an expectation that there will be
extra details in there (other than the output produced by
oe-init-build-env there won't be).

(From OE-Core rev: 80dfaf40e087b34d6360188df372c1c3805a00bd)

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-08-17 10:35:41 +01:00
Paul Eggleton 64ffbd4869 classes/populate_sdk_ext: add some pre-install checks
Check a number of things as early as possible in the eSDK installer
script so that the user gets an error up front rather than waiting for
the build system to be extracted and then have the error produced:

* Check for missing utilities specified in SANITY_REQUIRED_UTILITIES
  (along with gcc and g++), taking into account that some of these are
  satisfied by buildtools which ships as part of the SDK. We use the
  newly added capability to list an SDK's contents to allow us to see
  exactly which binaries are inside the buildtools installer.
* Check that Python is available (since the buildtools installer's
  relocate script is written in Python).
* Check that locale value set by the script is actually available
* Check that the install path is not on NFS

This does duplicate some of the checks in sanity.bbclass but it's
difficult to avoid that given that here they have to be written in shell
and there they are written in Python, as well as the fact that we only
need to run some of the checks here and not all (i.e. the ones that
relate to the host system or install path, and not those that check the
configuration or metadata). Given those issues and the fact that the
amount of code is fairly small I elected to just re-implement the checks
here.

Fixes [YOCTO #8657].

(From OE-Core rev: 6e6999a920b913ad9fdd2751100219c07cd14e54)

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-08-17 10:35:41 +01:00
Paul Eggleton 7cd213d8a9 classes/populate_sdk_ext: properly determine buildtools filename
Determine the name of the current buildtools installer ahead of time,
set it in a variable and use that variable rather than the wildcarded
version everywhere, since it's much tidier.

(From OE-Core rev: d5a601db41ba3c561aced7f5a38689f6b4c9a87c)

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-08-17 10:35:41 +01:00
Paul Eggleton 5895bb6d2c classes/populate_sdk_ext: properly handle buildtools install failure
If the buildtools installation failed, we were using a subshell instead
of a compound command and thus the subshell exited but the script
continued on, which is really not what we want to happen. Additionally
log the buildtools installer output to a file and cat it if it fails so
that you can actually see what went wrong, as well as amending the
environment setup script to print a warning as we do when the
preparation fails.

(From OE-Core rev: 8fb8adf309823660c3943df973c216621a71850d)

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-08-17 10:35:40 +01:00
Paul Eggleton 37b81968bb classes/populate_sdk_ext: sstate filtering fixes
A couple of fixes for the recent sstate filtering implemented in OE-Core
revision 4b7b48fcb9b39fccf8222650c2608325df2a4507:

* We shouldn't be deleting the downloads directory here, since it
  contains the uninative tarball that we will need
* TMPDIR might not be named "tmp" - in OE-Core the default is tmp-glibc
  so use the actual name of TMPDIR here instead.

(From OE-Core rev: 71ecd3bea680ef8c589257844512a14b65e979d3)

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-08-17 10:35:40 +01:00
Paul Eggleton 53b79353ea classes/populate_sdk_ext: handle lack of uninative when filtering sstate
If the build in which the eSDK is being built isn't using uninative,
this will have an effect on NATIVELSBSTRING, which will mean that the
eSDK installer won't be able to find any of the native sstate packages.
To keep things simple, under this scenario just disable uninative
temporarily while we run the SDK installer to help us check the presence
of the sstate artifacts we need. Ideally I'd rather not have things like
this that are artificial in this verification step, but on the other
hand this was the least ugly way to solve the problem.

(From OE-Core rev: 9f39deea7c4af5244dbfa824a52e11590a1d4df6)

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-08-17 10:35:40 +01:00
Paul Eggleton cdd2460ff3 classes/populate_sdk_ext: ensure eSDK can build without uninative enabled
We were relying on uninative being enabled in the build in which the
eSDK was being produced, which is not the case for example for OE-Core's
default configuration. Move the code that copies the uninative tarball
and writes the checksum to copy_buildsystem so that it happens early
enough for that part of the configuration to be set up when we do the
filtering (which requires running bitbake).

(From OE-Core rev: 7bc95253098aca2ff195b159b34d9ac041806c75)

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-08-17 10:35:40 +01:00
Paul Eggleton 4048af44eb classes/populate_sdk_ext: add gdb to full extensible SDK
If SDK_EXT_TYPE is set to "full" then we really ought to be shipping
everything that is expected to be in the SDK, and that includes gdb
(it's already referred to by the environment setup script if nothing
else). This is implemented by using the SDK_INCLUDE_TOOLCHAIN
functionality I just added, since the only material thing that adds on
top of a full SDK is gdb and we should always have the rest of it in a
full SDK anyway.

Fixes [YOCTO #9850].

(From OE-Core rev: 9872dcc25c5cdfb99bda197db08476085f8c7ecc)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Paul Eggleton 0b2ca66874 classes/populate_sdk_ext: filter sstate within the extensible SDK
Use the new oe-check-sstate to filter the sstate artifacts shipped with
the extensible SDK by effectively running bitbake within the produced
eSDK and and getting it to tell us which tasks it will restore from
sstate. This has several benefits:

1) We drop the *-initial artifacts from the minimal + toolchain eSDK.
   This still leaves us with a reasonably large SDK for this
   configuration, however it does pave the way for future reductions
   since we are actually filtering by what will be expected to be there
   on install rather than hoping that whatever cuts we make will match.

2) We verify bitbake's basic operation within the eSDK, i.e. that
   we haven't messed up the configuration

3) We verify that the sstate artifacts we expect to be present are
   present (at least in the sstate cache for the build producing the
   eSDK). Outside deletion of sstate artifacts has been a problem up to
   now, and this should at least catch that earlier i.e. during the
   build rather than when someone tries to install the eSDK.

This does add a couple of minutes to the do_populate_sdk_ext time, but
it seems like the most appropriate way to handle this.

Should mostly address [YOCTO #9083] and [YOCTO #9626].

(From OE-Core rev: 4b7b48fcb9b39fccf8222650c2608325df2a4507)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Paul Eggleton 4253e2e0f3 classes/populate_sdk_ext: allow including toolchain in eSDK on install
If we're to completely replace the standard SDK with the extensible SDK,
we need to be able to provide the standard toolchain on install without
doing anything other than installing it, so that you can install the SDK
and then point your IDE at it. This is particularly applicable to the
minimal SDK which normally installs nothing by default.

NOTE: enabling this option currently adds ~280MB to the size of the
minimal eSDK installer. If we need to reduce this further we would have
to look at adjusting the dependencies and/or the sstate_depvalid()
function in sstate.bbclass which eliminates dependencies, or look at
reducing the size of the artifacts themselves.

Implements [YOCTO #9751].

(From OE-Core rev: ed0d8ed72370df694f720cc13897493478dc1de9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Paul Eggleton cb5d308c48 classes/populate_sdk_ext: set default for SDK_INCLUDE_PKGDATA
We don't absolutely need this - it doesn't change the default
behaviour, but it seems to me we have a convention to set default values
so we should add one here.

(From OE-Core rev: 4c734df1df3c19b0dabb9da5b4dc86b966a0d71c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Paul Eggleton 24f871c801 classes/populate_sdk_ext: show progress when preparing build system
During the extensible SDK installation process the final step is to
prepare the internal copy of the build system. This can take some time,
especially if you have SDK_EXT_TYPE set to "minimal" (downloading
sstate artifacts) and SDK_INCLUDE_PKGDATA set to "1" (restoring
pkgdata for world). To make this a bit less painful, use BitBake's new
quiet mode to display status during this operation so you have some idea
of how it's progressing; instead of redirecting the output to
preparing_build_system.log we grab the last console log and append it
instead.

One result of this change is that you get the errors printed on the
console during normal output rather than this going to the
preparing_build_system.log file first. In OE-Core revision
227d2cbf9e0b8c35fa6644e3d72e0699db9607fa, we changed to always print the
contents of preparing_build_system.log on failure, but now at least the
error contents of that log is duplicated. Besides, I intentionally
didn't print out the contents of that log during normal usage because
it's quite verbose - the bug that we were attempting to fix was about
not getting this information when seeing failures in the automated
tests, thus I've moved printing the log to the test handling code
instead.

Part of the implementation for [YOCTO #9613].

(From OE-Core rev: 0f7cb880c934b7871f3b8432f4f02603300f6129)

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-07-26 08:56:27 +01:00
Paul Eggleton 23ae622a69 classes/populate_sdk_ext: exclude initramfs images from locked signatures
Tasks for image recipes cannot be locked - there's nothing to restore
from shared state to cover them and as a result, if you had "live" in
IMAGE_FSTYPES the build would fail with "taskhash mismatch" errors for
do_rootfs and do_image_complete for the initramfs image recipe, since it
had to try to run those. We should probably catch that issue earlier in
the build and produce a proper error, but for now at least exclude these
signatures from the locked-sigs.inc file so that extensible SDK
installers built when IMAGE_FSTYPES includes "live". (It turned out we
already had code to find other image tasks in the task list in order to
generate the list of install targets.)

Follow-up fix for [YOCTO #9826].

(From OE-Core rev: a7133bf6bb650b944d29d01129f36a56282acd2b)

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-07-08 09:57:25 +01:00
Paul Eggleton c7ab9f3ca1 classes/populate_sdk_ext: ensure tasks to build the image are included
If you build an extensible SDK for an image and IMAGE_FSTYPES includes
"live" then the extensible SDK will fail to install with a bunch of
unexpected task execution errors, matching the missing items required to
build the live image. The issue was we were still depending on do_rootfs
rather than do_image_complete. The fix was slightly more complicated
than just changing the task name as do_image_complete's dependencies are
in the form of dependencies on tasks within the same recipe (represented
in the "deps" varflag rather than the "depends" varflag).

Fixes [YOCTO #9826].

(From OE-Core rev: 2b9c092e89b421bf7fd6a7c9604a83ae420d85ba)

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-07-08 09:57:24 +01:00
Paul Eggleton a702c68c5b classes/populate_sdk_ext: eliminate double execution on install
Use the new BB_SETSCENE_ENFORCE functionality to avoid having to run
bitbake twice on installing the extensible SDK - we can now do it all in
one invocation which not only takes less time, but we should also get
more meaningful errors for some types of failure, in particular where
downloading from an sstate mirror fails.

One result of this change is that you get the errors printed on the
console during normal output rather than this going to the
preparing_build_system.log file first. In OE-Core revision
227d2cbf9e0b8c35fa6644e3d72e0699db9607fa, we changed to always print the
contents of preparing_build_system.log on failure, but now at least the
error contents of that log is duplicated. Besides, I intentionally
didn't print out the contents of that log during normal usage because
it's quite verbose - the bug that we were attempting to fix was about
not getting this information when seeing failures in the automated
tests, thus I've moved printing the log to the test handling code
instead.

Part of the implementation of [YOCTO #9367].

(From OE-Core rev: e1390c1ef85862b91b067ab24f3c06ca506155ad)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00