summaryrefslogtreecommitdiffstats
path: root/bitbake
AgeCommit message (Collapse)Author
2016-05-14bitbake: toaster: use new syntax of except statementEd Bartosh
Used except 'except (<exception1>, <exception2>):' syntax as it's supported by python 2 and pythone 3. Old syntax 'except <exception1>, <exception2>:' is not supported by python 3. [YOCTO #9584] (Bitbake rev: d19e305ffa44a848b02ede63dc5de8d2640089e6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14bitbake: toaster: use print function in toaster scriptEd Bartosh
Used print() function instead of print statement to make toaster script to work with both python 2 and python 3 [YOCTO #9584] (Bitbake rev: 09d37ee51219edcd0be6fd24c82fce392533b39b) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14bitbake: toaster: use 'in' instead of has_keyEd Bartosh
Dictionary method has_key is deprecated in python 2 and absent in python 3. Used '<key> in <dict>' statement to make the code working on both python 2 and python 3. [YOCTO #9584] (Bitbake rev: 3d7ad7ba0d1a6f688ae885817c049f2a8ced11b5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14bitbake: server/process: Fix missing log messages issueRichard Purdie
Currently if the server dies, its possible that log messages are never displayed which is particularly problematic if one of those messages is the exception and backtrace the server died with. Rather than having the event queue exit as soon as the server disappears, we should pop events from the queue until its empty before exiting. This patch tweaks that code so that even if the server is dead and we're going to exit, we return any events left in the pipe. This makes debugging certain failures much easier. (Bitbake rev: 29f6ade68fb2b506a23a7eb3a00cdcffa291b362) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14bitbake: cooker/toasterui: Drop SEND_DEPENDS_TREE UI featureRichard Purdie
Now the event is sent unconditionally we can drop this feature as its no longer needed. (Bitbake rev: 473deeb0fc6065693e1fcfcbb8b79753103db537) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14bitbake: runqueue.py: always emit bb.event.DepTreeGeneratedPatrick Ohly
The data included in the event is useful for implementing a pre-build check that warns about unexpected components, for example because of an incorrect configuration or changed dependencies. Such a check can be done in a .bbclass that gets inherited globally. But in contrast to a UI, such a class cannot request that the event shall be emitted, and thus the event has to be emitted whether there is a consumer or not. This was done conditionally earlier out of concerns about the performance impact. But now events are handled more efficiently, so that concern no longer seems valid: in some simple testing (admittedly on a fast build workstation), the two lines (generating the data and emitting the event with it) only took about 0.05 seconds (measured with timeit). That was for a build with roughly 500 recipes (from pn-buildlist aka depgraph['pn']), triggered via the command line. That was even with a consumer of the data active and doing some work, so it should be even faster when there is no consumer. (Bitbake rev: 5ddaf5b7ed1001d2dd3f67e7a6d704afa85479d2) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: toaster: fix progress bar in MySQL environmentElliot Smith
When using MySQL, the project builds info delivered by MySQL differs from that delivered by SQLite: the former returns text values from the enumeration for Build outcomes, while the latter returns the integer value. This causes the progress bar JS to break, as it is expecting outcome strings. Modify the recent_build() method to include an outcomeText property for each Build object, then use this in the conditionals in the progress bar JS. [YOCTO #9498] (Bitbake rev: 7ac374adf1cc70173ff6cc492bc078bba1cf500b) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: main: Ensure exceptions are correctly displayedRichard Purdie
If the cooker fails to start, ensure a correct exception is displayed to the user. After handling any queued events simply re-raise the original exception else the output can be unclear. (Bitbake rev: 9a4db1aa608c17d31bf5ea1cab5a99beb565dd83) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: cookerdata: Fix log messages and ensure we exitRichard Purdie
The string formatting wasn't correct and we should exit if we hit errors here similar to the other exception handlers. (Bitbake rev: b90a16408a5c45ce5312384f278e19d09f8dda4d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: event/msg: Pass formatted exceptionsRichard Purdie
python3 can't cope with the previous approach we were using to pass exceptions through the RPC. Avoid this by creating a formatted exception on the sender side. (Bitbake rev: d7db75020ed727677afbad07a90fb3eac0bf2c45) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: fetch: Use OrderedDict for url parametersRichard Purdie
Without this, the dict can reorder causing sanity test failures. (Bitbake rev: ca8c91acc9396385834b266d4e8b84d917e5e298) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: main: Change warn() -> warning()Richard Purdie
This avoids a deprecation warning in python 3. (Bitbake rev: bf1a92d0c002d73e8a34472dced1343dc4a4251a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: cooker: Fix log message syntaxRichard Purdie
Ensure we pass the string parameter correctly. (Bitbake rev: 7ed82bd1fe7bdd93b0614119c42eb218dc5d83e6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: utils: Force bitbake to en_US.UTF-8 locale setting everywhereRichard Purdie
Under python 3, if we spawn python processes, we need to have a UTF-8 locale, else python's file access methods will use ascii. You can't change that mode once the interpreter is started so we have to ensure a locale is set. Ideally we'd use C.UTF-8 since OE already forces the C locale but not all distros support that and we need to set something. Was tempted to choose en_GB so colour gets spelt correctly :). This is in some ways pretty nasty, forcing it into the environment everywhere however we only have a limited number of ways of making everything work correctly and this beats having to add utf-8 encoding to every file access command. A similar change will be needed to bitbake.conf in OE. (Bitbake rev: 8902c29638411d312e6fc4a197707e5742652e15) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: bin/bitbake-worker: Fix invalid bb.msg.fatal usageRichard Purdie
The logging domain specified to bb.msg.fatal was invalid. Replace with a logger.critical() call instead. (Bitbake rev: 1ffd8737e065a3cd634c74cd67e634d785ea93a5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: contrib/dump_cache.py, cache: Fix to use python 3 syntaxRichard Purdie
Some tweaks to use python 3 syntax in a python 2 compatible way. (Bitbake rev: 322949c77dbaa4db01b5a43d85b39a2af67ba7b2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: knotty: Ensure consolelog file handle is closedRichard Purdie
If we don't close the console log file handle, python prints a warning about unclosed file handles upon exit which is annoying. (Bitbake rev: 624dd92952b2fc736fd86abe5f2390b87b3a7dd3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: runqueue: Improve timestamp comparisonsRichard Purdie
python3 cares more about invalid type comparisons. Add break statements and better tests to make the code paths clearer and avoid type issues in python3. No code functionality change. (Bitbake rev: 2c39ebdd2762d027f007a6a769fdf023cdf3da2b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: daemonize/prserv/tests/fetch: Convert file() -> open()Richard Purdie
Use python3 compatible functions. (Bitbake rev: e6a0296ba29c3fbc8417d1df7a01d50562668a41) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11bitbake: toaster: tests browser Add test for creating a projectMichael Wood
Add browser tests for creating a project and test validation of duplicate project names. (Bitbake rev: 8055fbe840db426d6859ee2248f86abd44244b30) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11bitbake: toaster: models Add missing import sysMichael Wood
(Bitbake rev: b2fba7a0820d77e1076c05b8ffcd960d4fc883a5) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11bitbake: toaster: ui handles duplicate project name in project pageSujith H
When already existing project name is typed by user, the ui pops up message regarding the existance of the project name. When an existing project is typed the save button will be disabled. Else user can proceed ahead by modifying the project name. [YOCTO #7005] (Bitbake rev: 05ddf48cda6690adab4c097b16387578523e751b) Signed-off-by: Sujith H <sujith.h@gmail.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11bitbake: toaster: ui handles duplicate project name in new project pageSujith H
When already existing project name is typed by user, the ui pops up message regarding the existance of the project name. [YOCTO #7005] (Bitbake rev: 83e5be7e74850f1bb019668de07f3f745063fe38) Signed-off-by: Sujith H <sujith.h@gmail.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11bitbake: toaster: projectNameValidation API addedSujith H
The projectNameValidation API would help users to validate if a project name exists or not. This API is added to libtoaster. [YOCTO #7005] (Bitbake rev: 3b1843553f23d78f1ddfec9f7865895ee42356a3) Signed-off-by: Sujith H <sujith.h@gmail.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11bitbake: runqueue: Fix missing fakeworker under dry runRichard Purdie
We shouldn't try and use fakeworker when performing a dry_run. This makes the core match the other fakeworker execution points. (Bitbake rev: 49bea821a2edad5e19c3a566d1a80c23718dede9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11bitbake: lib/bb/utils.py: Fix explode_dep_versions2() determinism issueRichard Purdie
When we pass data into explode_dep_versions2(), we need to result to be able to be processed in a deterministic way so that we end up with consistent hash values. This means we need an ordered structure rather than an unordered one. To do this, return an OrderedDict() rather than a dict(). (Bitbake rev: 0737e003ca549d08a7dfe13452ae982f2e11fecd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11bitbake: bin, toaster: Fix print and exception syntaxRichard Purdie
This updates the print "" syntax to print() and fixes some exception handling syntax such that its compatible with python v2 and v3. (Bitbake rev: 58304fcce9727fd89564436771356c033ecd22a3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11bitbake: tests: assertEquals -> assertEqualRichard Purdie
The preferred form is assertEqual, assertEquals is deprecated and not present in python v3. This is v2.7 safe. (Bitbake rev: b60261bf8ade14aca31238b50c243c01adcabc59) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11bitbake: bitbake: Update logger.warn() -> logger.warning()Richard Purdie
python deprecated logger.warn() in favour of logger.warning(). This is only used in bitbake code so we may as well just translate everything to avoid warnings under python 3. Its safe for python 2.7. (Bitbake rev: 676a5f592e8507e81b8f748d58acfea7572f8796) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bb.{cooker, data}: only emit a var as python if 'func' is setChristopher Larson
This avoids a common issue where PACKAGECONFIG is emitted as a function in bitbake -e when the 'python' flag exists. It isn't a python function unless both 'func' and 'python' are set. This aligns with the behavior of emit_func_python. (Bitbake rev: c5e45063cb3ae17bbe3304ea5e712bd76e686c4a) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bb.utils: let loaded plugins provide a plugin objectChristopher Larson
This lets us avoid treating the module like an object, so no globals are needed, if one chooses to do so. (Bitbake rev: 71bfd5beb0d0ed88c7c14bbfd5ca1a1b56122bc1) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bb.utils: use imp.get_suffixes for load_pluginsChristopher Larson
Rather than hardcoding .py, use python's knowledge of its file extensions. (Bitbake rev: 09f838dbaefdaedc01a1f4818ed38280b38db744) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bb.utils: add load_plugins from scriptutilsChristopher Larson
Imported as of oe-core 184a256. (Bitbake rev: 99db61bf816d9c735032caa762aae8e6a0803402) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bb.data_smart: use iter() for __len__Christopher Larson
It seems the frozenset constructor in pypy runs len(), so we can't pass the DataSmart instance directly to it, instead pass the iterator. Fixes pypy support. (Bitbake rev: b492836e08745e04bd9ba2fb0b56a680a5fdce79) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bb.event: handle __builtins__ as a moduleChristopher Larson
Fixes pypy support. (Bitbake rev: a3e5d9337f5400aab13df63f261e750178f8a661) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bb.build: handle __builtins__ as a moduleChristopher Larson
Fixes pypy support. (Bitbake rev: e90cfc655affeec8f5519f7078dad5f99db3c461) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bitbake: fetch2: Safer check for BB_ORIGENV datastoreLeonardo Sandoval
BB_ORIGENV value on the datastore can be NoneType thus raising an AttributeError exception when calling the getVar method. To avoid this, a check is done before accesing it. [YOCTO #9567] (Bitbake rev: f368f5ae64a1681873f3d81f3cb8fb38650367b0) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: toaster: bin/toaster Fix noweb commandMichael Wood
For the noweb command we don't need to check if a socket is in use or not as we're not starting the django development server. We're just setting up the environment and running the runbuilds scheduler. (Bitbake rev: f62d9a3e86e384f928fc8ad077d7cf3a75d1591e) 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>
2016-05-06bitbake: toaster: bin/toaster Add ability to specify port and address to bind toMichael Wood
Allow binding to a specified address and port to start the django development server on. Remove the assumption that you want to bind to 0.0.0.0 and set the default to localhost. Add some additional help text after Toaster webserver has started (Bitbake rev: ef3c88a57313947feb5ef08c4fea6fd110cde1e7) 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>
2016-05-06bitbake: toaster: bin/toaster Add help text for unrecognised commandMichael Wood
Add help text for unrecognised or missing command for toaster script Remove assumption that no command is 'start' as the default. (Bitbake rev: 4c0b1b9c2af70838dbcf5a676ec679f9f0c488a5) 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>
2016-05-06bitbake: bitake: main: fix line-too-long pytling warningsEd Bartosh
Wrapped long lines to fix "Line too long" pylint warnings. (Bitbake rev: e329a932e14d002a561245b5026f974897f64598) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bitbake: main: fix bad-continuation warningsEd Bartosh
Fixed pylint warning 'Wrong continued indentation'. (Bitbake rev: 5bfc8c0dc70abd6462a6df4ce905173d9f2cdc07) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bitbake: main: fix bad-witespace pylint warningsEd Bartosh
Fixed pylint warnings: No space allowed around keyword argument assignment No space allowed after bracket No space allowed before bracket (Bitbake rev: c39770239f7b61217501782b9c5e9d3211355d42) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bitbake: main: set defaults from env variablesEd Bartosh
Environment variables BBSERVER, BBTOKEN and BBEVENTLOG silently overwrite bitbake command line arguments. This is confusing and can cause issues that are difficult to debug. It's better to use them as default values instead. Used environment variables BBSERVER, BBTOKEN and BBEVENTLOG to set default values for command line arguments. Changed setting default value of --ui command line argument from BITBAKE_UI to look similar way. (Bitbake rev: 87040be4ff54cd460961318224deef8f2ea4c85a) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bitbake: main: add 2 environment variablesEd Bartosh
Bitbake uses set of environment variables to set command line options, e.g. seeting BBTOKEN variable has the same effect as using --token command line option. Added new environment variables BBPRECONF and BBPOSTCONF that are equivalents of --read and --postread command line options. They can be used by high level scripts to append or prepend configuration files to conf/local.conf [YOCTO #9235] (Bitbake rev: bf604ec1ca4eb4d0b22bcc72249963e6d7445f34) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: toaster: customrecipe Only show download icon or button if it's ↵Michael Wood
possible If the based on recipe has not yet been checked out/cloned we cannot generate the custom image recipe file that uses it. So disable/remove the option to download it. [YOCTO #9425] (Bitbake rev: f08651a954358e9c6ce4d69de285e4cd9e1408ae) 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>
2016-05-06bitbake: toaster: orm Add get_base_recipe_file to CustomImageRecipeMichael Wood
This function returns the base recipe file path only if it currently exists. This allows us to know whether we can proceed at this point with generating a custom image recipe. It also enables us to call this function from the templates to enable visual indication of this state. Some whitespace fixes also added in generate_recipe_file_contents (Bitbake rev: bc30d1b235b9ecacef5b2eaa851b9247d857f317) 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>
2016-04-29bitbake: bitbake: Switch to post release versionRichard Purdie
(Bitbake rev: 309f5907a3661821e041ed14645b5d165007b058) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29bitbake: fetch2: export DBUS_SESSION_BUS_ADDRESS to support authentication ↵Ross Burton
agents Some users may want to use authenticated SSH connections with credentials stored in a keyring, such as gnome-keyring. These typically need a DBus session bus connection, so pass DBUS_SESSION_BUS_ADDRESS into the fetcher environment. To avoid the user needing to set it in their local.conf (which wouldn't be usable) or adding it to the environment-cleansing whitelist (which would potentially impact builds) allow the variables being passed to the fetchers to come from the data store (first) or the original environment (second). (Bitbake rev: 20ad1ea87712d042bd5d89ce1957793f7ff71da0) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19bitbake: toaster-tests: tests for build dashboardElliot Smith
Convert existing tests to Selenium. Add basic tests to check that the modal contains radio buttons to select a custom image to edit when a build built multiple custom images, and to create a new custom image from one of the images built during the build. [YOCTO #9123] (Bitbake rev: c07f65feaba50b13a38635bd8149804c823d446a) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>