aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
AgeCommit message (Collapse)Author
2016-10-05classes/sstate.bbclass: Enable thread lock when checkstatusAníbal Limón
The checkstatus function fires an event to notify bitbake UI about the progress of the task, this function is implemented using ThreadPool and is causing event lose when multiple threads tries to fire an event (writes over socket/fd). [YOCTO #10330] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-03sstate.bbclass: Use bb.fatal() instead of raising FuncFailedUlf Magnusson
This sets a good example and avoids unnecessarily contributing to perceived complexity and cargo culting. Motivating quote below: < kergoth> the *original* intent was for the function/task to error via whatever appropriate means, bb.fatal, whatever, and funcfailed was what you'd catch if you were calling exec_func/exec_task. that is, it's what those functions raise, not what metadata functions should be raising < kergoth> it didn't end up being used that way < kergoth> but there's really never a reason to raise it yourself FuncFailed.__init__ takes a 'name' argument rather than a 'msg' argument, which also shows that the original purpose got lost. Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-15sstate: Add postrm command supportRichard Purdie
There are some issues in sstate which can't be handled by file removal alone. Currently there is no way to execute a command against sstate and doing so is potentially problematic for things like dependencies. This patch adds a mechanism where any "postrm" script is executed if its present allowing some openjade/sgml issues to be resolved. [YOCTO #8273] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-14sstate.bbclass: normalize whitelisted pathsMax Krummenacher
Without this a whitelisted path containing /../ breaks the test for a file allowed to be provided by more than one recipe. Noticed when local.conf contains: DEPLOY_DIR = "${TOPDIR}/../deploy" |ERROR: core-image-minimal-1.0-r0 do_image_complete: The recipe | core-image-minimal is trying to install files into a shared area when those | files already exist. Those files and their manifest location are: | .../poky/deploy/images/qemux86/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt | Matched in b'manifest-qemux86-linux-yocto.deploy' Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-04sstate: Avoid duplicate README file errors for sdk under sstate controlRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03sstate.bbclass: skip packaging if SSTATE_SKIP_CREATION is setEd Bartosh
SSTATE_SKIP_CREATION variable will be used to skip creation of sstate .tgz files. It makes sense for image creation tasks as tarring images and keeping them in sstate would consume a lot of disk space. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-25meta-extsdk-toolchain: add meta-recipe to install toolchain into eSDKPaul Eggleton
Add a meta-recipe to bring the toolchain into the extensible SDK. This was modelled on meta-ide-support but some adjustments were needed to the dependency validation function in sstate.bbclass to ensure that all of the toolchain gets installed into the sysroot. With this, after installing a minimal eSDK you only need to run the following after sourcing the environment setup script to get the toolchain: devtool sdk-install meta-extsdk-toolchain Addresses [YOCTO #9257]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20sstate.bbclass: make PV to depend on PV variable valueEd Bartosh
Currently PV is defined in meta/conf/bitbake.conf as a python expression: "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}". As FILE is whitelisted it causes PV to not depend on it. This causes sstate code to not detect that PV changes when recipe filename changes. Making PV to explicitly depend on PV variable value overrides default behaviour. Instead of depending on python expression bitbake depends on evaluated value of PV variable, which should fix the above mentioned issue. [YOCTO #9806] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-07classes/sstate: add a mode to error if sstate package unavailablePaul Eggleton
If BB_SETSCENE_ENFORCE is set to "1" and an sstate package fails to download outside of the whitelist specified by BB_SETSCENE_ENFORCE_WHITELIST, then fail immediately so you can tell that the problem was caused by failing to restore the task from sstate. Part of the implementation of [YOCTO #9367]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-07classes/sstate: show progress during sstate object availability checkPaul Eggleton
Show progress through bitbake's standard terminal UI when checking for shared state object availability, since this can take some time if there are a large number of tasks to be executed and/or the network connection is slow. Part of the implementation for [YOCTO #5853]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Convert to use python3 octal syntaxRichard Purdie
The syntax for octal values changed in python3, adapt to it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-25sstate.bbclass: Don't create symlinks, download to the correct locationRandy Witt
Previously the sstate was all downloaded to the same directory and then symlinks were added in the directories that pointed to the siginfo and sstate in the parent directory. This change makes it so that now the files are just downloaded to the correct location without the need for symlinks. Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-16sstate: Ensure we sort the value used for SSTATETASKS for determinismRichard Purdie
This avoids 'basehash changed' errors with python 3 but could break build determinism in general. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-08sstatesig.py: Split single locked sigs check into multiple checksRandy Witt
Add the SIGGEN_LOCKEDSIGS_TASKSIG_CHECK and SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK variables to replace SIGGEN_LOCKEDSIGS_CHECK_LEVEL. SIGGEN_LOCKEDSIGS_TASKSIG_CHECK will no control whether there is a warning or error if a task's hash in the locked signature file doesn't match the computed hash from the current metadata. SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK will control whther there is a warning or error if a task that supports sstate is in the locked signature file, but no sstate exists for the task. Previously you could only have warning/errors for both controlled by SIGGEN_LOCKEDSIGS_CHECK_LEVEL. This was an issue in the extensible sdk, because we know sstate won't exist for certain items in the reverse dependencies list for tasks. However, we still want to error if task signatures don't match. [YOCTO #9195] Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06useradd.bbclass: remove user/group created by the package in clean* taskMaxin B. John
At present, if a recipe is built which creates users/groups via useradd.bbclass, those users/groups are not removed from sysroot when the recipe/package is cleaned using clean/cleansstate/cleanall or when a recipe is rebuild and 'unstaged' from the the sysroot. The "userdel_sysroot_sstate()" provides that functionality. [YOCTO #9262] Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07sstate: Allow late expansion of NATIVELSBSTRINGRichard Purdie
uninative needs to adjust NATIVELSBSTRING fairly late in the configuration parsing process but the sstate code encodes it into variables. Since this string doesn't vary on a per recipe basis, we defer its expansion until usage time. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19cml1/sstate: Fix missing getVar parameterRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18sstate.bbclass: use oe.gpg_sign for gpg signingMarkus Lehtonen
[YOCTO #9006] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-16sstate: Add ca-certificates-native to postinst recipes listMing Liu
Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10sstate: Ensure populate_lic sstate objects are cleanedRichard Purdie
do_cleansstate wasn't cleaning do_populate_lic sstate objects in the native/cross case since the wildcard path entry wasn't being cleared at the same time as the path extra prefix. Fix by clearing it at the same time. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04sstate: Fix SSTATE_SWSPEC only used by populate_lic tasksRichard Purdie
This variable is only used by populate_lic tasks (gcc-source overrides it) and refers to BPN. In recipes like gcc, where there are multiple variants, it is resulting in sstate objects which encode PN (they install into a PN subdir) but the sstate object reflects BPN. This leads to corruption between then and eventually, warnings from image builds like: WARNING: The license listed GPLv3 was not in the licenses collected for recipe gcc WARNING: The license listed GPL-3.0-with-GCC-exception was not in the licenses collected for recipe gcc WARNING: The license listed GPLv3 was not in the licenses collected for recipe gcc WARNING: The license listed NCSA was not in the licenses collected for recipe gcc-sanitizers WARNING: The license listed MIT was not in the licenses collected for recipe gcc-sanitizers WARNING: The license listed GPL-3.0-with-GCC-exception was not in the licenses collected for recipe gcc WARNING: The license listed GPLv3 was not in the licenses collected for recipe gcc WARNING: The license listed NCSA was not in the licenses collected for recipe gcc-sanitizers By referring to PN, as used by license.bbclass, this issue is resolved. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-31sstate: Revert using -m option to tar in sstateRichard Purdie
In http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=2d89cff42af2bb0049224bfaaebaa2b21966169f we added a workaround for dealing with lack of time sync between build machines and their users. This has turned out to cause problems for people who rely on timestamps being preserved in sstate output. Since our autobuilders are all in time sync with ntp, revert the commit. [YOCTO #8996] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-29sstate: Add back packagedata on packagedata dependenciesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-29sstate: Improve handling of useradd dependenciesRichard Purdie
useradd has sstate [depends] for both do_package and do_populate_sysroot yet the dependency validation code only covers do_package. Add coverage of populate_sysroot, else the order inversion that [depends] creates means unexpected installation of users of useradd.bbclass (e.g. avahi do_populate_sysroot) in cases where it shouldn't be (e.g. libnss-mdns -c packagedata). The code needs to move above the other populate_sysroot intercept code since there are specific cases we need to cover before that code. The result of this change is more optimal installation of sstate objects in common usage scenarios. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-22sstate: display the sysroot name when cleaning for clarityRoss Burton
When cleaning old builds from the sysroots, also print the sysroot architecture. Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-19sstate: replace verbose manifest removal with a single countRoss Burton
If there are lots of changes between the previous build and the build about to start bitbake will potentially print pages of: DEBUG: Stamp $BUILD/stamps/corei7-64-poky-linux/libdrm/2.4.66-r0 is not reachable, removing related manifests Instead of spamming the console with this list, write the list of manifests only to the debug log and simply write a count to the console. This way the user doesn't get spammed but still knows what is happening if bitbake appears to stall with heavy I/O. Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-19sstate: Add packagedata to list of tasks not to recurseRichard Purdie
If we "bitbake X -c packagedata" and the packagedata comes from sstate, we don't need any of the tasks dependencies. This is similar to the populate_lic case, we only care about the end result. Therefore short circuit the dependencies so packagedata doesn't pull in any other dependencies. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14sstate: Ensure populate_lic dependencies are not followedRichard Purdie
It was observed that do_fetch dependencies (e.g. subversion-native of tremor) were being installed even when sstate was available and hence no fetch was needed. This turned out to be due to the recursive nature of the rootfs dependencies which include populate_lic. We can explicitly whitelist these dependencies as being ones we don't need to follow when installing sstate (the code defaults to being paranoid). [YOCTO #8746] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-25sstate: Ensure siginfo and sig files are also touchedRichard Purdie
Maintaining an sstate mirror is complicated at the moment as only the main sstate tgz files have their timestamp updated when they're used. This causes problems as the siginfo files can be removed from the server due to inactivity but the sstate fetch code tries to fetch them leading to confusing warnings and reduced debug capability. This change ensures we touch any sig/siginfo files present and should help ageing of the objects on sstate mirrors. It doesn't handle the intermediate task siginfo files but those are never fetched by the current sstate code so are an order of magnitude less problematic. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24sstate: respect GPG_BIN and GPG_HOMERoss Burton
The package feed signing code supports the user providing the path to the gpg binary and an alternative gpg 'home' (usually ~/.gnupg), which are useful for both deployment and QA purposes. Factor out the gpg command line construction to a function which can fetch both of these variables, and also use pipes.quote() to sanitise the arguments when used in a shell context. [ YOCTO #8559 ] Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-28sstate: run recipe-provided hooks outside of ${B}Ross Burton
To avoid races between the sstate tasks/hooks using ${B} as the cwd, and other tasks such as cmake_do_configure which deletes and re-creates ${B}, ensure that all sstate hooks are run in the right directory, and run the prefunc/postfunc in WORKDIR. (From OE-Core rev: 1d3bde02641f4b40030cf7e305ee3d7c2faabe29) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12classes/sstate: break out function to get sstate manifest filenamePaul Eggleton
It is useful in a few different contexts to see which files have been written out by an sstate task; break out a function that lets us get the path to the manifest file easily. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-12sstate: only fetch remote signatures if verification is enabledRoss Burton
Only fetch remote signatures if verification has been enabled, as otherwise the fetcher throws errors that sstate.bbclass can't ignore. [ YOCTO #8265 ] Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-06sstate: implement basic signing/validationRoss Burton
To provide some element of integrity to sstate archives, allow sstate archives to be GPG signed with a specified key (detached signature to a sidecar .sig file), and verify the signatures when sstate archives are unpacked. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16gtk-icon-utils: Rename, upgrade, add binaryJussi Kukkonen
* Rename from gtk-update-icon-cache to gtk-icon-utils to better reflect the content. Fix references in other recipes and classes * Upgrade to GTK+ 3.16.4 * Add gtk-encode-symbolic-svg binary: it is used by icon themes (e.g. Adwaita) to generate png versions of svg icons. * Depend on librsvg-native for gtk-encode-symbolic-svg * Add a patch that removes Gdk dependency from gtk-encode-symbolic-svg: this way the native build stays slim. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16sstate.bbclass: remove redundant cd and mkdir commandsAndre McCurdy
Update sstate_create_package and sstate_unpack_package to remove redundant initial mkdir and cd commands. The working directory is now setup correctly before the shell functions are called. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-12classes/sstate.bbclass: Improve checkstatus using connection cache.Aníbal Limón
Use FetcherConnectionCache to improve times when do checkstatus over sstate resources. [YOCTO #7796] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-26oe/utils.py: Add support for init/end helper functions in ThreadWorker.Aníbal Limón
Add init/end helper functions for ThreadWorker also pass ThreadWorker as first argument to init/end/func functions this enables per-thread storage handling. classes/sstate.bbclass: Add thread_worker argument to checkstatus function. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26oe/utils.py: Fix thread leakage in ThreadPoolAníbal Limón
In order to fix Thread leakage caused by not call join() in Threads, Pass num_tasks in ThreadPool for add all the tasks into a Queue this enable catch of Queue.Empty exception and exit the threads. classes/sstate.bbclass: Change checkstatus function to match new ThreadPool operation. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23meta: Add explict getVar param for (non) expansionRichard Purdie
Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-10sstate: Add eventhandler which cleans up stale recipe dataRichard Purdie
"Incremental builds do not work well when renaming recipes or changing architecture" is a long standing issue which causes people considerable pain. We've struggled for a long time to come up with a way to generically address the problem. There are additional issues where removal of a layer caused data to continue to exist and additionally, changing DISTRO_FEATURES also caused problems in an existing TMPDIR. This patch attempts to address this by adding a mapping between stamp files and manifests. After parsing we can easily tell which stamp files are still reachable, if any manifest has a stamp that can no longer be reached, we can remove it. Since this code ties this to the sstate architecture list, it will not remove data from other than the current MACHINE (and its active architectures). It does not clean the sstate cache so if another build activates something which was cleaned, it should reinstall from sstate. We can also go one step further, depending on the setting of SSTATE_PRUNE_OBSOLETEWORKDIR, workdirs which are no longer active can also be removed. This avoids the buildup of many old copies of data in WORKDIR for example when versions are upgraded. The one thing which may surprise people with this change is if you remove a layer, data added by that layer will be "uninstalled" before the next build continues. I believe this is a feature and a good thing to do though. This code is safe with existing builds. If something isn't in the new index it simply isn't removed. Since changes to the sstate code trigger a rebuild, after this merges, we can assume the code will start to detect changes from that point onwards. [YOCTO #4102] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-01sstate: Add note when performing sstate mirror checksRichard Purdie
The build can pause whilst remote sstate mirrors are checked for sstate objects. Inform the user this is happening. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-01sstate: Parallelise checkstatus calls for sstate mirrorRichard Purdie
Currently the urls are checked serially which is a performance bottleneck when looking at http:// urls in particular. This adds code to check the url status in parallel, mirroring the way we do this elsewhere. We need the datastore for the fetcher so we use threads, not multiprocess. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20sstate: Add handling of do_shared_workdir taskRichard Purdie
Changing TMPDIR and rebuilding an image was resulting in rebuilds of kernels due to dependencies on the shared_workdir task. If installed from sstate, nothing needs this task so add it to the whitelisted task patterns. After this change, the kernel does not rebuild when a new TMPDIR and hot sstate cache is used. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-15sstate: Improve HASHCHECK function to make siginfo configurableRichard Purdie
In some cases we want to test the availability of siginfo files, in some cases we do not and really want the .tgz files (which may or may not be present too). This makes adds a parameter to the function to allow this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29sstate: Use SSTATE_DIR for FILESPATHRichard Purdie
FILESPATH was only being overridden in one fetch location, it should be equally handled in both. Also use SSTATE_DIR as FILESPATH so that mirror urls which do remapping can search the local SSTATE_DIR for other paths. Also ensure that MIRRORS is removed in both locations, previously it was only unset in one but both codepaths should be consistent. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20Add archiver folder to SSTATE_DUPWHITELISTAdrian
Without this patch the source archiver class is not allowed to archive the same source archive for different builds. Signed-off-by: Adrian <adrian.freihofer@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-10-18sstate.bbclass: Fix up white space lost in last commit.Peter Urbanec
Commit e9672387 split one long line into a multi-line string, but in the process white space between words was lost. This results in badly formatted output when this message is printed. Signed-off-by: Peter Urbanec <openembedded-devel@urbanec.net>
2014-10-18sstate.bbclass: specify func dirs for sstate_hardcode_pathWenzong Fan
For some recipes that inhrient cmake, the ${B} may be removed by cmake_do_configure() while sstate_hardcode_path() running, this causes build errors: Exception: OSError: [Errno 2] No such file or directory: \ '/path/to/build' The function sstate_hardcode_path() called command: $SSTATE_SCAN_CMD which extended as "find ${SSTATE_BUILDDIR} ..." So the proper function dirs could be ${SSTATE_BUILDDIR}. Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-10-10sstate.bbclass: split the too long lineRobert Yang
The too long line would cause "git send-email" report errors: patch contains a line longer than 998 characters Though we can use "--no-validate" to force the send. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>