aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/staging.bbclass
AgeCommit message (Collapse)Author
2017-02-07staging: Add missing parameter to debug messageRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07staging: Improve file creation resilianceRichard Purdie
If you abort a build mid execution of the staging extend_sysroot function there are currently races and cleanup of that function may fail. This change splits the code into separate phases so that the manifests are manipulated before files are installed, meaning we should be able to reverse actions if builds fail, crash or are interrupted. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07staging: Add shared manifest supportRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07staging: Don't put ptest files into the sysrootRichard Purdie
This wastes space/time as the ptest files aren't going to be used in the sysroot so add them to the blacklist. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-01staging: Reduce the number of mkdirs callsRichard Purdie
The number of mkdir calls was showing up high on the profile charts since it was getting called once per file which is excessive. Each call results in one or more syscalls which is bad for performance. Cache which directories we've seen to reduce the calls to a more reasonable number and speed up recipe specific sysroots. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-01sstate/staging: Batch log messages for performanceRichard Purdie
According to profile data, repeated calls to bb.debug and bb.note in the extend_recipe_sysroot() codepath were accounting for 75% of the time (1.5s) in calls from tasks like do_image_complete. This batches up the log messages into one call into the logging system which gives similar behaviour to disabling the logging but retains the debug information. Since setscene_depvalid is also called from bitbake's setscene code, we have to be a little creative with the function parameters and leave the other debug output mechanism in place. This should hopefully speed up recipe specific sysroots. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28staging: Handle stale sysroot rebuild issueRichard Purdie
If a stale sysroot object was found the complete stamp wasn't removed, meaning later code could fail when the new link creation was attempted. Ensure the stale complete stamp is also removed if present. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28staging: Fix missing nativesdk do_populate_sysroot depends on binutilsRichard Purdie
Recent changes exposed the fact this dependency was missing in nativesdk cases, fix this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28staging: Allow removal of stale sysroot objectsRichard Purdie
The main sysroot components of unreachable build targets will be removed by the core code. This currently doesn't trigger a removal in the individual workdirs. This adds in symlinking between the complete stamps and the component sysroot meaning we can detect when someting was removed and hence remove it from the sysroot. This fixes cases where DISTRO_FEATURES like systemd are changed amongst other things and makes builds more robust against configuration changes. If a dependency is rebuild, that is caught by checksum comparision code elsewhere in this function as before. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28staging: Drop common prefix WORKDIR from manifest filesRichard Purdie
Manifest files containing the same duplicated prefix are wasteful on space and ultimately this costs build time. Drop the WORKDIR prefix from the manifest files since this small change mounts up a lot. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26staging: Handle overlapping files for build-sysrootRichard Purdie
The use of bb.fatal means build-sysroots fails as soon as multiple gdb's are built with overlapping files, or multiple recipes with overlapping headers exist. Change the fatal call into an exception which we can then trap. Also avoid trying to call readlink on something with isn't a symlink. This allows build-sysroots to work better under various scenarios. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26staging/allarch: Remove hardcoded PACKAGE_ARCHS from the classRichard Purdie
The code was making an assumption that the only PACKAGE_ARCH in use was TUNE_PKGARCH. This is incorrect so iterate over the list from PACKAGE_EXTRA_ARCH instead. We also need to change allarch to preserve this variable, else the staging code doesn't function. We do this in a way which clears the variable history so that the task hashes remain unaffected. [Thanks to Andrew Goodbody <andrew.goodbody@cambrionix.com> for testing/fixing] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23classes/oeqa: Replace subprocess.check_call() with check_output()Richard Purdie
If you use subprocess.check_output() the traceback will contain the output when the command fails which is very useful for debugging. There is no good reason not to use this everywhere. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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-19staging: Add dependency on virtual/binutils for strip binaryRichard Purdie
The staging code strips binaries and we need virtual/binutils for that. Add a specific dependency since the one from do_configure and others may not be enough to ensure the binaries are in our own sysroot. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVar callsJoshua Lock
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\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-07staging: Drop unused SYSROOT_LOCKRichard Purdie
This hasn't been used in years and isn't referenced anywhere, drop the definition. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-14staging: Add BB_SETSCENE_VERIFY_FUNCTION2 for bitbake runqueue changesRichard Purdie
We're about to rewrite the data structures in taskdata/runqueue in bitbake and we 'leaked' knowledge about those structures to this single function. Add a 'v2' function definition for use with the newer bitbake, the older one can remain for compatibility for a while, then be removed. The function is comparatively simple and rarely changes. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update xrange -> range for python3Richard Purdie
xrange() no longer exists in python 3, use range() Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13staging.bbclass: Make it easier to define which dirs to stagePeter Kjellerstedt
The directories that should be staged in the sysroot are now specified in the SYSROOT_DIRS variable. Extra directories that should be staged for native are specified in SYSROOT_DIRS_NATIVE. Finally, directories that should not be staged are specified in SYSROOT_DIRS_BLACKLIST. This also removes the sysroot_stage_libdir() function as it is no longer used (it was just a wrapper for sysroot_stage_dir()). Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-21staging.bbclass: remove trail slash from SYSROOT_DESTDIRRobert Yang
Fixed path: QA Issue: <foo> sysroot-destdir//usr/lib/ <foo> Note the 2 slashes "//". Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-22staging.bbclass: make already-stripped can be skippedJackie Huang
Add a check like what we does in package.bbclass so that the already-stripped QA test can be skipped. Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-23staging: Strip files in sysrootRichard Purdie
Add functionality to strip binaries/libraries going into the sysroot. Whilst this does fractionally slow down the build, it also significantly reduces the size of the sstate cache files. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-29staging: Exclude MULTI_PROVIDER_WHISTLIST from do_populate_sysrootRichard Purdie
If you switch between multilib and non-multilib builds, pretty much everything rebuilds due to the use of MULTI_PROVIDER_WHITELIST in do_populate_sysroot. It doesn't need to do this so exclude that variable for checksum purposes. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-24classes/staging: ensure do_populate_sysroot re-execs on changes to sysroot ↵Paul Eggleton
preprocessing funcs Without this dependency, changes to functions added to SYSROOT_PREPROCESS_FUNCS do not change do_populate_sysroot's signature and thus don't cause it to re-execute. Fixes [YOCTO #5852]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-24staging: Save out provider information into the sysrootRichard Purdie
This patch saves out provider information into the sysroot for all providers except those in MULTI_PROVIDER_WHITELIST. This means that we will start seeing warnings when two providers for the same thing are installed into the sysroot. In the future those warnings can be turned into errors. Partially addresses [YOCTO #4102] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-18sstate: Get rid of crazy name mappingRichard Purdie
When originally developed, it was thought a task may have more than one associated sstate archive. The way the code has grown that idea is now not possible or needed. We can therefore assume one sstate archive per task and drop the crazy name mapping code. Simpler is better in this case. The downside is that various sstate archives will change name so this forces a cache rebuild. Given the other sstate changes going in at this time, this isn't really a bad thing as things would rebuild anyway. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-14staging: Use hardlinking for sysroot_stage_dirRichard Purdie
This saves about 2GB on a core-image-sato build so is worth doing and is consistent with our efforts to try and decrease our build footprint. Build time in my local test seemed unaffected but on more IO bound machines it should help. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14bitbake.conf: Remove double slash from PATH_prepend and PKG_CONFIG_DIRMartin Jansa
* we correctly have ${STAGING_DIR_NATIVE}${base_sbindir_native} and then double slash in ${STAGING_DIR_NATIVE}/${base_bindir_native} * similar in PKG_CONFIG_DIR where libdir also starts with slash ${STAGING_DIR_HOST}/${libdir}/pkgconfig * also fix double slash in insane.bbclass and staging.bbclass * I was a bit nervous about staging change (in case the / was important in some weird use-case, but the extra slash is there since following commit where other extra slashes were removed only the one before libdir was kept: commit 6ea78d648951e5bbe9669412c0863daaf7f49ca5 Author: Richard Purdie <rpurdie@linux.intel.com> Date: Mon Nov 2 17:10:51 2009 +0000 autotools.bbclass: Separate out useful staging functions into base.bbclass and call from autotools classes * this isn't fixing any real-world issue AFAIK, I was just trying to debug one weird case where debugedit fails with canonicalization unexpectedly shrank by one character and it's easier to grep for '//' without many harmless instances already in run* scripts etc Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-11classes: tar 1.27 fixesRichard Purdie
tar version 1.27 returns: tar: --same-order option cannot be used with -c with the commandlines we have been using. We can remove the -s option (which is --same-order) to remove the error. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06staging.bbclass: Drop unused/legacy functionRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06staging/insane.bbclass: Move legacy do_stage check iinto insane.bbclassRichard Purdie
We might as well put all the sanity checks in one place. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25staging: Drop obsolete commentsRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-19bitbake.conf: add nonarch_base_lib variableConstantin Musca
Adapt stagging.bbclass to this change Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-08-28staging.bbclass: Might as well drop the applications, fonts and pixmap ↵Richard Purdie
directories from ${datadir} These cause various file conflicts and aren't useful within the sysroot anyway. We might as well remove them. Whitelisting the contents of ${datadir} that *is* useful might be a better option in future. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21meta/classes: Various python whitespace fixesRichard Purdie
It was pointed out we have a number of weird indentations in the python functions. This patch cleans up 3, 7 and other weird indentations for the core bbclass files. It also fixes some wierd (odd) shell function indentation which my searches picked up. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-26staging.bbclass: Add support for invalidtasks parameter (see bitbake change)Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19staging.bbclass: Also don't bother staging locale files, its pointlessRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19staging.bbclass: Ensure the task starts from a clean directoryRichard Purdie
I found that some files were not getting removed from the sysroot, despite them clearly being removed by the recipe. I found SYSROOT_DESTDIR is only ever copied into, not cleaned. This patch ensures its empty when the task starts so that stale files are removed and not persisted. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19staging.bbclass: Don't stage doc/manpage/info filesRichard Purdie
There is no point in having doc, manpage or info files in the staging directory. They just bloat the sstate package size and waste time as they're copied around. We never used to stage these but it crept in when we started staging $datadir. This patch corrects that so they're removed and stop making it into the sysroot. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19Convert tab indentation in python functions into four-spaceRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-26Quoting fixesRichard Purdie
We have various variables which are either not quoted at all or are half quoted. This patch fixes the bad exmaples so everything is consistent. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-01classes: replace 'Poky' with 'OE-core'Koen Kooi
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
2011-11-22staging: Remove debug accidently left inRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-22staging.bbclass: Add BB_SETSCENE_VERIFY_FUNCTION functionRichard Purdie
Since we clean out do_populate_sysroot if do_configure runs, don't allow do_populate_sysroot_setscene functions if we're going to run do_configure. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10Convert to use direct access to the data store (instead of bb.data.*Var*())Richard Purdie
This is the result of running the following over the metadata: sed \ -e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \ -e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-30Add umask task controlMark Hatle
Bitbake now allows the umask to be specified per task. The following tasks will have a umask of 022 set by default: do_configure do_compile do_install do_package do_populate_sysroot do_rootfs do_configure and do_compile need a umask of 022 set because -many- recipes directly copy generated files out of recipe's build directory. Instead of fixing each existing and future recipe, it was shown to be much easier to just set the umask. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2011-02-09Misc hard link fixesMark Hatle
I searched the various classes and looked for copies that should attempt to preserve hardlinks. This fixes the majority of this copies by switching to using tar as the copy method. It also has the side effect of preserving sparse files. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2011-01-28staging.bbclass: Only clean out the sysroot if we rerun configure, not at ↵Richard Purdie
setscene time Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-26staging.bbclass: No need to create these directories any more, also remove ↵Richard Purdie
invalid comment Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>