summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: bitbake: Fix return value checks from subprocess.call()'sMikko Rapeli2017-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Python function subprocess.call() returns the return value of the executed process. If return values are not checked, errors may go unnoticed and bad things can happen. Change all callers of subprocess.call() which do not check for the return value to use subprocess.check_call() which raises CalledProcessError if the subprocess returns with non-zero value. https://docs.python.org/2/library/subprocess.html#using-the-subprocess-module All users of the function were found with: $ git grep "subprocess\.call" | \ egrep -v 'if.*subprocess\.call|=\ +subprocess\.call|return.*subprocess\.call' Tested similar patch on top of yocto jethro. Only compile tested core-image-minimal on poky master branch. (Bitbake rev: aac956a0950c05bf58af1885474cd89bb9c8fbd1) Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add getMessage to MockEventDavid Reyna2017-07-271-0/+6
| | | | | | | | | | | | | The MockEvent needs to not only stand in for Toaster and Bitbake quick events, it also needs to stand in for LogRecord, and for that it needs to provide the new getMessage method. [YOCTO #11440] (Bitbake rev: e95ed33726b2a6d03382e07c6efe2ab574f84ee8) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fail on layers with sub-layerDavid Reyna2017-07-271-3/+8
| | | | | | | | | | | | | | | | | | | | | For layers directories with sub-layers (for example meta-intel), Toaster breaks when trying to exact match a dependency event for that sub-layer against the top level layer directory paths. Given that top the level layer directory paths are unique, adding a test to see if the dependency path is a subset of a top level path is also unique. Also, since a warning was issued the processing should not fail on the assert but instead should continue and gather the recipes and tasks. [YOCTO #11149] (Bitbake rev: e1c769eed2258bb2697e9558f484dd62a3da7399) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fix SDK artifact captureDavid Reyna2017-04-112-3/+31
| | | | | | | | | | | | | | | | | Use the TaskArtifacts event to scan the SDK and ESDK manifests to cleanly collect the respective artifact files. The previous method was broken when the SDK file deployment moved from the do_populate_sdk[_ext] tasks to their sstate tasks. That method is disabled (but not yet removed) in preparation for the rest of refactor work for the parent #10283 work. [YOCTO #10850] (Bitbake rev: 1360d7b847cc01031edb2f4b289fac9560d72fa7) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: Remove extra whitespace after task progress barsPeter Kjellerstedt2017-03-131-3/+1
| | | | | | | | | | | | | For some reason, BBProgress.setextra() always adds a space at the end. This prevents the task progress bars from filling the entire width of the terminal, making them stop one character short. This looks odd when shown together with the main progress bar, which does fill the entire terminal width. (Bitbake rev: 6540e98090d6a88607489a23c063be338bcc3b57) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: resolve missing 'native[sdk]:' prefixesDavid Reyna2017-03-071-0/+8
| | | | | | | | | | | | | | | Some task events are missing the 'virtual:native[sdk]:' prefixes. The Toaster has code to help match missing prefixes, but needs additional help resolving between 'native:' and 'nativesdk:', by way of the '_package' event field. [YOCTO #10849] (Bitbake rev: e455e40ba309837903b9e2d5f1dff55cce1135de) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: brian avery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: ui: Replace depexp with taskexpRichard Purdie2017-02-191-25/+9
| | | | | | | | | | | | | | The data displayed by the depexp UI is buggy, bitbake can't convey accurate runtime dependency information. Convert the UI to become taskexp ("Task Explorer") which provides a graphical way of exploring the task-depends.dot file. This data is accurate and being able to visualise the data is an often requested feature as standard dot file viewers can't usualy cope. (Bitbake rev: 416a496edc692982af2feec768ac4df8fb799853) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: build/uihelper: Show better information about multiconfig tasks on UIRichard Purdie2016-12-221-1/+4
| | | | | | | | | | Currently the UI shows X is building, possibly multiple times but doesn't say which of the multilibs that might be. This adds a prefix to the task name so the mulitconfig being built can be identified. (Bitbake rev: d93ddd185dde53f50aea06ada094bb0d9b5ba4f0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: fix --observe-only optionPaul Eggleton2016-12-141-3/+7
| | | | | | | | | | | If we're in observe-only mode then we cannot run commands that would affect the server's state, including getSetVariable, so prevent that from being called in observe-only mode. (Bitbake rev: 2c5a8661430edebff67ab4a108995033d182b5d6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: make quiet option a level optionPaul Eggleton2016-12-141-7/+28
| | | | | | | | | | | | | | | | | Allow you to specify -q / --quiet more than once to reduce the messages even further. It will now operate as follows: Level Option Result ----- ------ ---------------------------------------- 0 Print usual output 1 -q Only show progress and warnings or above 2 -qq Only show warnings or above 3+ -qqq Only show errors (Bitbake rev: 6cf2582e17c28ca04f5cfb59858c4a9778c700d4) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: depexp: fix string formatting.Ismo Puustinen2016-12-071-1/+1
| | | | | | | | | The parameters to Python string formatting need to be inside a tuple. (Bitbake rev: 3c82af11b89cf251c3e56725a1eed2d3f4bd835b) Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker process: fire heartbeat event at regular time intervalsPatrick Ohly2016-12-072-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The intended usage is for recording current system statistics from /proc in buildstats.bbclass during a build and for improving the BB_DISKMON_DIRS implementation. All other existing hooks are less suitable because they trigger at unpredictable rates: too often can be handled by doing rate-limiting in the event handler, but not often enough (for example, when there is only one long-running task) cannot because the handler does not get called at all. The implementation of the new heartbeat event hooks into the cooker process event queue. The process already wakes up every 0.1s, which is often enough for the intentionally coarse 1s delay between heartbeats. That value was chosen to keep the overhead low while still being frequent enough for the intended usage. If necessary, BB_HEARTBEAT_EVENT can be set to a float specifying the delay in seconds between these heartbeat events. (Bitbake rev: 7cf22ea057d28c54bd98dc1ab7a43402a29ff1f5) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper Clarify log message for build historyMichael Wood2016-11-301-2/+2
| | | | | | | (Bitbake rev: 5accd6c4d1dcdf6609b4ed25c2b5e4faaf7f0909) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper fix _get_layer_version_for_dependencyMichael Wood2016-11-301-12/+20
| | | | | | | | | | | | | This function is simplified by not trying to handle replacing the regex and just compiling and using it for matching. - Fix typo in logger output with undefined variable - Fix pyflake errors (Bitbake rev: ea298ece8d678889cd5bcde46e00545e9a73edb9) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper Simplify layer event to toaster layer functionMichael Wood2016-11-301-41/+28
| | | | | | | | | | | | | | | | | | Simplify the layer event information to layer version object in toaster function. Previously this attempted many different methods of trying to obtain the correct layer from toaster by manipulating the data from the event or the data from the known layers to try and match them together. We speed up and simplify this process by making better use of django's orm methods and by working down the most likely matching methods in order of accuracy. [YOCTO #10220] (Bitbake rev: 6935cc06974ea94c9971ede89b6e8f0eae9c195b) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper toaster-custom-images layerMichael Wood2016-11-301-6/+1
| | | | | | | | | | | | | | | | | | | This fixes the unidentified layers issue by making the toaster-custom-images layer a local layer. By doing this we also fix the git assumptions made for the local layers which stop recipes and other meta data being associated with them. This also removed some of the special casing previously needed when we didn't have the concept of a local (non git) layer. Also rename created flag var to a have a different var for each returned value so that the same value isn't used multiple times. [YOCTO #10220] (Bitbake rev: ba5332d4960d7f4f79aef63136796e2fa67284e3) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui.py: warn if buildstats is missingOlaf Mandel2016-11-041-0/+3
| | | | | | | | | | Like for buildhistory, warn if buildstats is missing from INHERIT. CC: Joshua Lock <joshua.g.lock@linux.intel.com> (Bitbake rev: 3570a8cf94354c8ab07513c304ebae33623fea33) Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper Handle regex pathsbrian avery2016-11-041-1/+26
| | | | | | | | | | | | | | We were presuming that all the layer dependency information was of the form "^/path/to/layer" to we were just stripping the leading "^" off of the layer information when we were matching the layer priorities to the toaster database. This patch splits out the priorities layer match which gets a regex from the task/recipe match which is gets a path. (Bitbake rev: e23b574fe52f416184ee43838b8ab28b5b8eb71d) Signed-off-by: brian avery <brian.avery@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: depexp: Close UI with error message on NoProvider eventJussi Kukkonen2016-10-111-0/+24
| | | | | | | | | | | | | | Without this the UI just sits there doing nothing. Showing an infobar in-UI would be nicer but not much more useful since currently user couldn't do anything in-UI to fix the situation. Implementation is based on the one in knotty. Fixes [YOCTO #9288] (Bitbake rev: eee9231a543f1d0b9ef3cd8377fc46fd23afb97b) Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: ui/knotty.py: Fix signal handling of SIGWINCH in BBProgressAníbal Limón2016-10-091-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the ability to pass default signal handler for SIGWINCH in BBProgress because with multiple instace of BBProgress the original signal handler set by TerminalFilter (sigwinch_handle) is lost. This is a fix for stack trace due to multiple async calls of ProgressBar _handle_resize (ioctl to terminal fd), see: NOTE: Executing SetScene Tasks Fatal Python error: Cannot recover from stack overflow. Current thread 0x00007f70a4793700 (most recent call first): File "/home/alimonb/repos/poky/bitbake/lib/progressbar/progressbar.py", line 183 in _handle_resize File "/home/alimonb/repos/poky/bitbake/lib/bb/ui/knotty.py", line 58 in _handle_resize File "/home/alimonb/repos/poky/bitbake/lib/bb/ui/knotty.py", line 60 in _handle_resize ... File "/home/alimonb/repos/poky/bitbake/lib/bb/ui/knotty.py", line 60 in _handle_resize ... Aborted (Bitbake rev: 812bd49cb569379ee90d5be28a4b6e60645f1e54) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper: Use correct way to get message from ↵Michael Wood2016-10-061-6/+3
| | | | | | | | | | | | | | | LogMessage Use the correct method to get a message value from the LogMessage object rather than constructing it ourselves which is not recommended. This causes an exception when the msg contains a '%' such as when there are wildcards in file names (something2.%.bbappends) (Bitbake rev: 11b3b6a7087554d14a2812a9ae463dce740b879e) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: make error message more informativeEd Bartosh2016-09-301-1/+1
| | | | | | | | | | | | | | | | | Error message ERROR: Unprocessed MetadataEvent <bb.event.MetadataEvent object at 0x7f750e671a58> doesn't give a lot of information about the event. It just prints event object, which is always bb.event.MetadataEvent. Including event type into the error message should make it more informative: ERROR: Unprocessed MetadataEvent TaskArtifacts (Bitbake rev: 603c7c13536d3fa1786270e863688c1d2e511196) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fix 'Unhandled MetadataEvent' errorEd Bartosh2016-09-301-0/+4
| | | | | | | | | | | | New MetadataEvent 'TaskArtifacts' causes this error. Processing of this event will hopefully be implemented in future. For now it should be enough to just skip it. (Bitbake rev: 114a3fe3f23ef09782c5aa18f425d0d0dbdfdd35) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fix handling of EnvironmentErrorEd Bartosh2016-09-301-3/+6
| | | | | | | | | | | | | Due to the bug in processing EnvironmentError exception, toasterui ignores it. As EnvironmentError is a base for OSError and IOError this means that all OSError and IOError exceptions were silently ignored. (Bitbake rev: c8f4ca008bf9396b0ed45d44bfe2220c82a614a9) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: check if file existEd Bartosh2016-09-301-0/+3
| | | | | | | | | | | | | | | | | | Buildinfohelper assumes that all files mentioned in manifest exist in deploy/ directory, which is not always the case. Toaster crashes with OSError trying to call os.stat on non-existing file. Checking if file exists before processing it should fix this. [YOCTO #10185] (Bitbake rev: 54565e7ca84d2722a2454e7fa52cda564b28b527) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: ensure progress bar output is accounted for in displayPaul Eggleton2016-09-231-5/+4
| | | | | | | | | | | | | | | | | | | | When calculating how many lines we'd printed we weren't properly taking the progress bars into account, with the result that sometimes if the last line printed on the terminal wrapped to the next line (which is possible) we backed up less lines than we should have. Additionally, we should always print a newline after updating the progress bar - there's no need to check if there wasn't output (there always will be courtesy of our overridden _need_update()) and we now allow the line to wrap so we don't need to check the other condition either. Hopefully this will fix [YOCTO #10046]. (Bitbake rev: 326d18d96faf02675ba34ad3c3a20cd424b39b91) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: Show task elapsed timeRichard Purdie2016-09-231-1/+10
| | | | | | | | | | | | | Its often useful to know how long a task has been running for. This patch adds that information to the task display, updating every 5s if there were no other updates so the user can see how long tasks have been running for. [YOCTO #9737] (Bitbake rev: 6c42025e5dd7761213be3f82f3252a7892d2239d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper local layer don't construct path using git ↵Michael Wood2016-09-211-3/+5
| | | | | | | | | | | | | | | info When the layer is local source don't try and work out the location of the layer by using the git information (getGitCloneDirectory) [YOCTO #10199] (Bitbake rev: 3dfea5214d4bd006e26630e5024774ecb84ea527) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: unlock BuildEnvirnoment when build is doneEd Bartosh2016-09-211-3/+5
| | | | | | | | | | | | | | | | There is no need to lock build environment before changing build status as this operation is very fast. However, there is a need to unlock it after changing build status. Explicitly unlocked BuildEnvironment after build reaches final status SUCCEEDED, FAILED or CANCELLED. This should allow runbuilds process to pickup next build faster. (Bitbake rev: faa88272d656640c039572c5c8f3e6c56535b6f7) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: notify runbuilds when build status changesEd Bartosh2016-09-211-0/+4
| | | | | | | | | | | | | Called signal_runbuilds API when build is scheduled, cancelled or finished to notify runbuilds process about builds status change. [YOCTO #8918] (Bitbake rev: fe08f0fa4b328908e73695ebbceca87bc86a49f9) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: uihelper: use elif instead of repeated ifRoss Burton2016-09-211-6/+5
| | | | | | (Bitbake rev: a1d6f6425cd9ef9e07344869817517172afd6e27) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: keep layer name in variable history pathDavid Reyna2016-09-081-1/+2
| | | | | | | | | | | | | | When converting variable history file names to relative paths, keep the layer directory's name so that the user can distinguish between conf files with the same name. [YOCTO #8188] (Bitbake rev: 59561d652af91c2099b735084f0e44275d68e637) Signed-off-by: David Reyna <david.reyna@windriver.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: discover kernel artifacts correctlyElliot Smith2016-09-021-4/+7
| | | | | | | | | | | | | | | | | | | | Because some image_license.manifest files contain multiple FILES lines, and because those lines can sometimes not contain a list of files (i.e. they look like "FILES:\n"), we were resetting the list of kernel artifacts when we hit the second "empty" line. Fix by ignoring any FILES line which doesn't list files, and by appending any files found in a valid FILES line, rather than overwriting the existing list. [YOCTO #10107] (Bitbake rev: 927ec3524625ac731326b3c1c1361c2a4d2bd9e1) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui, knotty: don't print taskid followed by taskstring which ↵Martin Jansa2016-08-202-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | are now in most cases identical * unify the format how the task is described * don't show taskid followed by taskstring as the taskstring is different only for setscene tasks (by _setscene suffix) * the duplicated output was introduced by: 2c88afb taskdata/runqueue: Rewrite without use of ID indirection as reported and confirmed as a bug here: http://lists.openembedded.org/pipermail/openembedded-core/2016-June/123148.html * show: NOTE: Running task 541 of 548 (/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package) instead of much longer: NOTE: Running task 541 of 548 (ID: /OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package, /OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package) and similarly for failed tasks: ERROR: Task (virtual:native:/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_install) failed with exit code '1' instead of much longer: ERROR: Task virtual:native:/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_install (virtual:native:/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_install) failed with exit code '1' (Bitbake rev: 696693d45f5eff1226866ed79dbfb67161d8cd3f) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: don't show number of running tasks in quiet modePaul Eggleton2016-08-171-1/+3
| | | | | | | | | | | There's not a whole lot of point showing how many tasks are running when we're in quiet mode, it just looks a bit strange particularly when it's not running any tasks. (Bitbake rev: 5317200d9cd73c6f971bc1b0cfe8692749e27e3a) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: fix task progress bar not starting at 0%Paul Eggleton2016-08-171-2/+5
| | | | | | | | | | If we have the task number here we need to subtract 1 to get the number of tasks completed. (Bitbake rev: 7c78a1cd3f0638ae76f7c7a469b7f667c7c58090) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: buildinfohelper Add handling local layers (i.e. non-git) ↵Michael Wood2016-08-111-4/+23
| | | | | | | | | | | | layers Adds handling of the non-git layers to create and update the corresponding layer objects in Toaster. (Bitbake rev: 0a9b5d7d9655dbb09d458fc6e330e932f0f9dab6) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toasterui: ensure that the Build object is always availableElliot Smith2016-08-112-83/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | Many of the methods in toasterui and buildinfohelper rely on the internal state of the buildinfohelper; in particular, they need a Build object to have been created on the buildinfohelper. If the creation of this Build object is tied to an event which may or may not occur, there's no guarantee that it will exist. This then causes assertion errors in those methods. To prevent this from happening, add an _ensure_build() method to buildinfohelper. This ensures that a minimal Build object is always available whenever it is needed, either by retrieving it from the BuildRequest or creating it; it also ensures that the Build object is up to date with whatever data is available on the bitbake server (DISTRO, MACHINE etc.). This method is then called by any other method which relies on a Build object being in the internal state, ensuring that the object is either available, or creating it. (Bitbake rev: 0990b4c73f194ec0be1762e4e48b1a525d8349fb) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: show progress of recipe parsing in recent builds areaElliot Smith2016-08-112-53/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | Modify buildinfohelper and toasterui so that they record the recipe parse progress (from ParseProgress events in bitbake) on the Build object. Note that because the Build object is now created at the point when ParseStarted occurs, it is necessary to set the build name to the empty string initially (hence the migration). The build name can be set when the build properly starts, i.e. at the BuildStarted event. Then use this additional data to determine whether a Build is in a "Parsing" state, and report this in the JSON API. This enables the most recent builds area to show the recipe parse progress. Add additional logic to update the progress bar if the progress for a build object changes. [YOCTO #9631] (Bitbake rev: f33d51d46d70e73e04e325807c1bc4eb68462f7b) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: orm Remove the layerindex specific up_branch fieldsMichael Wood2016-07-261-3/+3
| | | | | | | | | | | | | | | | | | We don't need to keep track of layerindex data in our database. And using branch==release is very confusing in the schema. Instead use the existing Release definition to keep track of which release a layer_version is for. Remove the Branch model and all references to it. Create a migration path to convert from up_branches to their corresponding releases. (Bitbake rev: f8f4cffe6fd371f3a7e63690c68f3fcb5dc1f297) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: don't display ETA for tasks with progressPaul Eggleton2016-07-261-1/+1
| | | | | | | | | | | | | | | It turns out that progress information we can extract from a task is rarely apportioned closely enough to the time taken for the ETA to be accurate, so showing it is going to be misleading most of the time for anything but the most basic of examples. Let's just remove it and avoid misleading (or worse, annoying) the user. Fixes [YOCTO #9986]. (Bitbake rev: 235db4870b11db97250979e647b54cdb5ce4fbb6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: fix some minor bugs in BBProgressPaul Eggleton2016-07-261-12/+13
| | | | | | | | | | | | If you specify custom widgets then we don't want to assume where the "extra" position is - you should have to specify it, and if it isn't specified it shouldn't just wipe out the last widget or you can start to see odd behaviour if you're modifying the code. (Bitbake rev: 19e33c10feb1637589ceb05b5e8d58b1e012ccb8) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add package manifest path to Target objectsElliot Smith2016-07-191-3/+21
| | | | | | | | | | | | | | | | | | | Store the path to the *.rootfs.manifest file for targets which generate images. A link to the package manifest is displayed in the build dashboard for targets which produce image files. Like the license manifest path, if a target would have produced the package manifest (but didn't, because it already existed), that path is copied from the target which did produce the package manifest. (Bitbake rev: 79b8e349a0da2ea6b97ad82daa5837e6dfffe0af) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: only record image files for tasks which make imagesElliot Smith2016-07-191-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | If a target is built which is classified as an "image" target (e.g. "core-image-minimal"), Toaster reads the list of files in the image (from the files-in-image.txt file). However, Toaster continues to do this for builds which don't produce images, if the recipe providing the target is an image recipe. This can result in a list of files in the image being attached to a target which didn't produce an image (e.g. rootfs). When associating files with an image, ensure that only targets with a task which produces an image have "files in the image" associated with them. [YOCTO #9784] (Bitbake rev: 44375d0c2a88e0070b8067c9285b89c54eaf3152) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: improve scan for SDK artifactsElliot Smith2016-07-192-44/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SDK artifacts were previously picked up by toaster.bbclass and notified to buildinfohelper (via toasterui). The artifacts were then added to the Build object, so that it wasn't clear which artifact went with which target; we were also unable to attach SDK artifacts to a Build if they had already been attached to a previous build. Now, toaster.bbclass just notifies the TOOLCHAIN_OUTPUTNAME when a populate_sdk* target completes. The scan is moved to buildinfohelper, where we search the SDK deploy directory for files matching TOOLCHAIN_OUTPUTNAME and attach them to targets (not builds). If an SDK file is not produced by a target, we now look for a similar, previously-run target which did produce artifacts. If there is one, we clone the SDK artifacts from that target onto the current one. This all means that we can show SDK artifacts by target, and should always get artifacts associated with a target, regardless of whether it really build them. This requires an additional model, TargetSDKFile, which tracks the size and path of SDK artifact files with respect to Target objects. [YOCTO #8556] (Bitbake rev: 5e650c611605507e1e0d1588cd5eb6535c2d34fc) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: fix retrieval of targetsElliot Smith2016-07-191-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When buildinfohelper records the targets for a build, it looks up any existing targets for a build and creates them if they are not present. This is because in the case of Toaster-triggered builds, the Target objects have already been created (inside triggerBuild()) and don't need to be recreated; but in the case of cli builds, the Target objects have to be created by buildinfohelper. The issue is that the code for retrieving an existing target for a build only looks for Targets with a matching target and build, e.g. Targets for build X with target "core-image-minimal". But it is perfectly legitimate to call bitbake with a command like "bitbake core-image-minimal:do_populate_sdk core-image-minimal:do_populate_sdk_ext". In such a case, the code which looks for matching targets finds two objects, as it doesn't filter by task. Add the task into the filter for the Target so that only one Target object is be returned. Note that a command line like "bitbake recipe:task recipe:task" will still cause an error as bitbake doesn't de-duplicate the command line arguments and will run the recipe:task combination twice. (Bitbake rev: 1c0a689fdaae6469d4afb98583161073d32ea50b) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: attach kernel artifacts to targetsElliot Smith2016-07-191-29/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bzImage and modules files were previously attached to a build, rather than to the target which produced them. This meant it was not possible to determine which kernel artifact produced by a build came from which target; which in turn made it difficult to associate existing kernel artifact with targets when those targets didn't produce artifacts (e.g. if the same machine + target combination was built again and didn't produce a bzImage or modules file because those files already existed). By associating kernel artifacts with the target (via a new TargetArtifactFile model), we make it possible to find all the artifacts for a given machine + target combination. Then, in cases where a build is completed but its targets don't produce any artifacts, we can find a previous Target object with the same machine + target and copy its artifacts to the targets for a just-completed build. Note that this doesn't cover SDK artifacts yet, which are still retrieved in toaster.bbclass and show up as "Other artifacts", lumped together for the whole build rather than by target. [YOCTO #8556] (Bitbake rev: 9b151416e428c2565a27d89116439f9a8d578e3d) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: do image and artifact scan on BuildCompletedElliot Smith2016-07-192-26/+181
| | | | | | | | | | | | | | | | Move the image and artifact scan code from toaster.bbclass and consolidate its logic with the existing logic in buildinfohelper. Remove handler setup for events which used to be fired from toaster.bbclass but which are now handled directly by buildinfohelper. [YOCTO #8556] (Bitbake rev: f0085cd554604cfff4a3f40a34825fbb6878004f) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: avoid errors when fetching outside of a taskPaul Eggleton2016-07-191-3/+4
| | | | | | | | | | | | In a few places we use the fetcher code to fetch files outside of a task, for example uninative in OE. In that case the pid of the event is 0 and that was causing an error in BBUIHelper.eventHandler(). Check the pid and do nothing if it's 0. (Bitbake rev: 59cb919e5cd5c653fb4d69b2d6a4320648443e10) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: buildinfohelper: ensure task datetimes are timezone-awareElliot Smith2016-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | When using toaster-eventreplay to run a bitbake event file through toasterui/buildinfohelper, errors occur when the tasks are updated with buildstats info: RuntimeWarning: DateTimeField Task.started received a naive datetime (2016-07-06 09:15:22.070000) while time zone support is active. This is because a method in buildinfohelper returns a naive datetime, but Django is expecting timezone-aware datetimes. Ensure that datetimes used to set the started/ended times on tasks are converted to timezone-aware datetimes. (Bitbake rev: df9f4337bec87024ea6a43138c6080a755eb7fab) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>