summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-01-23Switch to Recipe Specific SysrootsRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22package_rpm: Clean up pointless exception handlingRichard Purdie
The exception handling in this function seemed mildly crazy. Python will given perfectly good or in several cases better information if we let its standard traceback/exception handling happen. Remove the pointless code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22package_ipk: Clean up pointless exception handlingRichard Purdie
The exception handling in this function seemed mildly crazy. Python will given perfectly good or in several cases better information if we let its standard traceback/exception handling happen. Remove the pointless code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22package_ipk: Improve failure debug outputRichard Purdie
Currently if the dpkg-deb command fails you see an error message like this: ERROR: nss-3.27.1-r0 do_package_write_ipk: opkg-build execution failed ERROR: nss-3.27.1-r0 do_package_write_ipk: Function failed: do_package_ipk which is pretty much useless. If we use subprocess.check_output, we see a traceback and then: Exception: subprocess.CalledProcessError: Command '<cmd>' returned non-zero exit status 1 Subprocess output: <output> which is much easier to debug from. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22package_deb: Clean up pointless exception handlingRichard Purdie
The exception handling in this function seemed mildly crazy. Python will given perfectly good or in several cases better information if we let its standard traceback/exception handling happen. Remove the pointless code along with the duplicated key checking which was broken in the inner loop by usage of the wrong variable. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22package_deb: Improve failure debug outputRichard Purdie
Currently if the dpkg-deb command fails you see an error message like this: ERROR: nss-3.27.1-r0 do_package_write_deb: dpkg-deb execution failed ERROR: nss-3.27.1-r0 do_package_write_deb: Function failed: do_package_deb which is pretty much useless. If we use subprocess.check_output, we see a traceback and then: Exception: subprocess.CalledProcessError: Command '<cmd>' returned non-zero exit status 1 Subprocess output: <output> which is much easier to debug from. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22populate_sdk_ext: Add wic-tools to BB_SETSCENE_ENFORCE_WHITELISTRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22Revert "populate_sdk_ext: whitelist do_package tasks"Richard Purdie
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 e30f5002c4f216757ace27ad8d06164716ca46b5.
2017-01-20epiphany: Fix dependencies for recipe specific sysrootJussi Kukkonen
gettext and glib-2.0 tools are required during build. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20meta-environment: Ensure all multilib dependencies are accounted forRichard Purdie
Currently the recipe depends on the mulitlib libcs all being built but the dependencies don't account for this. Fix the DEPENDS so that the requires pieces are all built first rather than relying on luck. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20utils: Factor out common multilib datastore creation functionRichard Purdie
This code is already used in two places and we need it in others so turn it into its own function. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20oe-selftest: devtool: remove use of git -CPaul Eggleton
The -C option isn't available in versions of git older than 1.8.5, and officially we only require git 1.8.3.1 or newer (and the latter is the version you'll find on CentOS 7, so the test fails there). In any case we can simply specify the working directory to runCmd() so just do that instead. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19kernel.bbclass: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
The depmodwrapper dependency is not actually used by the class but anyone using pkg_postinst_kernel-base() will need it. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19cantarell-fonts: inherit pkgconfigJussi Kukkonen
configure fails without pkg-config. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19fontcache.bbclass: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
Qemu is used to run fc-cache on postinstall. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19gconf.bbclass: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
gconftool-2 is used during postinstall. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19gio-module-cache: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
Qemu is used to run gio-querymodules on postinstall. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19gsettings: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
glib-compile-schemas is needed during postinstall. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19gtk-immodules-cache: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
Qemu is used to run gtk-query-immodules-* on postinstall. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19mime.bbclass: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
update-mime-database is used in postinstall. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19update-alternatives.bbclass: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19update-rc.d: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
use_updatercd() will always return true in rootfs generation so checking that is not required. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19dbus: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
systemctl is needed if both systemd and sysvinit are in distro features. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19systemd: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
Qemu is used to run udevadm in postinstall. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19eudev: Add PACKAGE_WRITE_DEPS for postinstallJussi Kukkonen
Qemu is used to run udevadm in postinstall. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19shadow: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
pwconv and grpconv are used in the postinstall script. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19xorg-font-common: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen
mkfontdir and mkfontscale are used in the postinstall script. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19linux-dtb: Add PACKAGE_WRITE_DEP for postinstallJussi Kukkonen
update-alternatives is used in postinstall. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19nss: Add PACKAGE_WRITE_DEPSJussi Kukkonen
nss-native is required in postinst. It's also needed during build so not removed from DEPENDS. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2017-01-19useradd: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs shadow-native, mark the dependency Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19ca-certificates: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs ca-certificates-native, mark the dependency Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19matchbox-session-sato: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs gconf-native, mark the dependency and drop the now unneeded DEPENDS. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19modutils-initsripts: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs systemd-systemctl-native, mark the dependency Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19systemd-compat-units: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs systemd-systemctl-native, mark the dependency Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19psplash: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs systemd-systemctl-native, mark the dependency Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19initscripts: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs systemd-systemctl-native, mark the dependency Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19v86d: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs systemd-systemctl-native, mark the dependency Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19keymaps: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs systemd-systemctl-native, mark the dependency Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19systemd: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs systemd-systemctl-native, mark the dependency Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19pixbufcache: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs qemu-native and gdk-pixbuf-native, mark these dependencies Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19kernel-module-split: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs kmod-native and depmodwrapper-cross, mark these dependencies. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19gtk-icon-cache: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
gdk-pixbuf-native and gtk-icon-utils-native are needed by the postinstall scripts so mark the dependency. The utils may be needed at icon build time too so DEPENDS is unchanged. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19sstate: Drop the depchain isPostDep() checksRichard Purdie
The dependencies of do_package_write_* tasks are either going to be packaging tools needed to build the packages, or, native tools needed at postinst time. Now we've formalised this dependency pattern, drop the hardcoded list and work based on the rule. The package creation tools are usually the same tools needed at rootfs/postinst time anyway so the difference is moot. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19classes/package*: Add support for PACKAGE_WRITE_DEPSRichard Purdie
Add a new variable to allow markup of postinstall (and preinst) script dependnecies on native/cross tools. If your postinstall can execute at rootfs creation time rather than on target but depends on a native tool in order to execute, you need to list that tool in PACKAGE_WRITE_DEPENDS. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19lib/oe/utils: Add build_depends_string functionRichard Purdie
This is useful when manipulating depends strings for task [depends] flags and is slightly easier to parse than some inline python. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19Revert "kernel: Modify kernel modules installation path."Jason Wessel
This reverts commit 0ccb2efe9837e2915c093341a662dffc1df00866. The OVS fails to function and the kernel modules cannot be found by any of the kernel tools such as depmod because they are installed into the wrong directory in multilib 64bit/32bit bulids. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19Revert "linux-firmware: Modify firmware installation path"Jason Wessel
This reverts commit a46a23fed9acd097ecc8ab3985d18688abe7b065. The 64bit/32bit multilib builds break because the kernel's firmware loader cannot find the firmware because it gets placed int the wrong directory. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19Revert "classes/sstate: add a mode to error if sstate package unavailable"Paul Eggleton
It turns out that this check cannot work. We don't have the information to know whether an sstate package is really needed at this point in the execution, so we check the availability for things that we won't actually end up needing later on. Thus we can't fail if some of these aren't found or we'll get needless failures. This check was intended to give earlier more accurate errors when sstate artifacts failed to download, but that's not practical so we'll rely solely on the task execution check that was added within the runqueue. This reverts most of commit 9e711b54487c3141d7264b8cf0d74f9465020190 (we still need to allow BB_SETSCENE_ENFORCE through from the external environment since the eSDK relies upon that.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19classes/populate_sdk_ext: force a known value for TMPDIRPaul Eggleton
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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19core-image-sato: SDK should contain intltool and glib-2.0 tools for NLSRichard Purdie
The SDK (and its tests) need these tools. We happened to be finding them from the native tools in PATH but recipe specific sysroots prevents that. This fixes the SDK to work as originally intended and contain these tools. We have to clear this in the eSDK case since the _append can't be overridden from the class. Ugly, but we'll have to come back to this issue. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>