aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
AgeCommit message (Collapse)Author
2016-08-10buildhistory: output package variables in a repeatable orderRoss Burton
This code was outputting variables by iterating a dictionary. In Py2 this always results in the same iteration order but with Py3 the order changes every execution, which resulted in buildhistory having to store diffs where fields were simply re-ordered. Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-25classes/buildhistory: ensure eSDK sstate lists sorted secondarily by namePaul Eggleton
I got fed up with seeing items dance around in sstate-package-sizes.txt in the buildhistory git repo simply because they have the same size. Let's sort the list first by size and then also by name to ensure items with the same size are deterministically sorted. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-25classes/buildhistory: add additional variables for eSDKPaul Eggleton
Add SDK_INCLUDE_PKGDATA and SDK_INCLUDE_TOOLCHAIN to the variables that we put into sdk-info.txt Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Complete transition to python3Richard Purdie
This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update to explictly create lists where neededRichard Purdie
Iterators now return views, not lists in python3. Where we need lists, handle this explicitly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update to match python3 iter requirementsRichard Purdie
python3 standardises its use of iteration operations. Update the code to match the for python3 requires. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update to use python3 command pipeline decodingRichard Purdie
In python3, strings are unicode by default. We need to encode/decode from command pipelines and other places where we interface with the real world using the correct locales. This patch updates various call sites to use the correct encoding/decodings. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-15buildhistory: don't alter SDK creation stampsRoss Burton
This class adds functions to the SDK creation hooks, so ensure that they're ignored in task stamps. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-04classes/buildhistory: fix grammar in commentsPaul Eggleton
Fix a minor grammatical error in the comments here. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-04classes/buildhistory: fix filtering of depends-nokernel.dotPaul Eggleton
For images we produce a number of filtered dependency .dot files for readability, the first of which is depends-nokernel.dot which filters out just the kernel itself (not kernel modules). Unfortunately the filter specifications hadn't been updated for the dash-to-underscore removal or the 4.x kernel upgrade, thus the filtering wasn't actually doing anything. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-04classes/buildhistory: optimise getting package size listPaul Eggleton
Invoking oe-pkgdata-util in turn for every package in the list was slow with a large image. Modify oe-pkgdata-util's read-value command to take an option to read the list of packages from a file, as well as prefix the value with the package name; we can then use this to get all of the package sizes at once. This reduces the time to gather this information from minutes to just a second or two. Fixes [YOCTO #7339]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-29buildhistory.bbclass: create image directory when neededPatrick Ohly
buildhistory_get_imageinfo() assumed that the buildhistory directory for the image had already been created earlier. That assumption is not true for special images (like the virtual swupd images from meta-swupd) where the entire traditional do_rootfs/do_image is skipped. Creating files-in-image.txt still makes sense for such images, so support them by creating the directory also in buildhistory_get_imageinfo(). Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12classes/buildhistory: record a few more variables for extensible SDKPaul Eggleton
We've recently added SDK_EXT_TYPE and SDK_RECRDEP_TASKS and these will have an effect on the size and functionality of the SDK, so record them in sdk-info.txt. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-15buildhistory.bbclass: remove out-dated information on requestPatrick Ohly
buildhistory.bbclass by design is incremental: each build adds or updates information. Information is never removed. Sometimes it can be useful to reduce the information only to those recipes that were build during a specific bitbake invocation, for example when the invocation does a full world build. This is now possible by setting BUILDHISTORY_RESET as explained in the modified class. The comment on the variable also mentions the caveats associated with using this mode. In this mode, buildhistory.bbclass first moves all existing information into a temporary directory called "old" inside the build history directory. There the information is used for the "version going backwards" QA check. Then when the build is complete and before (potentially) committing to git, the temporary directory gets deleted. Because information that has not changed during the build will be reconstructed during full world rebuilds, a git log will then only show real updates, additions and removals. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15classes/buildhistory: fix for python function parsing changePaul Eggleton
Variable expressions are no longer expanded in python functions as of BitBake commit 8bf33a8e92c0e188fa392030025756196c96fcbb, so we've now got to do this explicitly here. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-13buildhistory: Fix regex to handle versions without spacesRichard Purdie
Its valid to have dependencies like XXX (=2.1) without spaces, as injected by debian.bbclass. The code was breaking these into separate components and destroying them so improve the regex to handle them. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-29buildhistory: fix the check for existence of a git repoMarkus Lehtonen
Previously, in order to determine the existence of an already initialized Git repository we checked if a directory named '.git' was present in the buildhistory dir. However, e.g. in the case of git submodules '.git' may also be a regular file referencing some other location which was causing unwanted behavior. This patch changes buildhistory.bbclass to check for any file named '.git' which fixes these problems. [YOCTO #8911] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-20lib/oe/rootfs: Use list_pkgs() instead of list()Mariano Lopez
This patch changes the use list_pkgs() instead of list() from class RpmPkgsList. The change is in two functions, image_list_installed_packages from rootfs.py and sdk_list_installed_packages from sdk.py. With this change the functions calling the functions listed above, must format the output as they required. The formatting can be done using format_pkg_list() from oe.utils. The classes calling the afected functions are changed too with this patch, to keep the same functionality using the new data structure. [YOCTO #7427] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-13classes/buildhistory: save auto.conf and bblayers.conf for extensible SDKPaul Eggleton
These form part of the configuration for the extensible SDK, we should really be recording what goes into them. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-07classes/buildhistory: actually use KiB in extensible SDK sizes filesPaul Eggleton
I was using bytes here for the sizes and writing out KiB as the suffix. Change it to actually write out size values in KiB. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-12-27buildhistory: improve support for extensible SDKPaul Eggleton
* Ensure extensible SDK and standard SDK go into their own directories * Record extra extensible SDK variables * Write sstate-package-sizes.txt and sstate-task-sizes.txt files so you can analyse the size of the contents * Add BUILDHISTORY_SDK_FILES (similar to BUILDHISTORY_IMAGE_FILES) and default it to pick up config files installed in the extensible SDK Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-12-27buildhistory: fix not recording SDK informationPaul Eggleton
After OE-Core revision baa4e43a29e45df17eaa3456acc179b08d571db6 we lost recording SDK the contents in buildhistory. This was due to the SDK_POSTPROCESS_COMMAND variable being set with = in populate_sdk_base.bbclass which overwrote any value set with += in buildhistory.bbclass; to fix it, use _append in buildhistory.bbclass instead. Fixes [YOCTO #8839]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-12-01buildhistory.bbclass: support extending the content of the build historyPatrick Ohly
The idea behind the implementation of Yocto #8138 was that an additional class can write additional files in the recipe directories, for example by hooking into the functions of buildhistory.bbclass or by implementing its own SSTATEPOSTINSTFUNCS function. However, when these additional files get created before buildhistory_emit_pkghistory(), they get removed again by that function because it contains code which removes everything it does not know about. The reason for that is that these unknown items are probably obsolete. This logic is the reason why the additional "kconfig" file from buildhistory-extra.bbclass never showed up in the final build history. To fix this, the hard-coded list of known files in buildhistory_emit_pkghistory() must be turned into a variable which derived classes can extend. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-11-24bbclass: fix spelling mistakesMaxin B. John
Fix some spelling mistakes in bbclass files Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-11-16classes/buildhistory: split package history values only oncePaul Eggleton
We don't actually use values we read in here that are likely to contain = characters but we might as well split the value properly in case we do in future. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30classes/buildhistory: add build result to commit messagePaul Eggleton
We have the command in the commit message, we might as well have the build result as well (succeeded/failed and whether or not it was interrupted by the user). The interrupted part relies upon a change to BitBake to extend the BuildCompleted event to include an attribute for that, but will not fail if the attribute is not present. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30classes/buildhistory: include metadata revisions in commit messagePaul Eggleton
We do already commit these into the repository itself, but have them in the commit message as well as a reference. As part of this, refactor out running "git commit" into a separate function so we don't have to duplicate the code in the two places we call it. Implements [YOCTO #7966]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30classes/buildhistory: handle additional files at recipe levelPaul Eggleton
Avoid an error when attempting to remove previous data if it's not a subdirectory - we were assuming that anything that wasn't named "latest" or "latest_srcrev" had to be a directory. This makes it possible to have a buildhistory_emit_pkghistory_append which writes additional files at the recipe level. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30classes/buildhistory: fix permissions in package file listingPaul Eggleton
If we want the correct file permissions to show up here as they would on the target, we need to run the command under pseudo. Normally we'd set the fakeroot varflag on the function and that would be enough, but it turns out that setting fakeroot on a non-task function that you execute using bb.build.exec_func() isn't working at the moment. Work around this by simply using FAKEROOTENV and FAKEROOTCMD. Unfortunately that means we have to duplicate the command for the two cases but I couldn't find a better means of doing that that actually works. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30classes/buildhistory: tweak buildhistory_list_pkg_filesPaul Eggleton
* Avoid using ${...} for shell variables (since they could be expanded as bitbake variables if present) * Use files-in-package.txt rather than files-in-<packagename>.txt; the file is already in a subdirectory named with the package name and this naming is consistent with that of files-in-image.txt. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30classes/buildhistory: indent recently added function consistentlyPaul Eggleton
Shell functions use tabs in this file. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30classes/buildhistory: exclude . in file listingsPaul Eggleton
We don't care about the permissions on the top-level directory in which the files are contained, just everything under it; this also avoids lists with just this entry in it for empty packages. Affects file listings for both images and packages. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30classes/buildhistory: ensure we push when "no changes" commits are madePaul Eggleton
If there aren't any changes, we still make a commit to the buildhistory repo, but this wasn't being pushed if BUILDHISTORY_PUSH_REPO is set. Move the push to the end to make it unconditional. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-16buildhistory.bbclass: Check output folder is present before creating ↵Leonardo Sandoval
files-in-$pkg.txt This is just a safe check to make sure the output folder is present, before creating the files-in-$pkg.txt file. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-27buildhistory.bbclass: Create a files-in-<pkg>.txt containg recipe's pkg filesLeonardo Sandoval
A file similar (in format) to files-in-image.txt is created for each recipe's build package. This would allow to easily see what the recipe's package may install when including it into an image. These files reside on the specific buildhistory recipe package (i.e. buildhistory/packages/i586-poky-linux/busybox/busybox-dev/files-in-busybox-dev.txt for busybox-dev package) [YOCTO #5870] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-23classes/buildhistory: ensure that git user email and name are setPaul Eggleton
The git user.email and user.name settings must be set or the commit to the buildhistory repo (when BUILDHISTORY_COMMIT is set to "1") will fail. If the user hasn't set these, set some dummy values since the actual value is unlikely to be particularly useful and it's far worse for the commit not to be done leaving the repository in a partially set up state. Prompted by [YOCTO #6973]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14oe-pkgdata-util: improve command-line usagePaul Eggleton
* Use argparse instead of optparse for standardised help output, options and a much cleaner code structure * Look up pkgdata directory automatically so the user doesn't have to specify it * Use standard logging NOTE: this does mean a slight change in syntax - if you do want to specify the pkgdata directory (usually only necessary if you're calling it from within the build process) you need to use the parameter -p (or --pkgdata-dir) and specify this before the command, not after it. Examples: oe-pkgdata-util find-path /sbin/mke2fs oe-pkgdata-util lookup-recipe libelf1 oe-pkgdata-util read-value PKGSIZE libc6 oe-pkgdata-util -p /home/user/oe/build/tmp/sysroots/qemux86-64/pkgdata read-value PKGSIZE libc6 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-02-03classes/image: ensure uninstalled packages do not appear in manifestsPaul Eggleton
Since the rewrite of the image construction code in python a few releases ago, we remove a couple of packages from the image as one of the final steps when constructing the image (notably update-rc.d and run-postinsts). However, because of the order of operations, these packages are still listed both in the buildhistory installed_package*.txt files and in the manifest file created next to the image, which is wrong. There were two possible solutions to this: (1) change the order such that the uninstallation occurs before calling ROOTFS_POSTPROCESS_COMMAND or (2) add another hook variable in such that we can have the package list collection code run at the right time. Because it's currently possible (but very much not recommended) to install additional packages within ROOTFS_POSTPROCESS_COMMAND, which may have postinstall scripts and thus require the packages we would otherwise uninstall if we were to take option 1, option 2 is really the least likely to cause problems. Therefore, add ROOTFS_POSTUNINSTALL_COMMAND and make the image and buildhistory classes use it. Fixes [YOCTO #6479]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-11-09image-buildinfo.bbclass: new class, writes build information to imageAlejandro Hernandez
Writes build information to target filesystem on /etc/build such as enabled layers, their current status and commit. squashspaces was moved to oe/utils.py to make it available to different classes and avoid code duplication. [YOCTO #6770] Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-09-10classes/buildhistory: fix for sstate class changePaul Eggleton
SSTATEPOSTINSTFUNCS is now set with = in sstate.bbclass, and because the line here in buildhistory.bbclass ends up being parsed before that we now need to use _append or the value we are adding will be wiped out. This fixes buildhistory no longer recording package information since OE-Core revision 9d659c6f20fa4a141b491c62a3ef0dfb1f896d9c. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-25buildhistory: Restore parsing time optimalizationMartin Jansa
* it was added in: http://git.openembedded.org/openembedded-core/commit/meta/classes/buildhistory.bbclass?id=540a2a30be21c3eca4323efbe91e7dcfc31a4c97 * then accidentally removed in: http://git.openembedded.org/openembedded-core/commit/meta/classes/buildhistory.bbclass?id=6db6c74f2876df7a183990426bb4262972966441 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-18buildhistory: rename build-id to build-id.txt and add more infoMartin Jansa
* use .txt extension like other reports (e.g. image-info.txt) it's also useful when looking at the file from web server which doesn't have text/plain as default content-type * include whole BUILDCFG_HEADER/BUILDCFG_FUNCS instead of just layer info * this makes it easier for distro to include more fields without the need to modify buildhistory.bbclass * currently it adds following fields: Build Configuration: BB_VERSION = "1.23.1" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "Gentoo-2.2" TARGET_SYS = "x86_64-oe-linux" MACHINE = "qemux86-64" DISTRO = "shr" DISTRO_VERSION = "2013.07-next-20140725" TUNE_FEATURES = "m64 core2" TARGET_FPU = "" Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-08*.bbclass (shell): avoid pipe with sedMatthieu Crapet
Replace: cat <file> | sed -e xxx By: sed -e xxx <file> Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-04-25Globally replace 'base_contains' calls with 'bb.utils.contains'Otavio Salvador
The base_contains is kept as a compatibility method and we ought to not use it in OE-Core so we can remove it from base metadata in future. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21buildhistory.bbclass: create proper dependency files for SDKLaurentiu Palcu
The old functions were calling the list_installed_packages() wrapper function that only listed the packages in an image rootfs. Even for target/host SDK. Also, a python crash was possible if 'bitbake -c populate_sdk core-image-*' was called without calling 'bitbake core-image-*' first. That's because the wrapper was always looking into the image rootfs... This commit fixes the problem and calls the right wrapper for image/sdk. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11buildhistory.bbclass: Fix dependency files creationLaurentiu Palcu
Call the new python routines. [YOCTO #5904] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07classes/buildhistory: fix task signatures changingPaul Eggleton
Fix task signatures for recipes that add to SSTATEPOSTINSTFUNCS changing when adding and removing INHERIT += "buildhistory" (really this time!) This relies on the BitBake vardepvalueexclude feature, however it will not fail without it - signatures will be changed in that case though. Part of the fix for [YOCTO #5897]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-02-20buildhistory.bbclass: fix creation of installed packages listLaurentiu Palcu
Call the new python routines to create the packages list. [YOCTO #5831] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-02-13buildhistory.bbclass: create wrapper functions around ↵Laurentiu Palcu
buildhistory_get_sdk_installed bb.build.exec_func() does not allow passing arguments to the executed scripts. Use wrappers instead. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11classes/buildhistory: avoid buildhistory triggering rebuilds (again)Paul Eggleton
Postfuncs are now incorporated into task signatures as of BitBake rev b84d010144de687667cf855ddcb41c9b863c236e, so we need to exclude the one we're adding to do_fetch. The change to the SSTATEPOSTINSTFUNCS variable value was also entering the signatures of do_populate_sysroot and probably other tasks, so we need to use a slightly hacky trick to avoid that as well. Apart from the final do_rootfs / do_populate_sysroot, this now means that adding and removing INHERIT += "buildhistory" will not cause tasks to be re-run. Also update the copyright date, properly this time. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>