summaryrefslogtreecommitdiff
path: root/meta/classes/sstate.bbclass
AgeCommit message (Collapse)AuthorFiles
2013-09-24sstate.bbclass: ignore the tar failure.Roy Li1
sstate_package creates hardlink from sysroot to SSTATE_BUILDDIR, and sstate_create_package stores SSTATE_BUILDDIR into a archive file by tar, these two task can be run simultaneously for different packages, and make a hardlink for a file will lead to the change of the links number of file, and if tar is reading this file, it will fail with exit code 1, and report "file changed as we read it": DEBUG: Executing shell function sstate_create_package tar: x86_64-linux/usr/share/aclocal/xorg-macros.m4: file changed as we read it 4b3e353a5[sstate.bbclass: fix parallel building issue] tries to use the tar parameter --ignore-failed-read to fix, but it does not work, and tar parameter --warning=no-file-changed can close the warning, but can not change the exit code. so close shell immediate exit, only fail if tar returns not 1 and 0. Exit codes of tar: http://www.gnu.org/software/tar/manual/html_section/Synopsis.html Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-12sstate.bbclass: fix parallel building issueRoy.Li1
sstate_package creates hardlink from sysroot to SSTATE_BUILDDIR, then sstate_create_package will store SSTATE_BUILDDIR into a archive file by tar, but once other packages install the same file into sysroot, the creating the archive file will fail with below error: DEBUG: Executing shell function sstate_create_package tar: x86_64-linux/usr/share/aclocal/xorg-macros.m4: file changed as we read it This kind of error is harmless, use --ignore-failed-read to ignore it. The error in tar occurs when the timestamp of the file changes and this can happen when the number of symlinks change. The file will be included in the archive. [YOCTO #5122] Signed-off-by: Roy.Li <rongqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01meta: Don't use deprecated bitbake APIRichard Purdie1
These have been deprecated for a long time, convert the remaining references to the correct modules and prepare for removal of the compatibility support from bitbake. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-23sstate: Fix the relative symlink replacement codeRichard Purdie1
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-05sstate.bbclass: Add an extra check for sstate_mirrorsJoe MacDonald1
BB_NO_NETWORK disables any fetching, however if we're using an external sstate cache, we may want to be able to fetch those objects even if we are not fetching the upstream sources. Denote this situation by setting SSTATE_MIRROR_ALLOW_NETWORK in local.conf. When it is found, for sstate cache fetches, mask off BB_NO_NETWORK for the local function. Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-06-11sstate.bbclass: fetch archive+siginfo in a single pstaging_fetchChristopher Larson1
This avoids unnecessary duplication of setup. The only visible change in behavior will be the case if siginfo exists and the archive does not, in which case it'll redownload both, but this doesn't seem unresasonable to me, particularly since the archive is downloaded first, making this case particularly unlikely. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-11sstate.bbclass: kill MIRRORS and FILESPATH to speed up fetchingChristopher Larson1
The default FILESPATH isn't really of use, as we don't expect to find sstate archives buried in layer recipe directories, and the default MIRRORS is intended for use for fetching SRC_URI, not sstate. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07base/useradd/sstate: Ensure do_package setscene has correct fakeroot ↵Richard Purdie1
dependencies The do_package_setscene task needs to depend on fakeroot in order to correctly install its files. We can whitelist the dependency in the sstate handling code for some performance improvements since we only need this if we're installing the package from sstate. Also use an append operator in base.bbclass for clarity. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-04sstate.bbclass: fixup extra hardcoded pathsJackie Huang1
sstate has a logic to fixup hardcoded paths in scripts, but it misses in some specific cases, so add EXTRA_STAGING_FIXMES to the fixup hardcoded paths mechanism, so that we can specify what hardcoded paths need to be fixed in a recipe, e.g. EXTRA_STAGING_FIXMES = "STAGING_BINDIR_TOOLCHAIN" Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09classes/lib: Update to use print as a function callRichard Purdie1
In python 3 print is a function call. In some cases bb.note is a more appropriate call to make. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-01sstate.bbclass: make hard links for staging filesRobert Yang1
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] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-04-29sstate: Set umask to 002 before packaging runsPhil Blundell1
Otherwise we might end up creating directories under sstate-cache with whatever random umask has been selected for the task that we're trying to package. This would be a bad thing since it might result in losing group write access for newly created dirs, and/or losing group read access for the sstate files themselves. Signed-off-by: Phil Blundell <philb@gnu.org> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-04-03classes/sstate: avoid traceback when no files have been stagedPaul Eggleton1
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üller1
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 Polk1
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 Sandoval1
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 Purdie1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05sstate.bbclass: consider postinstall dependencies tooLaurentiu Palcu1
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 Purdie1
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 Purdie1
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 Purdie1
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 Purdie1
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 Purdie1
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 Ertsaas1
as it is not supported. Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-09sstate.bbclass:specify function dirs to avoid raceHongxu Jia1
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 Purdie1
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 Purdie1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17sstate.bbclass: Simplify overcomplicated cleanall functionRichard Purdie1
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 Wold1
Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06sstate: fix typoRichard Purdie1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06sstate: fetch .siginfo files from SSTATE_MIRRORSaul Wold1
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 Jansa1
* 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 Scholz1
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 Purdie1
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 Purdie1
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 Purdie1
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 Purdie1
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 Purdie1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-14sstate: Bump version number to deal with layout fixesRichard Purdie1
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 Purdie1
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 Purdie1
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 Wold1
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 Purdie1
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 Burton1
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 Purdie1
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 Purdie1
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-05sstate: Add extra entries to the sstate duplicate files whitelistRichard Purdie1
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 Purdie1
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 Purdie1
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 Purdie1
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>