summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-09-12command: Add command to invalidate parse cachepaule/parsecache-invalidatePaul Eggleton
If we make a change to the metadata within a tinfoil-using script and then attempt to run tasks using build_targets(), the change won't get noticed. Add an explicit command that will set the internal flag to force reloading the cache and thus pick up the changes. This will be used in OE by the devtool source extraction rework. Part of the fix for [YOCTO #11198]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-09-11toaster: update pyro to rocko as stable releaseDavid Reyna
Update the Toaster stable release selection to 'Rocko' and the bitbake version to '1.36'. [YOCTO #12037] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11toaster: handle early exceptionsDavid Reyna
Stop the pending build and report to the user if there is an internal exception due to a git error, a bitbake server error, or if the server-only mode halts due to for example a user syntax error in a layer or recipe. These exceptions were not caught because they occure before the normal toastergui processing was started. [YOCTO #12056] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-07tests/fetch: handle network failures gracefullyRoss Burton
If there is a network failure the return value from latest_versionstring() is ('','') which later causes an exception when comparing versions. Improve this by checking the return value and failing the test early. [ YOCTO #12053 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-07fetch2: add stub latest_versionstring to FetchMethodRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-07Replace deprecated git branch parameter "--set-upstream"Andre Rosa
Since 2017-08-17 (git version 2.14.1.473.g3ec7d702a) using deprecated git branch parameter "--set-upstream" causes a fetcher error. Replace it by "--set-upstream-to". https://git.kernel.org/pub/scm/git/git.git/commit/?id=52668846ea2d41ffbd87cda7cb8e492dea9f2c4d says, it's deprecated since 2012-08-30 so hopefully all still supported host distributions have new enough git to support "--set-upstream-to". ERROR: PACKAGE do_unpack: Fetcher failure: ...; git -c core.fsyncobjectfiles=0 branch --set-upstream master origin/master failed with exit code 128, output: fatal: the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead. ERROR: PACKAGE do_unpack: Function failed: base_do_unpack Signed-off-by: Andre Rosa <andre.rosa@lge.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-05cooker: clear extra config settings and remote datastores on client disconnectPaul Eggleton
When the UI disconnects, we can throw away any server-side remote datastores we created in response to calls from the UI, and we *must* drop everything in extraconfigdata or it will taint any future operations. Dropping extraconfigdata upon disconnect fixes taskhash mismatch errors when running devtool.DevtoolTests.test_devtool_update_recipe_local_files within oe-selftest with BB_SERVER_TIMEOUT=100 in OpenEmbedded. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-05cooker.py: Fix layer priority processingMark Hatle
If you have a layer with a blank BBFILE_PATTERN the layer was ignored when processing the list of layers with priorities. This list is not only used for processing recipes, but also by additional programs such as bitbake-layers show-layers. Without this change, a layer that provides configuration or classes only does now show up in show-layers, which is used by the yocto-compat-layer.py script. This causes a failures in the compatibility check. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-05siggen: move reset() definition to base SignatureGenerator classPaul Eggleton
If we're implementing reset() in SignatureGenerator at all (and we need to for a basic non-OE BitBake setup where that is the default signature generator), then we need it to be clearing out the internal values properly. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-04toaster: edit column list not sortedDavid Reyna
The list of columns in the many 'Edit Columns' pop-ups became unsorted with the 'Toaster Table' implementation. These entries need to be gathered and sorted in the column processing. [YOCTO #12004] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-04toaster: recipe links broken for default layersDavid Reyna
The default layers are missing the recipe link definitions in the fixture files, and because they are predefined they do not get the updated information from the Layer Index. [YOCTO #12006] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-04toaster: missing ToasterSetting importDavid Reyna
The file "lsupdates.py" is missing the import of 'ToasterSetting', and that breaks setting up and updating Toaster and its database. [YOCTO #12036] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-04toaster: set default pokydirname if no external layersOlaf Mandel
If no external layers are defined, pokydirname is not set. Rectify this by taking the 'be.sourcedir' as the pokydirname. [YOCTO #12015] Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-04toaster: debug message for lists layers missing separatorsOlaf Mandel
One of the debug messages during build contains a list of all layers but without spaces or other separators between them. Use pformat instead. [YOCTO #12014] Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-04toaster: Order column in Tasks selectableAwais Belal
The build page provides tables related to performance that cover build time, CPU time and disk IO. The "Edit columns" drop down does not allow selection of the Order column and makes it hidden as well which is not accurate from user interaction point of view. This patch enables the hideable property for the Order column so it is hidden by default but the user can enable it through the drop down if need be. [YOCTO #11040] Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-04toaster: display error when the fstype select is emptyDavid Reyna
There must be at least one FSTYPE selected in the Toaster bitbake variable editor page. When the user deselects all the "Save" button gets disabled, but the error message is missing. [YOCTO #8126] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-01cooker: Ensure parseConfiguration clears parsecache_validRichard Purdie
BB_SERVER_TIMEOUT=100 oe-selftest -r bblayers was failing and highlighted that since parseConfiguation clears data structures, it needs to also clear parsecache_valid as it no longer contains correct data. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31cookerdata/taskdata/runqueue: Drop remaining tryaltconfigs code and ↵Richard Purdie
commandline option I can't actually see how this was working, nothing connected the commandline option to the data in TaskData(). Drop the remaining pieces of this option, it was a relic from a decade ago and we want deterministic builds, not random tries until something might work. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31siggen: Add reset to SignatureGeneratorCaio Marcelo de Oliveira Filho
Fix failure after commit "cooker/siggen: Reset siggen when reparsing" (e4c6ca9440f63761560b49bbe12654441f54687e) when executing without specifying a BB_SIGNATURE_HANDLER. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31cooker: Ensure buildFile doesn't have lasting side effectsRichard Purdie
BB_SERVER_TIMEOUT=100 oe-selftest -r devtool.DevtoolTests.test_devtool_build_image fails, the reason is that internally, the limited_deps flag is set in the bitbake server and then never cleared. This causes the sysroots to be setup incorrectly (as per the limited dependency case) and builds break. There is also potential for corruption of recipecaches. Add shutdown/cleanup code to ensure these effects don't 'stick'. This bug is particularly nasty as you can destroy TMPDIR with large sysroots in build work directories which are prone to break. Also ensure mtime cache is cleared (to match buildTargets) and that no lasting changes are made to siggen either which ensures: BB_SERVER_TIMEOUT=100 oe-selftest -r devtool.DevtoolTests.test_devtool_upgrade_git devtool.DevtoolTests.test_devtool_virtual_kernel_modify works. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31fetch2/npm: add noverify parameter to skip lockdown/shrinkwrapPaul Eggleton
When fetching source for the first time within scripts such as OpenEmbedded's recipetool, we don't want to be showing warnings about NPM_SHRINKWRAP or NPM_LOCKDOWN not being set since there's no way we could have set them in advance. Previously we were using ud.ignore_checksums to suppress these but since we are now using a more standard task-based path to fetch the source, we need to disable these through the metadata. Look for a "noverify" parameter set on the npm URL and skip the checks if it is set to "1". Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31cooker: ensure we can run buildFileInternal() after cache is populatedPaul Eggleton
If you run some other operations that result in the cache being populated, and then call buildFileInternal(), then you can end up in a situation where the cache already contains information about the recipe. For example in OE this can now happen when you use devtool upgrade. Normally this doesn't cause any problems, unless you have a non-absolute path in BBLAYERS - in buildFileInternal() we are calling matchfile() which will convert the filename to absolute, but later when taskdata goes to find the providers of the recipe it finds the non-absolute path, sets up the task information using this and then the runqueue can't find any tasks matching the absolute path. To fix this, back out the optimisation I did earlier in bitbake rev ba53e067a2d448dd63b4ca252557ce98aa8e6321 to avoid calling parseConfiguration() again, which is unfortunate but does result in the cached information being that causes the problem being cleared out. This fixes "Task do_unpack does not exist for target ..." running devtool upgrade within intel-iot-refkit. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31tinfoil: ensure variable history tracking works when parsing a recipePaul Eggleton
If you set tracking=True when creating the tinfoil object, that ensures history is collected for the main datastore, but at the end of parsing the configuration, history tracking gets turned off to save time with the result that we don't collect history for any recipes we parse. Enable tracking when we parse a recipe (and disable it afterwards if we enabled it) in order to fix this. This fixes functionality in OE's devtool that relies upon variable history (such as devtool upgrade updating PV when it's set within a recipe). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31tinfoil: ensure log lines get printed when tasks failPaul Eggleton
If a task fails during build_targets(), we need to print out the log lines as knotty does or the user will be missing information about the failure. (This should get some deeper refactoring, but now isn't the time for that.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31tinfoil: fix log message doubling when config_only=FalsePaul Eggleton
With config_only=False we launch the UI and it sets up a logger, whereas when config_only=True we don't, with the result that with True we are seeing log messages from both our logger and the one set up by the UI. Suppress our loggers with config_only=True to avoid this. Fixes [YOCTO #11275] (again). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31prserv/serv: Gracefully handle the PR server exiting quicklyRichard Purdie
If the server exits quickly its PID may no longer exist. Handle this gracefully. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31prserv/serv: Rename self.quit -> self.quitflagRichard Purdie
self has a quit function and a variable. Separate this to two different things as the current setup is prone to breakage. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31prserv/serv: Send sentinel to stop handler threadRichard Purdie
Shutdown from SIGTERM currently has to wait for the handler thread to timeout. Add a sentinel value which triggers it to loop and allows for a quick exit. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31ui/knotty: Send updateConfig earlyRichard Purdie
If for example you run: bitbake -r somefile.inc rm somefile.inc bitbake -e bitbake will crash with an error about not being able to find somefile.inc. This is because it tries to reparse the base config for the early getVariable requests before it sees the updated missing -r option. Send the updateConfig command earlier to avoid this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31cookerdata: Avoid tracebacks from early reset() callsRichard Purdie
cooker.reset() can be called before we've actually setup the datastore. Gracefully handle this case instead of the current traceback+exit. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31cooker: Allow changes in PRSERV_HOST to be responded toRichard Purdie
When we reload the configuration, PRSERV_HOST can change. Therefore restart the PR Server depending on the new configuration at reparse. Note that the server has to be started from the right process, it can't be in the UI which shuts down as that shutdown triggers a shutdown of its children and the PR Server shuts down too. This is why we need pre_serve() which ensures its executed in the right context. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31prserv/serv: Shut down any existing server before restartingRichard Purdie
This allows for cleaner code in cooker as any existing server is dealt with before a new one is started. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31cooker: Change to consistent prefile/postfile handlingRichard Purdie
Currently the original prefile and postfile passed when starting bitbake server are 'sticky'. With the new memory resident model this doesn't make sense as the server the system is started with isn't special. This patch changes the code so the prefile/postfile are used if specified on the commandline and not used otherwise. This makes the behaviour much more predictable and expected and as an added bonus simplifies the code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31cooker: Handle datastore tracking for showEnvironment server side onlyRichard Purdie
The current passing of "tracking" backwards and forwards, client to server is ugly and complex and error prone. Instead, set this during showEnvironment commands triggering a reset there if/as required. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31prserv/cooker: Drop unused paramRichard Purdie
Drop pointless unused function parameter. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-30command: Fix some bugs identified by BB_SERVER_TIMEOUTRichard Purdie
The 'needconfig' flag was meant to be the default as most commands do need it and the "False" cases were the exception. The code was written backwards with a default False value. Invert this to match the intent, resulting in the config being reparsed if metadata has changed. Also ensure the second level configuration is parsed for the getLayerPriorities command as otherwise it can return stale info. With these changes: BB_SERVER_TIMEOUT=100 oe-selftest -r bblayers.BitbakeLayers.test_bitbakelayers_add_remove passes instead of fails. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-24main: Attempt to gain bitbake.lock rather than just waitingRichard Purdie
Rather than just waiting for 5s, try and get the lockfile. If we gain the lock, we know we're ready to retry and can skip any remaining timeout. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-24process: Clean up connection retry logicRichard Purdie
Its possible for a connection to connect to the server as its shutting down but before its removed the socket file. This patch: a) Removes the socket file earlier to avoid connections. b) Handles EOFError in initial connections gracefully. These occur if the socket is closed during the server shutdown. c) Ensure duplicate events aren't shown on the console. This makes debugging these issues very very confusing. With these changes the backtrace that was concerning users is hidden and the server works as expected with a reconnect when it catches it in a bad state. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23fetch2: don't mandate path element in encodeurl()Paul Eggleton
URLs do not have to have a path; currently our npm URLs don't, so encodeurl() needs to handle if the path element isn't specified. This fixes errors using OpenEmbedded's devtool add / recipetool create on an npm URL after OE-Core revision ecca596b75cfda2f798a0bdde75f4f774e23a95b that uses decodeurl() and encodeurl() to change URL parameter values. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23bitbake: ui: Sort 'Dependent tasks' in taskexpJussi Kukkonen
The underlying model is already sorted for use in the other view, add a sorting model for the 'Dependent Tasks' view. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-22toaster: support custom Layer Index URL and fixture overrideDavid Reyna
Toaster needs to allow the custom fixture file to specific an alternate Layer Index URL for users that host their own Layer Index Server via the 'CUSTOM_LAYERINDEX_SERVER' in 'custom.xml'. Toaster also needs to allow the ability to completely override the default fixture files, otherwise that content can leak into the custom environment (by default the custom fixture is an overlay that cannot remove existing values from the default fixture) via the 'CUSTOM_XML_ONLY' value in 'setting.xml'. [YOCTO #11938] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-22Toaster: custom start and stop actionsDavid Reyna
Toaster needs the ability to allow custom extensions to execute when Toaster is started and stopped. Toaster will look for a custom extension script in the fixtures directory and execute any applicable hooks. [YOCTO #11938] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-22toaster: custom image updates and original creationDavid Reyna
When Toaster removes a package from a custom image, it must also always remove the advised reverse-dependent recipes. Similarly, when adding a package it must always add its advised the packages it depends on. This code must be un-indented so that it applies to all respective added or removed packages. Toaster normally waits until a new custom image is built before creating the custom layer and the recipe. However, an intermediate different build can fail because the recipe has already been added to the project, so the image's default recipe must be created when the image is created. [YOCTO #11915] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-21process: Ensure we call select() to know which fds to readRichard Purdie
There is an interesting bug in the current code where a sync command is not seen until the current async command completes, by which time the UI may have shut down. The reason is that if there are idle commands, we may not end up sleeping in the select call at all, partiularly under heavy load like parsing. Fix this by calling select with a zero timeout so that we see active fds and know to read from them. This fixes various problems toaster was having with the recent server changes. [YOCTO #11898] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-15process: Increase server startup timeoutRichard Purdie
We're seeing the server fail to start within 8s on heavily loaded autobuilders so increase this timeout to 30s which should be more than enough time. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-14process: Improve client disconnectsRichard Purdie
There have been cases where the server could loop indefinitely and incorrectly handle client disconnects. In the EOFError case, ensure a full disconnect happens in the alternative disconnect path to avoid this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-09cooker: Ignore common bitbake files for the parse cache invalidationRichard Purdie
Writes to the cookerdaemon log and/or the lockfile were meaning the parser cache was always being invalidated and reparsed. This is unnecessary so spot accesses to these two common cases and ignore the files from a reparse perspective. This doesn't remove many sources of reparse but does improve several common cases. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-09cooker: Improve inotify overflow handlingRichard Purdie
Add a proper function for clearing the mtime cache. Clean up the inotify event overflow case to err on the side of caution and clear any potentially now out of sync caches. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-09cooker: Ensure we handle inotify before running the next commandRichard Purdie
The inotify watch events are handled "at idle" which could in theory mean a command could run before any preceeding inotify events have been processed. This leads to a theoretical race window where those events may have a signficicant effect on the command. Add a mechanism to allow us to ensure all pending events are processed before running commands. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-09cooker: Track directories searched for bbappend/bb filesRichard Purdie
Some of the directories searched by BBFILES are not currently being added to the inotify watch list. This can mean that added append files are not noticed leading to misleading metadata results when using BB_SERVER_TIMEOUT != 0. We use glob to expand the BBFILES references and without writing our own implentation, figuring out the directories it searches is hard. We use some horrible hacks here to intecept the listdir calls, I'm open to better ways to handle this but this does ensure we have the right watches set. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>