aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
AgeCommit message (Collapse)Author
2013-06-10classes/buildhistory: split SDK data by IMAGE_NAMEPaul Eggleton
Data from SDKs produced from different images or different meta-toolchain style recipes should go into separate directories, since SDK_NAME doesn't include anything to differentiate these by default (only pieces for the distro name and architectures). Note you should delete or move existing data under the buildhistory/sdk/ directory manually after this change. Fixes [YOCTO #4622]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-06-04classes/buildhistory: record removals in buildhistory directoryJonathan Liu
"git add ." does not record files that were removed in the buildhistory directory. Specify the -A flag to also record removals. This was discovered by the following warning added in Git 1.8.3: warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal', whose behaviour will change in Git 2.0 with respect to paths you removed. Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-23buildhistory: Sync with bitbake changesRichard Purdie
Adjust to the recent changes in the git fetcher. This code should work with current and previous versions of bitbake and can be cleaned up when we move to new bitbake versions. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-10classes/buildhistory: track contents of selected files in imagesPaul Eggleton
Add a BUILDHISTORY_IMAGE_FILES variable specifying a space-separated list of files within an image to copy into buildhistory, so that changes to them can be tracked. Typically this would be used for configuration files, and by default this includes /etc/passwd and /etc/group, but the user is free to extend this list by setting the variable in local.conf. Implements [YOCTO #4154]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-03buildhistory: change default BUILDHISTORY_DIR to TOPDIRMartin Jansa
* like PERSISTENT_DIR I find BUILDHISTORY_DIR more persistent then tmp-eglibc directory * WARN: people with existing checkouts in TMPDIR/buildhistory need to move it to new location first (in order to save history) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-09classes/buildhistory: fix interaction with rm_workPaul Eggleton
Change do_write_srcrevs to a postfunc of do_fetch, avoiding a dependency being created that causes large numbers of setscene tasks being executed on every build with both buildhistory and rm_work being enabled. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-04buildhistory: record tag names and show warning when the same tag ↵Martin Jansa
corresponds to different revision * persistent cache records tag-srcrev mappings, but is not shared between builders * when tag is moved in remote repo, all builders should rebuild the component to use the same source, show warning when revision is different than what was used in last build Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-03-29classes/buildhistory: improve SRCREV recordingPaul Eggleton
Collect SRCREV information in a separate task and write it out in a format which is more consistent with the rest of the buildhistory output. Using a task means that SRCREV values will also be recorded for native recipes and not just target ones, and the new formatting also correctly handles multiple entries in SRC_URI. Also adds scripts/buildhistory-collect-srcrevs which will report on all of the recorded SRCREV values in a format suitable for use in global configuration (e.g. local.conf or a distro inc file) to override AUTOREV values to a fixed set of revisions. Example output: # emenlow-poky-linux SRCREV_machine_pn-linux-yocto = "b5c37fe6e24eec194bb29d22fdd55d73bcc709bf" SRCREV_emgd_pn-linux-yocto = "caea08c988e0f41103bbe18eafca20348f95da02" SRCREV_meta_pn-linux-yocto = "c2ed0f16fdec628242a682897d5d86df4547cf24" # core2-poky-linux SRCREV_pn-kmod = "62081c0f68905b22f375156d4532fd37fa5c8d33" SRCREV_pn-blktrace = "d6918c8832793b4205ed3bfede78c2f915c23385" SRCREV_pn-opkg = "649" Some notes on using this script: * By default only values where the SRCREV was not hardcoded (usually i.e. AUTOREV was used) are reported - use the -a option to see all SRCREV values. * The output statements may not have any effect in the face of overrides applied elsewhere; use the -f option to add the forcevariable override to each output line to work around this. * The script does not do any special handling for multiple machines; however it does place a comment before each set of values specifying which triplet they belong to as shown above. Relates to [YOCTO #3041]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-27classes/buildhistory: ensure SDK package lists include complementary pkgsPaul Eggleton
We need to get in after complementary package installation, so use _append instead of +=. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-23classes/buildhistory: trim trailing spaces in file listingsPaul Eggleton
These are mildly annoying when viewing git diffs of the buildhistory repository, so let's just get rid of them. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-23classes/buildhistory: implement history collection for SDKsPaul Eggleton
SDKs are constructed in a similar manner to images, and the contents can be influenced by a number of different factors, thus tracking the contents of produced SDKs when buildhistory is enabled can help detect the same kinds of issues as with images. This required adding POPULATE_SDK_POST_HOST_COMMAND and SDK_POSTPROCESS_COMMAND variables so that data collection functions can be injected at the appropriate points in the SDK construction process, as well as moving the list_installed_packages and rootfs_list_installed_depends functions from the rootfs_{rpm,ipk,deb} to the package_{rpm,ipk,deb} classes so they can also be called during do_populate_sdk as well as do_rootfs. Implements [YOCTO #3964]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-07buildhistory.bbclass: add support for SRCREV loggingConstantin Musca
- create "latest_srcrev" for each recipe with the following format: ${BB_FILENAME},${SRC_URI},${SRCREV},${FROM_AUTOREV} [YOCTO #3041] Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-03-05buildhistory: Allow the version backwards check to be disabledRichard Purdie
When the PR service is not enabled, the versions can go backwards and there are cases we don't want to know about this. This patch adds a variable allowing these checks to be turned off whilst still using buildhistory. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11buildhistory: record more R* variablesPaul Eggleton
Add RPROVIDES, RREPLACES, RCONFLICTS and RSUGGESTS to the list of tracked variables. Of these, RPROVIDES is always output, whereas the others are only output if they have a value (since it is more common that they don't). Implements [YOCTO #3391]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package: Create global package file list and use throughout PACKAGEFUNCSRichard Purdie
Currently we do a signficant amount of tree traversal in many different places which in inefficient. We can assume that the files don't change and cache the file list which gives an efficiency improvement which this patch does using a global variable. (From OE-Core rev: 2d7608842d2dab07065e60aab729a5c8fd6b7907) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-28buildhistory.bbclass: track also complementary package informationAndreas Müller
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-10-18buildhistory.bbclass: Fix hostname print for 'No changes' caseOtavio Salvador
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-20Replace "echo -e" with "printf" to have the same behavior in dash or bashAndrei Gherzan
oe-core removed the prerequisite to have sh as bash. POSIX doesn't define any options and furthermore allows 'echo -e' to be the default behavior. This means that in dash 'echo -e' will actually print '-e' and interpret backslashes by default. We use instead 'printf' builtin command with or without '\n' to simulate 'echo -e' or 'echo -n'. 'printf' needs format while 'echo' can be used without any arguments. So 'echo >' was replaced by 'printf "" >'. 'echo' without '-n' flag adds a new line by default so to keep the same behavior of two new lines while using 'echo "\n"', 'printf "\n\n"' is used. [YOCTO #3138] Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-06classes/buildhistory: save metadata revisionsPaul Eggleton
Always write the metadata revisions for each layer into a machine- readable "metadata-revs" file so that you can potentially link changes in the output back to changes in the metadata. (Unlike the existing similar build-id file, this is not specific to image changes.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-06classes/buildhistory: record PKG/PKGE/PKGV/PKGRPaul Eggleton
Save PKG (the actual output package name, which is often different due to debian renaming), and PKGE/PKGV/PKGR (which may be manipulated in certain special cases e.g. gitpkgv.bbclass in meta-oe, the external-sourcery-toolchain recipe, etc.) Note that these are only written when they are different from the normal package name in the case of PKG, or PE/PV/PR for the other variables. Also, use PKGE/PKGV/PKGR instead of PE/PV/PR when comparing package versions since these actually represent the version that the package manager sees. Implements [YOCTO #2787]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-06classes/buildhistory: save preinst/postinst/prerm/postrmPaul Eggleton
Write the value of these package script variables into the packageinfo so that any changes to them can be tracked (in separate files since they are multi-line). Inspired by an earlier patch from Andreas Müller <schnitzeltony@googlemail.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-06classes/buildhistory: remove unused functionsPaul Eggleton
getlastrecipeversion and readRecipeInfo weren't called anywhere. Remove them so we don't have to keep them up-to-date with future additions to the recipe info file. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-06classes/buildhistory: ensure old package info is removedPaul Eggleton
If a package is removed from PACKAGES, ensure that the package info file and directory are removed from buildhistory so that we don't have stale data lying around. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-06classes/buildhistory: remove obsolete flat package history featurePaul Eggleton
Remove the ability to set BUILDHISTORY_KEEP_VERSIONS = "1" to save the package history as flat versioned files rather than relying on git to keep previous versions of the package information. git has proven to work quite well in this capacity. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-28buildhistory: improve performance of image info collectionPaul Eggleton
Reduce the number of calls to the packaging tool, especially in the case of rpm, using helper utilities to gather the required information more efficiently where possible. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-07-19buildhistory.bbclass: Fix python whitespaceRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19Remove a number of unneeded import os/bb callsRichard Purdie
The bb and os modules are always imported so having these extra import calls are a waste of space/execution time. They also set a bad example for people copy and pasting code so clean them up. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-04buildhistory: fix multiple commit of images and packages at the same timePaul Eggleton
The echo line here was merging multiple lines into one, and the result was that if both image and package changes had to be comitted then only the image changes were being committed and the package changes could potentially be merged into the next package change. Quoting the variable reference fixes this. Fixes [YOCTO #2411] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-01buildhistory: make seperate commits for every changed top level entry in the ↵Koen Kooi
buildhistory dir This seperates out image changes from package changes making the image diffs a lot easier to read. Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-01buildhistory: record all buildsKoen Kooi
When nothing has changed an empty commit prefixed with "No changes" will get generated so that the commit log of the buildhistory repo provides a complete log of all builds performed, not just those that resulted in changes. Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-01buildhistory: remove duplicate entries from dot graphKoen Kooi
There are various conditions that lead to duplicate entries in the dot graph which need to get fixed, but this patch is a catchall. A previous attempt to address this only works on rpm which gives a \n seperated output, opkg doesn't. Another benefit is that the sort order is now know, leading to less spurious diffs in buildhistory commits. Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-19buildhistory: avoid reruns of do_packagePaul Eggleton
Avoid triggering a rerun of all do_package* tasks when OEBasicHash signature generator is being used and the buildhistory package code or any of the package related variables change. Note that adding and removing INHERIT of buildhistory will still force this rebuild - use the newly added BUILDHISTORY_FEATURES variable to enable and disable buildhistory instead in order to avoid this. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-03-19buildhistory: allow disabling image and/or package historyPaul Eggleton
Add a BUILDHISTORY_FEATURES variable which can be set to "" to disable buildhistory with the class still inherited. BUILDHISTORY_FEATURES by default contains two items - image and package. You can use these to disable the image and package history functions individually - this is particularly useful if you want to get the image contents and dependency graphs but don't need the package history. Additionally, ensure we quit shell procedures gracefully by using return instead of exit. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-02-21classes/buildhistory: fix splitting on + in package list fieldsPaul Eggleton
Ensure we do not erroneously split on + in RDEPENDS/RRECOMMENDS e.g. libstdc++-dev was being split into libstdc and -dev. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-02-21classes/buildhistory: use hostname instead of reading /etc/hostnamePaul Eggleton
For the purposes of querying the hostname to include it in the commit message, it seems "cat /etc/hostname" does not work on the Yocto Project autobuilder machines, and it's likely that the hostname command will be more generally reliable, so use that instead. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-02-21classes/buildhistory: sort FILELIST in package infoPaul Eggleton
The FILELIST order can vary depending on the order the files were written which may change between builds with no ill effect, so sort the list prior to writing it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-02-21classes/buildhistory: sort and de-dupe dependency graphsPaul Eggleton
Sort dependencies of each package which sometimes change order and cause noise in the buildhistory repo, and at the same time remove duplicates (which seem to be common especially for the RPM package query output). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-02-21classes/buildhistory: squash spaces out of image variablesPaul Eggleton
Values of image variables that are lists (e.g. IMAGE_INSTALL) are easier to read if there are no extraneous spaces in them, so ensure that there is only one space between each item. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-02-08classes/buildhistory: sort list fields in package infoPaul Eggleton
Sort DEPENDS, RDEPENDS, and RRECOMMENDS in package info files so that any changes in order (which are not important) are smoothed out in the change history. Fixes [YOCTO #1961] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-02-08classes/buildhistory: sort image file listPaul Eggleton
Sort the contents of files-in-image.txt to avoid unnecessary changes showing up in the history due to reordering. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-01-19buildhistory: record additional image infoPaul Eggleton
Record some additional information about images - the uncompressed size of the final image as well as the values of various variables that may have influenced its contents. This is recorded in a machine-readable "image-info.txt" file similar in structure to the package history files. Also add some code to analyse changes to these values. (Most of the variable values aren't monitored directly but will be used as contextual information when they change at the same time as the content of the image changing.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-06classes/buildhistory: remove redundant package history checking stubPaul Eggleton
The code that would have gone here has been superseded by the buildhistory analysis functionality implemented in meta/lib/oe/buildhistory_analysis.py and scripts/buildhistory-diff, so remove it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-01-06classes/buildhistory: make the package version backwards error non-fatalPaul Eggleton
Just make it a bb.error when a package version goes backwards, it doesn't make sense to fail the build immediately; the error(s) will still be reflected in bitbake's exit code. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-01-06classes/buildhistory: add hostname to commit messagePaul Eggleton
If we're building on multiple hosts then it's useful to have the hostname in the commit message. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-01-03buildhistory: improve git commit robustnessPaul Eggleton
* Check if BUILDHISTORY_DIR exists before doing anything with it, in case no tasks that would have created it have executed * Ensure the git repo in BUILDHISTORY_DIR is initialised with "git init" before attempting to do anything with it * Check if any files have been added or changed before adding and committing, to avoid an error from "git commit" Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-01-02buildhistory: avoid quoting issues with the layer list for build-idChristopher Larson
--4ef4ab1d_66334873_12d0c Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline The layer list is multiline, and includes quotes, so including it within quotes is problematic, particularly if the revision includes characters which are not valid outside of a quoted string in shell. To reproduce this failure: do a build with an scm layer not on a branch. Signed-off-by: Christopher Larson <chris_larson@mentor.com (mailto:chris_larson@mentor.com)>
2011-12-06buildhistory bbclass: avoid absolute paths for files-in-image.txt to avoid ↵Koen Kooi
diff churn when relocating TMPDIR Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-05classes/buildhistory: do not save old packagehistory files by defaultPaul Eggleton
Disable storing package history as version named files unless BUILDHISTORY_KEEP_VERSIONS is set to 1; otherwise the adds of these files that duplicate what is already in git anyway is just noise in the git log. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-05classes/buildhistory: merge in package history functionalityPaul Eggleton
Include package history collection from packagehistory.bbclass (thus superseding it). The only change is to store package history under BUILDHISTORY_DIR/packages and rename one of the functions. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2011-12-05classes/buildhistory: add new output history collection classPaul Eggleton
Create a new build output history reporting class, using testlab.bbclass from meta-oe as a base. This records information from images produced by the build process in text files structured suitably for tracking within a git repository, thus enabling monitoring of changes over time. Build history collection can be enabled simply by adding the following to your local.conf: INHERIT += "buildhistory" The output after a build can then be found in BUILDHISTORY_DIR (defaults to TMPDIR/buildhistory). If you set up this directory as a git repository and set BUILDHISTORY_COMMIT to "1" in local.conf, the build history data will be committed on every build. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>