generic-poky/meta/recipes-devtools
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
..
apt apt-package: Include maintenance scripts 2017-01-16 18:05:13 +00:00
autoconf autoconf: Fix AC_HEADER_MAJOR with glibc 2.25 2016-12-20 15:22:16 +00:00
autogen autogen-native: Update to version 5.18.12 2016-11-06 23:35:35 +00:00
automake meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
binutils binutils-2.27.inc: Fix alignment frags for aarch64 2016-12-20 15:22:17 +00:00
bison bison/gettext: add --with-bisonlocaledir to assign BISON_LOCALEDIR 2016-02-28 11:32:58 +00:00
bootchart2 bootchart2: Allocate space on heap for collector chunks 2016-10-01 21:45:55 +01:00
btrfs-tools btrfs-tools: update to 4.8.5 2016-12-17 09:57:03 +00:00
build-compare build-compare: improve deb and ipk checking 2016-07-26 08:56:28 +01:00
ccache ccache: 3.2.4 -> 3.2.5 2016-07-26 08:56:26 +01:00
cdrtools cdrtools-native: Explicitly set EXTRA_OEMAKE as required 2016-02-11 12:27:43 +00:00
chrpath package_regex.inc: split the rest of the entries to their recipes 2015-12-08 10:20:52 +00:00
cmake cmake: update to 3.7.1 2016-12-17 09:57:04 +00:00
cve-check-tool cve-check-tool: fix upstream version check 2016-10-28 16:15:18 +01:00
desktop-file-utils desktop-file-utils-native: update to 0.23 2016-07-20 10:28:46 +01:00
devel-config Remove $COREBASE/LICENSE from LIC_FILES_CHKSUM 2016-10-28 16:15:18 +01:00
diffstat diffstat: upgrade to 1.61 2016-02-19 01:01:24 +00:00
distcc distcc: Don't remove users/groups in postrm 2016-11-04 12:50:54 +00:00
dmidecode dmidecode: Explicitly set EXTRA_OEMAKE as required 2016-02-10 16:06:24 +00:00
docbook-xml Switch to Recipe Specific Sysroots 2017-01-23 12:05:17 +00:00
dosfstools dosfstools: Upgrade 3.0.28 -> 4.0 2016-06-03 13:13:30 +01:00
dpkg meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
e2fsprogs e2fsprogs 1.43 -> 1.43.3 2016-12-17 09:57:03 +00:00
elfutils meta: update patch metadata 2016-07-08 09:57:24 +01:00
expect meta: Drop now pointless manual -dbg packaging 2015-12-16 11:56:30 +00:00
fdisk gptfdisk: Explicitly set EXTRA_OEMAKE as required 2016-02-10 16:06:24 +00:00
file file: 5.28 -> 5.29 2017-01-05 13:54:06 +00:00
flex flex: upgrade to 2.6.2 2017-01-16 18:05:12 +00:00
gcc Switch to Recipe Specific Sysroots 2017-01-23 12:05:17 +00:00
gdb gdb: Upgrade to 7.12 2016-12-20 15:22:16 +00:00
git meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
gnu-config meta: rename perl-native-runtime 2016-01-11 23:26:31 +00:00
guile Switch to Recipe Specific Sysroots 2017-01-23 12:05:17 +00:00
help2man help2man-native: upgrade to 1.47.4 2016-06-15 08:35:02 +01:00
i2c-tools i2c-tools: point SRC_URI at Yocto source mirrors 2016-02-04 23:39:02 +00:00
icecc-create-env icecc-create-env-native: add SUMMARY and tweak DESCRIPTION 2014-01-02 12:50:23 +00:00
icon-naming-utils icon-naming-utils: separate B and S 2015-01-16 23:08:27 +00:00
intltool intltool: Allow nativesdk variant to build 2017-01-20 11:53:49 +00:00
json-c json-c: add BBCLASSEXTEND for native and nativesdk 2016-10-05 10:10:10 +01:00
kconfig-frontends meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
libtool Switch to Recipe Specific Sysroots 2017-01-23 12:05:17 +00:00
m4 m4: Drop unused/unreferenced patch 2015-12-18 12:18:19 +00:00
make meta: update patch metadata 2016-07-08 09:57:24 +01:00
makedevs makedevs: don't restrict device node paths to 40 characters 2016-09-16 15:24:02 +01:00
mkelfimage mkelfimage: fix compile issues 2016-05-25 07:50:17 +01:00
mklibs mklibs-native: fix upstream version check 2016-10-28 16:15:18 +01:00
mmc mmc-utils: Reduce duplication in MIPS variants. 2016-11-15 15:19:53 +00:00
mtd mtd-utils: Upgrade to 2.0.0 2017-01-09 13:39:12 +00:00
mtools mtools: Patch out a useless sanity check 2016-06-03 13:13:30 +01:00
nasm nasm: 2.11.08 -> 2.12.02 2016-08-25 23:03:45 +01:00
opkg opkg: fix conffile errors in 'opkg status' calls 2017-01-16 18:05:13 +00:00
opkg-utils opkg-utils: use D instead of OPKG_OFFLINE_ROOT in postrm 2017-01-16 18:05:14 +00:00
orc orc: Upgrade 0.4.25 -> 0.4.26 2016-11-06 23:35:34 +00:00
ossp-uuid ossp-uuid: use snapshot.debian.org for SRC_URI 2016-08-01 11:47:14 +01:00
packagegroups packagegroup-core-device-devel: add binutils-symlinks 2016-06-16 11:11:40 +01:00
patch meta: Fix Upstream-Status statements 2015-09-12 23:01:53 +01:00
patchelf patchelf: Update to version 0.9 2016-09-15 12:15:07 +01:00
pax-utils pax-utils: upgrade to 1.1.6 2016-06-15 08:35:03 +01:00
perl libxml-parser-perl: Allow nativesdk variant to build 2017-01-20 11:53:49 +00:00
pkgconfig pkgconfig: Update AM_GLIB_GNU_GETTEXT macro 2016-05-17 21:19:30 +01:00
postinst-intercept Remove LIC_FILES_CHKSUM from recipes without SRC_URI 2016-10-28 16:15:21 +01:00
prelink meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
pseudo pseudo: include fix for xattr corruption 2016-11-30 15:48:07 +00:00
python python3-pygobject: enable cairo only when a display is available 2017-01-19 22:47:21 +00:00
python-numpy python-numpy: Use MIPS MACHINE_OVERRIDES to reduce duplication 2016-11-30 15:48:07 +00:00
qemu Switch to Recipe Specific Sysroots 2017-01-23 12:05:17 +00:00
quilt quilt: 0.64 -> 0.65 2017-01-05 13:54:05 +00:00
remake make, remake: make them properly exclude each other 2016-03-28 15:55:48 +01:00
rpm meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
rsync rsync: control ipv6 support based on DISTRO_FEATURES 2016-09-03 23:45:53 +01:00
ruby ruby: upgrade to 2.3.3 2016-12-22 08:50:16 +00:00
run-postinsts run-postinsts: Print message before running deferred postinst scripts 2016-12-08 10:31:30 +00:00
squashfs-tools squashfs-tools: Define FNM_EXTMATCH if not defined 2015-12-12 23:42:55 +00:00
strace strace: 4.13 -> 4.14 2016-12-07 10:38:00 +00:00
subversion Revert "subversion: fix "svnadmin create" fail on x86" 2016-12-22 08:50:16 +00:00
swig swig: upgrade to 3.0.11 2017-01-19 22:47:20 +00:00
syslinux syslinux: remove LDFLAGS manipulation 2016-02-04 23:39:03 +00:00
systemd-bootchart systemd-bootchart: upgrade to 231 2017-01-16 18:05:12 +00:00
tcf-agent tcf-agent: update to 1.4_neon_bugfix branch 2016-08-01 11:47:13 +01:00
tcltk tcl: 8.6.5 -> 8.6.6 2016-08-04 15:22:23 +01:00
unfs3 unfs3: Simplify simultaneous usage of "_append" and "+=" 2016-08-25 23:03:48 +01:00
unifdef unifdef: upgrade to 2.11 2015-12-16 12:12:15 +00:00
vala vala: update to 0.34.4 2016-12-17 09:57:04 +00:00
valgrind valgrind: skip for linux-gnux32 2017-01-09 13:39:12 +00:00
xmlto xmlto: Add libxslt to native DEPENDS 2016-10-07 16:43:57 +01:00
yasm yasm: 1.2.0 -> 1.3.0 2015-06-11 23:59:15 +01:00
zisofs-tools Revert "zisofs-tools-native: Add missing dependency on zlib-native" 2014-03-31 23:04:35 +01:00