aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
AgeCommit message (Collapse)Author
2014-12-08sstate: Fix the relative symlink replacement codeRichard Purdie
ant reported on irc that the sstate absolute to relative symlink creation code wasn't working in klibc. He was correct although the level of breakage is rather surprising since it only worked for one level of symlink (usr/include) with everything else being broken. The reason is probably that nothing really uses absolute paths, we use relative paths where at all possible already. Nothing in the target sysroot should use absolute paths for a start. In this regard, the klibc-dev package is broken and needs fixing. It will currently break when building for one machine, then switching to another of the same TUNE_PKGARCH and installing from sstate but that is a separate issue. This patch fixes the symlink creation code by firstly passing in the correct value we need (where the symlink will end up) and seccondly, actually using it. I've also tweaked the debug message to contain appropriate information and got right of the double "//" value the existing code created in favour of the form './..' which looks neater. (From OE-Core rev: 9b05c65450526522d7358d0c0901b594de546748) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-17sstate: Drop 'SafeDep' code from setscene validation functionRichard Purdie
I have a feeling this code exists from the time before we had proper coverage of one sstate task by another task. At that time it was a "poor" persons version of that idea, we now have much better code internal to bitbake which handles this. Worse, this code actually breaks certain rebuild scenarios, e.g.: bitbake libtool-cross bitbake libtool-cross -c cleansstate rm tmp -rf bitbake libtool-cross would fail as binutils-cross wasn't installed from sstate. The easiest fix is to remove the obsolete/broken code. [YOCTO #5773] (From OE-Core master rev: ccad07f35fb7f959e24fd50d04c7d10dd5cf20d0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-08sstate.bbclass: make hard links for staging filesRobert Yang
Make hard links for staging files instead of copy to save the disk space (3G will be saved for a core-image-sato build), and it doesn't affect much on the build time. The following directories are affected: 1) The sysroot 2) The DEPLOY_DIR 3) The pkgdata [YOCTO #4372] (From OE-Core master rev: 5853e0f482b22258c909268fe71673a29e31989b) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-03classes/sstate: avoid traceback when no files have been stagedPaul Eggleton
If no files have been staged we want to continue without error instead of showing a traceback. Fixes [YOCTO #4056]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-02sstate.bbclass: remove reference to gtk+-nativeAndreas Müller
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-02sstate: add -f to mv when moving sstate files into placeJeff Polk
Under some conditions (ACLs enabled, NFS) mv can interactively prompt before overwriting files. Avoid hanging builds in that case by using -f which should be harmless in other cases. Signed-off-by: Jeff Polk <jeff.polk@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05sstate.bbclass: Enclose sstate search parameter with quotesLeonardo Sandoval
In case filenames have spaces, execution of the function sstater_install will hang, so the print parameter %s must be enclosed with quotes. Signed-off-by: Leonardo Sandoval <leonardo.sandoval@freescale.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05sstate: Add gtk-update-icon-cache-native to postinst recipes listRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05sstate.bbclass: consider postinstall dependencies tooLaurentiu Palcu
When checking the dependencies in setscene_depvalid(), make sure we also consider those dependencies needed when running the postinstalls on host. [YOCTO #3918] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06sstate.bbclass: Ensure build directory is cleaned to start withRichard Purdie
This directory is cleaned upon completion however if a previous build crashes, it can lead to corrpution, hence ensure its clean at the start too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06sstate/path.py: Add copyhardlinktree() function and use for performance ↵Richard Purdie
optimisation Add a function which copys a tree as a set of hardlinks to the original files, then use this in sstate to reduce some of the overhead of sstate package creation since the file isn't actually copied. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-30sstate: Move debug comment to more logical placeRichard Purdie
The same log message gets output multiple times in the log which look confusing and is rather pointless. Move the log message to the correct level. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25sstate: Add optimisation for useradd injected dependenciesRichard Purdie
useradd.bbclass adds sstate dependencies on base-passwd, shadow-native and shadow-sysroot. Due to the way these are injected, they interact badly with the other dependency validation logic and end up pulling in dependencies we don't actually need. This patch adds code to optimise those cases out. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25Split do_packagedata task from do_packageRichard Purdie
Currently, do_rootfs has a dependency on all the do_package output being present due to its usage of the pkgdata directories. This means that if you run: bitbake xxxx-image -c rootfs you end up having to fetch and unpack all the do_package data which is usually large and inefficient. It also means rm_work has to leave all the do_package data lying around so rootfs works. This patch splits the actual creation of the pkgdata directory off into a separate task, "packagedata" which happens immediately after do_package. We can then remap the dependencies so this task is depended upon, not do_package. Sstate can then be programmed not to require do_package at the appropriate times. Whilst this patch doesn't do so, it opens the possibility of rm_work wiping out the do_package output from WORKDIR as long as it also removed the do_package stamp (both normal and setscene variants) and allowing more space savings with rm_work which has been regularly requested. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-15sstate: Do not add the --no-run-if-empty arguement to xargs when on Darwin, ↵Martin Ertsaas
as it is not supported. Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-09sstate.bbclass:specify function dirs to avoid raceHongxu Jia
Specify dirs in which the shell function "sstate_create_package" and "sstate_unpack_package" are executed and don't use ${B} as default dirs to avoid possible race with task do_rootfs at deb image creation time. [YOCTO #3674] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17sstate.bbclass: Improve stamp-extra-info task handling to avoid warningsRichard Purdie
If you change a machine to a different package architecture, you will see sstate errors about overwriting files as the code stands today. Instead it should clean out the files safely and correctly. This patch changes the naming of stamp-extra-info manifest files to avoid this problem. It will potentially trigger warnings during builds in existing TMPDIRs until the system adjusts to the new naming, these are harmless. [YOCTO #3521] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17sstate.bbclass: Remove unused/uneeded variableRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17sstate.bbclass: Simplify overcomplicated cleanall functionRichard Purdie
The code was written before SSTATETASKNAMES existed. Since it does exist, lets simply the code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06sstate: fix typoSaul Wold
Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06sstate: fix typoRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06sstate: fetch .siginfo files from SSTATE_MIRRORSaul Wold
This would be useful for doing siginfo compares to understand why a build is not reusing something when using SSTATE_MIRROR. No error will be reported if it fails to find the .siginfo file [YOCTO #2898] [RP: Small tweaks] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-05sstate.bbclass: fix detection of owners matching sstate filesMartin Jansa
* without this patch: Python 2.7.3 >>> sstate_search_cmd = "grep -rl /OE/jansa-test/shr-core/tmp-eglibc/pkgdata/armv7a-vfp-neon-oe-linux-gnueabi/runtime-reverse/vim-common /OE/jansa-test/shr-core/tmp-eglibc/sstate-control --exclude=master.list | sed -e 's:^.*/::' -e 's:\.populate-sysroot::'" >>> cmd_array = sstate_search_cmd.split(' ') >>> search_output = subprocess.Popen(cmd_array, stdout=subprocess.PIPE).communicate()[0] grep: |: No such file or directory grep: sed: No such file or directory * Adding shell=True and using cmd string instead of array makes it work: >>> search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0] >>> print search_output manifest-armv7a-vfp-neon-gvim.package manifest-armv7a-vfp-neon-vim-tiny.package manifest-armv7a-vfp-neon-vim.package But still isn't 100% reliable, I guess it's caused by some other package being removed from sstate while grep is already running. So sometimes grep can show error on STDERR >>> search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0] grep: /OE/jansa-test/shr-core/tmp-eglibc/sstate-control/manifest-armv7a-vfp-neon-systemtap.package: No such file or directory Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-05sstate.bbclass: fixed file-conflict checkEnrico Scholz
The value of subprocess.Popen().communicate()[0] is a string. Checking for '!= None' will always match causing bogus warnings regarding already staged files. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-26packagegroup/allarch: Convert to use allarch classRichard Purdie
Currently there is some odd behaviour of the packagegroup class in relation to sstate since it sets PACKAGE_ARCH = "all" but does not use the allarch class leading to it being undetected by sstate. Previously it was not possible to use allarch as the recipe couldn't "undo" settings made by the allarch class. Since this no longer happens when PACKAGE_ARCH != all, we can use the allarch class. This patch also fixes up one case we need to preserve TRANSLATED_TARGET_ARCH and ensures sstate only assumes allarch when PACKAGE_ARCH is "all". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-24sstate: Explicitly define populate_sysroot task relationshipsRichard Purdie
Clean up and clarify the populate_sysroot task dependencies. Target sysroot packages do need their dependencies installed, as do some target/cross relationships. We can whitelist the *-initial dependencies as these are never needed indirectly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-24sstate: Add a rule for target sysroot requirements from cross dependenciesRichard Purdie
For example gcc-cross depends on linux-libc-headers and needs it to be present to build/work correctly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-19sstate: Implement a setscene dependency validation routine to allow skipping ↵Richard Purdie
of some sstate installation This is a first attempt at logic to determine when a sstate dependency needs to be installed and when it does not. Its a start at the logic and errs on the side of caution, as it gets wider testing, we can refine the logic as needed. This code should allow a significant performance speedup to certain workflows, for example "bitbake xxx-image -c rootfs" will not populate the target sysroot. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-18sstate: Drop now unneeded python whitelist entriesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-14sstate: Bump version number to deal with layout fixesRichard Purdie
The recent preveeding sstate directory layout fixes made the code do what it was originally intended to do, as can be clearly seen from the code. Unfortunately this changed the contents and layout of the sstate files themselves since the bug was leading to a directory prefix being missing. This is now resulting in chaotic messages on the console since things are getting confused with the two different layouts. The simplest way to resolve this is to bump the version number, hence moving the new layout into its own new namespace. Its worth noting that whilst the failure messages are scary, the failure mode is relatively harmless since it will just fall back to building the data rather than installing from sstate. Usually I'd give more notice of a change like this but under the circumstances, I'm just going to push this in to resolve the failures people are seeing. Initially I thought the problem was limited to some of the -cross packages and therefore of low impact but that is clearly not the case. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-14sstate: Fix various path manipulation issuesRichard Purdie
Fix missing parameter to endswith and pass paths through normpath to remove any duplicate "/" characters which would corrupt other calls like basename. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-14sstate: Be consistent about sstate-inputdirs/outputdirs ending with '/'Richard Purdie
The manifest file can become corrupted if sstate-inputdirs and sstate-outputdirs don't have matching endings. This patch ensures that even if set incorrectly, the code functions as intended, thereby handling manifest corruption safely. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-27sstate: add manifest info for shared file matchesSaul Wold
Present the manifest file that contains the matches for files being installed to a location that already contains that file. This will help to determine which is the correct recipe to fix when this occurs. [YOCTO #3191] Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-10-22sstate: Improve handling of machine specific manifestsRichard Purdie
Now do_package isn't machine specific, we're only left with do_populate_sysroot as a machine specific task. This change marks only the machine specific manifests as machine specific, defaulting to PACKAGE_ARCH for everything else. This means we do less work where there are multiple machines using the same core package architecture and we can start to clean up the sstate duplicate files whitelist. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18sstate: when warnings about sysroot overwrites, say what the recipe wasRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18sstate: Use -m option to tar when unpacking sstateRichard Purdie
We've noticed failures on the project autobuilders where a shared sstate directory is used across multiple builders and the clocks become skewed. Most of the time this causes harmless building but if this happens where an environment is changed (make install vs make in qt4-x11-free for example), the build can fail. This avoids modification times in the future and should make builds safer in shared environments sstate was designed for. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-08sstate: Also add datadir/sgl to sstate whitelist to avoid openjade warningRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-05sstate: Add extra entries to the sstate duplicate files whitelistRichard Purdie
This avoids errors where gcc/binutils get installed to the native sysroot in the same location for multiple package architectures. Ultimately making these native recipes with ${PACKAGE_ARCH} appended to PN will resolve this but hide the warnings until this gets sorted out. Also hide the python and docbook catalog warnings since they're known about, nothing to worry about and we'll aim to clean them up properly in the 1.4 cycle. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-05sstate: Normalise paths before comparing with the whitelistRichard Purdie
Without this, path components like // could break comparisions with the whitelist leading to warnings being displayed to the user unintentionally. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-28sstate: Relax the duplicate file whitelist for nowRichard Purdie
do_package is a machine specific task at the moment due to packagedata. This means do_package tasks and their dependencies rerun between different machines with various duplicate file installations. There are plans to fix this but they're too invasive before release. This patch relaxes the whitelist for sstate duplicate file detection to account for this. Post-release, we re-enable stricter settings once do_package is not machine specific. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-26sstate: Remove master manifest usageRichard Purdie
This was added to allow detection of duplicate files being installed by sstate. There is a much simpler way, just check if the file already exists. This effectively uses the kernel VFS as the cache which is much more efficient. This resolves a significant performance bottleneck (lock contention on a single file) when running builds that are just being generated from sstate cache files. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-26sstate: Fix SSTATE_DUPWHITELIST variable usageRichard Purdie
We need to split this variable before using it. Otherwise a single "/" character in the list whitelists every overlapping sysroot file which was not the intention making the whole thing useless. We'll start seeing warnings about overlapping files now this is working correctly after this patch. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-12sstate: Append to EXTRASSTATEMAPS and add commentRichard Purdie
Appending to EXTRA_SSTATEMAPS is better than just hardcoding a value. Also add a comment about why this is necessary. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-31sstate.bbclass: Remove hardcoded task mappingsRichard Purdie
I've not idea why this got left in but as per the comment, it needs fixing and we shouldn't have hardcoded mappings like this. Lets remove it and dynamically generate the data instead. [YOCTO #3039] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-30sstate: Ensure master.list exists if it doesn't alreadyRichard Purdie
This fixes builds where master.list doesn't already exist. This change was meant to be part of the previous sstate commit but ended up separated. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-30sstate.bbclass: Detect overwriting files in sstate controlled directoriesRichard Purdie
We have a potential problem where two sstate packages try and touch the same file. This adds code which will print a warning whenever this happens. The implementation does but by maintaining a master file list and comparing file accesses against this. There are a number of places we have duplicate accesses which are harmless, mostly in the deploy directory so these are whitelisted. For now the code prints warnings, this could be strengthened in future to become error messages. Whilst working on this code on and off over the past few months various issues were uncovered, some serious. [YOCTO #238] 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-27sstate.bbclass: Add a string representing the lsb release to native/cross sstateRichard Purdie
This patch adds the lsb name and revision to the path used for sstate files. This means that reuse of sstate files between different distributions is restricted by default. The behaviour can be configured using mirror urls, for example: SSTATE_MIRRORS = "file://Ubuntu-11.10/(.*) file://Ubuntu/\1 \n" would map Ubuntu 11.10 to a more generic "Ubuntu" named sstate feed. Usually, more modern distros have increased libc versions for example so whilst more older native/cross sstate packages will usually work on newer distros, the opposite is not true. This patch allows development of policy to better handle this although no default policy is currently being used. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-27sstate: Add a two character subdirectory to the sstate directory layoutRichard Purdie
Currently all sstate files are placed into one directory. This does not scale and causes a variety of filesystem issues. This patch adds a two character subdirectory to the layout (based on the first two characters of the hash) so that files can be split into several directories. This should help performance of sstate in most cases. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-22sstate: Set SSTAGE_PKGARCH for allarch packages to allow reuseRichard Purdie
allarch sstate packages could be marked as machine or package_arch specific. This change ensures they are not. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>