Commit Graph

2440 Commits

Author SHA1 Message Date
Richard Purdie 5fd04b0258 bitbake: prserv: Allow 'table is locked' matching for retry loop
Try and avoid errors like "ERROR: database table is locked: PRMAIN_nohist"
by retrying if we see the string "is locked".

(Bitbake rev: 1a175b51f80d13f747b653d29e9c0d2201b5109c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30 17:53:26 +01:00
Richard Purdie cb939416b7 bitbake: server/xmlrpc: Increase timeout to 60s
This is a better value that the earlier infinite timeout yet still
allows for servers with high loads. It does mean the bitbake process
can hang at exit for the timeout period but that should never happen
and only happened for me in some test cases which wouldn't happen
in normal use.

(Bitbake rev: ab8d926b9bc27c58011e7db9327e031ac76ba34b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30 17:42:39 +01:00
Richard Purdie 4322948564 bitbake: cookerdata: Allow bblayers.conf to be found using BBPATH
It should be possible to run a build anywhere on the filesystem and have
bitbake find the correct build directory if its set somehow. The BBPATH
variable makes perfect sense for this usage. Therefore use any available
value of BBPATH to search for conf/bblayers.conf before walking the parent
directory structure.

This restores the option of being able to run bitbake from anywhere if
the user has set things up to operate in that environment.

(Bitbake rev: e86336b3fe245bc97fe74c9b9d6a21d38a536fb7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30 17:42:39 +01:00
Richard Purdie c7a389729a bitbake: cookerdata: Set TOPDIR when using bblayers.conf
By definition, bblayers.conf is at the top of the build tree. We'd like
to support running bitbake anywhere within that build tree but TOPDIR
gets set to wherever cwd is. Change the code to reset TOPDIR
to the top of the build directory.

This shouldn't break anything but does make the system more usable.

(Bitbake rev: b266db27de0bba19a418e4d42e870649136b116b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-30 17:42:39 +01:00
Richard Purdie d5e860be4c bitbake: prserv/serv: Multithread the server
This makes the PR server multithreaded and able to handle multiple connections
at once which means its no longer a build bottle neck when serving one connection
at a time. I've experimented and database connection for each thread seems to
cause the least issues, pushing the contention for sqllite to handle itself.

This means moving the db/table connection code into the actual function methods.
It doesn't abstract well as a function since we need the db object around for
the lifetime of the function as well as the table else we lose the connection.

(Bitbake rev: bf9be2029b2bded5f532bdda4c38ae3dff5d1cf6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-29 00:13:22 +01:00
Richard Purdie 06d7664590 bitbake: prserv/db: Threading fixes
Enabling threading for the PRServer causes a number of issues. Firstly is
the obtuse error:

sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type

which is due to the class not being derived from object. See:
http://docs.python.org/2/library/sqlite3.html#registering-an-adapter-callable

Secondly, we want to enable multithreadded access to the database so we do this
when we open it. This opens the way up to multithreading the PR server.

(Bitbake rev: 5709efc2ff1e36529bd28f49cd093ccfa7abff7f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-29 00:13:22 +01:00
Jason Wessel 84708a4524 bitbake: serv.py: Fix regression from 972bc43e6d5b
commit 972bc43e6d5b1207b944b3baa8f9805adb35dda7 (serv.py: Fix hang
when spawned dynamically with bitbake) introduced a regression,
because the wrong patch was submitted.  The syntax was incorrect in
the original patch.  The logger iterator must be used with a call to
getLogger().

[YOCTO #5059]

(Bitbake rev: 85fed8acc3af3e15bf119db2f51c486a9de3646b)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-28 09:29:46 +01:00
Christopher Larson 87f413f617 bitbake: data_smart: allow removal of multiple words at once with _remove
FOO = "foo bar baz"
    FOO_remove = "foo baz"

(Bitbake rev: 04127dec207d6dfc0ada56c5cc67ec9ad30517a8)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-28 00:34:13 +01:00
Christopher Larson 092190e20b bitbake: data_smart: use a split/filter/rejoin for _remove
This is more idiomatic, and from the limited performance testing I did, is
faster as well. See https://gist.github.com/kergoth/6360248 for the naive
benchmark.

(Bitbake rev: 1aa49226d5a2bac911feeb90e3d9f19529bc1a3e)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-28 00:34:13 +01:00
Jason Wessel da6260f95f bitbake: serv.py: Fix hang when spawned dynamically with bitbake
The PRServer has the possibility to hang indefinitely blocking on a
semaphore processing a xmlrpc request to send an event back to the
main bitbake instance.  This was observed during a "bitbake -e" on a
heavily loaded machine and the main bitbake instance and cooker exited
before the PRServer emitted its first log.

The stack trace is provided below as to show what happens every time a
logger.info() is executed in the PRServer.  Not only does it write to
the stream handler but it also tries to send the event to the main
event processor.

    self._notempty.acquire()
    self.queue.put(event)
    _ui_handlers[h].event.send(event)
    fire_ui_handlers(event, d)
    fire(record, None)
    self.emit(record)
    hdlr.handle(record)
    self.callHandlers(record)
    self.handle(record)
    self._log(INFO, msg, args, **kwargs)
    (self.dbfile, self.host, self.port, str(os.getpid())))
    self.work_forever()
    pid = self.daemonize()
    self.prserv.start()
    singleton.start()
    self.prhost = prserv.serv.auto_start(self.data)
    cooker.pre_serve()
    bb.cooker.server_main(self.cooker, self.main)
    self.run()
    code = process_obj._bootstrap()
    self._popen = Popen(self)
    self.serverImpl.start()
    server.detach()
    server = start_server(servermodule, configParams, configuration)
    ret = main()

It was never intended for the PRServer to send its logs anywhere but
its own log file.  The event processing is an artifact of how the
PRServer was forked and it inherits the event log handlers.  The
simple fix is to clean up and purge all the log handlers after the
fork() but before doing any of the typical PRServer work or logging.

(Bitbake rev: 972bc43e6d5b1207b944b3baa8f9805adb35dda7)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-28 00:25:56 +01:00
Cristiana Voicu 1472b9ebff bitbake: hob: fixes for image combo box
When an image from scratch is selected, and recipes parsing
is canceled, the image shown by the combo box isn't correct.

[YOCTO #5000]
(Bitbake rev: f8166ace0bd9155199166990ce15da24eb2e793b)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-27 11:47:35 +01:00
Cristiana Voicu 39052cd703 bitbake: hob: add event handlers filtering in Hob
Create the _evt_list for hob; it is longer than the knotty
uses because it handles more events.

(Bitbake rev: 715aed74f972bb6e9b6a5130ca9ede48d4f79f0a)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-27 11:16:58 +01:00
Cristiana Voicu 8d134e999e bitbake: bitbake/event.py: UIhandler filter should work without a mask
The default for the mask will be * (all the handlers)

(Bitbake rev: 4c95e5f46cf2a656100bbf5a0e5a09d506abf9b9)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-27 11:16:58 +01:00
Richard Purdie c34bb765fa bitbake: command.py: Call updateCache for all states != running
updateCache handles the logic for shutting down the parsing so we need
to call it for all cases when we're not running.

This fixes hangs if Ctrl+C is pressed during parsing.

(Bitbake rev: 552b8935dd2f9f11e8d5c08a597a7e966b891480)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 13:43:47 +01:00
Richard Purdie d7571c0390 bitbake: data_smart: Add _remove operator
There are long standing complaints about the fact its very difficult
to remove a portion of a variable. The immediate request is for a -=
and =- operator. The trouble is that += and =+ are "immediate"
operators and are applied straight away. Most people would expect
-= and =- to be deferred to have the effect most people desire and
therefore implementing -= and =- would just make the situation more
confusing.

This deferred operation is much more similar to the override syntax
which happens at data store finalisation. The _remove operator is
therefore in keeping with the _append and _prepend operations.

This code is loosely based on a patch from Peter Seebach although it
has been rewritten to be simpler, more efficient and avoid some
potential bugs.

The code currently only works on space delimited variables, which
are by far the most commom type. If bitbake is ehanced to support
types natively in future, we can adjust this code to adapt to that.

(Bitbake rev: 9c91948e10df278dad4832487fa56888cd58d187)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 11:29:46 +01:00
Richard Purdie 69aab78dd8 bitbake: bitbake: Add ui event handlers filtering
Add functionality to allow UIs to update and change the types of events they
recieve. To do this we need to add a new command and also need to be able
to obtain the current event hander ID. In the case of xmlrpc, this is
straightforward, in the case of the process server we need to save the result
in a multiprocessing.Value() so we can retrive it. An excplit command
was added to the server API to facilitate this.

The same function can also be used to mask or unmask specific log messages,
allowing the UI to optionally differ from the standard set of message
filtering.

Based upon work by Cristiana Voicu <cristiana.voicu@intel.com>

(Bitbake rev: ba5a6c88785d9889d4172ec79937ac2a5555327e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 11:29:46 +01:00
Richard Purdie bfab986ccd bitbake: server/xmlrpc/prserv: Add sane timeout to default xmlrpc server
The standard python socket connect has long timouts which make sense for remote
connections but not local things like the PR Service. This adds a timeout
parameter to the common xmlrpc server creation function and sets it to a more
reasonable 5 seconds.

Making the PR server instantly exit is a good way to test the effect of this
on bitbake.

We can remove the bodged timeout in the PRServer terminate function which
has the side effect of affecting global scope.

(Bitbake rev: 8c01cff94787abbb64fbdf0c16cd63f8f97a7e03)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 11:29:46 +01:00
Richard Purdie a03a423c60 bitbake: process: Improve exit handling and hangs
It turns out we have a number of different ways the process server termination can
hang. If we call cancel_join_thread() on the event queue, it means that it can be left
containing partial data. This means the reading of the event queue in the terminate()
function can hang, the timeout and block parameters to Queue.get() don't make any
difference.

Equally, if we don't call cancel_join_thread(), the join_thread in terminate()
will hang giving a different deadlock.

The best solution I could find is to loop over the process is_alive() after requesting
it stops,  trying to join the thread and if that fails, try and flush the event
queue again.

It wasn't clear what difference a force option should make in this case, we're
gracefully trying to empty queues and shut down regardless of whether its a SIGTERM
so I've simply removed the force option.

(Bitbake rev: c5c8f33ca4b81877a0115887849881001b745bf0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 11:29:46 +01:00
Martin Jansa aa0b237144 bitbake: parse: Return IOError when including file with absolute path
* resolve_file was behaving different when relative and absolute
  paths were passed to it

* include relative-path/non-existent-file.inc
  works correctly resolve_file throws IOError, BBHandler.py:handle()
  doesn't catch it, ConfHandler.py:include() catches IOError and shows:
  DEBUG: CONF file 'relative-path/non-existent-file.inc' not found
* include /absolute-path/non-existent-file.inc
  was failing, because resolve_file just returns fn,
  BBHandler.py:handle() calls bb.parse.mark_dependency(d, abs_fn)
  which throws:
  OSError: [Errno 2] No such file or directory: '/absolute-path/non-existent-file.inc'
  and parsing fails.
  Ad isfile() test for absolute fn and throw IOError to make
  resolve_file behavior consistent for both paths.

* I know we had some issues with -b relative-path-to-recipe.bb and
  absolute path, so consider this patch only as RFC and documentation of
  this problem

* Catch OSError too in ConfHandler.py:include() e.g. in case the file exists, but user
  cannot read it or something like that.

(Bitbake rev: b0bbd89a4f0b98fa1ab28b8e0526cd9ddb76fa57)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 11:29:46 +01:00
Richard Purdie 501e1a321d bitbake: prserv/serv: Fix pid file removal
Mark Hatle spotted there were pid files being left around. This patch
fixes things so the removal function is called correctly, the code
contained a typo.

(Bitbake rev: c696a16c8200c31c52750037eeafe07e065b6517)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-23 17:43:40 +01:00
Richard Purdie 25e410b743 bitbake: event/msg: Add primitive server side UI log record filtering
Currently one of the bigger bottlenecks in bitbake is passing all the
log messages over IPC to the UI. This is worthwhile if the UI is going
to use them, pointless otherwise. The memory resident bitbake suffers
from this performance issue particularly badly.

This patch filters the log events on the server side with the global
log levels and hence reduces the traffic. This speeds up parsing
(18.5s down to 17s) and bitbake general command overhead is reduced
(7.3s for a NOP to 6.2s).

What isn't added here is general event filtering or the ability to
change the log levels once set. Provision is made for adding this
in a follow up patch though.

(Bitbake rev: 1bf0e88f57ba0bca62532e81d0d62cf88e2abcbb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-23 17:29:54 +01:00
Nicolas Dechesne 9f0f799c46 bitbake: build.py: create symlink for run.do_xxx scripts
The 'courtesy' symlink for log.do_xxx are quite useful when debugging, so
with this commit, we now get similar 'courtesy' symlink for run.do_xxx
scripts.

We only create symlink for tasks, not individual functions.

The symlink is create right before the actual runfile is created, indeed
we cannot create the symlink right after running the task since a failure
or execption can happen, in which case the symlink wouldn't be created,
and symlink are particularely useful when the task failed!

Another option would be create the symlink after the runfile is created,
and before the script is executed, but that means we need to duplicate the
code in case of Shell vs Python task.

(Bitbake rev: a672b39c5d529ba85d72eee8fef4c4273eaa5397)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-23 17:29:54 +01:00
Cristiana Voicu 136cb5e6b8 bitbake: hob: changes to image combo box from image configuration page
In some cases when a new machine is selected, the image combo
shows the same option. Fixed this issue, because the image
combo box should be reseted.

Fix the counter for the options in the combobox. This bug
was introduced by the templates functionality. The combo box had some
last changes, and I forgot about this counter.

[YOCTO #4858 & #5000]
(Bitbake rev: 457fd80ee6b1b2bcef463e3a83e048da2f8bf805)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-22 12:51:59 +01:00
Andrei Dinu 8d1e77ec31 bitbake: propertydialog.py : Scrollable windows for long tooltips
In some cases, the length of the description and the brought
in by field was too big. That led to the size of the property
dialog exceeding Hob's size. For long tooltips we use
scrollable windows now.

[HOB #4321]

(Bitbake rev: 78ecabf19bf01e5a662b6e2b865cd93bf47d962b)

Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-22 12:38:12 +01:00
Peter Seebach f6ab9274bc bitbake: build.py: Provide useful diagnostics when exiting.
Running scripts with 'set -e' produces silent failures with no
diagnostic. Add an exit handler which produces diagnostics, including
details of what was running if the shell seems to be bash.

(Bitbake rev: e213e6a4c297a4f1c22eed15bd7b4cbc0e9eab4f)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-20 22:43:42 +01:00
Cristiana Voicu 1b3f8ac9cf bitbake: hob/retrieveimagedialog: change labels
Some labels needed to be changed in order to respect the convention.

[YOCTO #4999]
(Bitbake rev: 110b485eac6adea242297b7942da8710403c465a)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-16 11:21:03 +01:00
Paul Eggleton 840a427ed2 bitbake: taskdata: report close matches with NoProvider errors
Assuming there is no known reason why an item is not provided, show
close matches on the assumption that it might have been a typo or
other mistake.

(Bitbake rev: ed81b0856b4a3892b53d39871eaaa6273390ea75)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-16 11:21:02 +01:00
Paul Eggleton baaa7adc16 bitbake: runqueue: report close matches for an invalid task name
Help to pick up mistakes such as "bitbake -c cleanstate xyz" (instead
of "bitbake -c cleansstate xyz".)

(Bitbake rev: 15c3db1cffdffd85641c6b12e77f19ce7a553472)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-16 11:21:02 +01:00
Richard Purdie 712622e2db bitbake: hob: Add missing file from previous commit
This should have been part of 'hob: implement the "retrieve image dialog" +
changes to image combo box' but got lost in the merge process. This adds
the missing file.

(Bitbake rev: 0eadcc073f270c0b323955cf7719b77195cf4890)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-12 10:23:32 +01:00
Ross Burton 89f42c9dcb bitbake: depexp: fix typo in variable name
(Bitbake rev: e3b8585738abea96a9fd1d1204731004a35e0bc9)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:27 +01:00
Ross Burton 44db452d8f bitbake: depexp: insert data instead of append/set, for speed
(Bitbake rev: 9f50a841f4929e68333ccf2ace32f5d3ca1e7d0d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:27 +01:00
Ross Burton 3412a89dfd bitbake: depexp: make parse() a member function
(Bitbake rev: e5709f2b5592eb6448c7d10b9aeb7cf3bef4864e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:27 +01:00
Cristiana Voicu e76fdac6f1 bitbake: hob/imageconfigurationpage: changes to image combobox
Place the "Create your own image recipe" field to the
end of the image recipes list.

[YOCTO #4193]
(Bitbake rev: 288bbda31164efffd07a370a728a7682db775c08)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:27 +01:00
Cristiana Voicu 4182c53e56 bitbake: hob/imagedetailspage: add tooltip for save image recipe button
[YOCTO #4193]
(Bitbake rev: de3cb77ec7ceb8e0671cf3edfd3713f907d1d0bc)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:27 +01:00
Cristiana Voicu 8db39d2f66 bitbake: hob: set focus on entry name when the name is not correct
[YOCTO #4193]
(Bitbake rev: bbae370bc57296723cc87e48d64da79882f1e5b6)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:26 +01:00
Cristiana Voicu ecc56f204c bitbake: cooker: save packages in IMAGE_INSTALL instead of PACKAGE_INSTALL
Hob retrieves the list of recipes and packages using the IMAGE_INSTALL
variable, so a custom image should be saved using this variable.
Changed how the image is saved in a bb file

[YOCTO #4193]
(Bitbake rev: edf3f52c05d86d49b71770cdafde583213e2034d)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:26 +01:00
Cristiana Voicu c83f8185a8 bitbake: hob: implement the "retrieve image dialog" + changes to image combo box
Tha changes related to the image combo box are related to the
action done in the retrieveImageDialog. When the user wants to select
a customize image, but then he cancels the action, the combo box is set to
--select a base image--.
If the user selects an image using the new dialog, a new item with its name
is added to the combo box list and then it is activated.

[YOCTO #4193]
(Bitbake rev: f25322de7e47719b31808397174e5c4f6d8649f2)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:26 +01:00
Cristiana Voicu 42a4f33fc0 bitbake: hob: retrieve file name of an image
The entire file name (with the path) is needed to know
if the image is located in the "build" directory or it comes
from layers. According to this information, the image is placed
differently in the combobox.

[YOCTO #4193]
(Bitbake rev: 7d15eccc25b6c96851e4d01401f9f9b7821730b1)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:26 +01:00
Cristiana Voicu 4640fd053b bitbake: hob: changes to image combo box
Added an item for the custom images.
Added a separator in the combo box.

[YOCTO #4193]
(Bitbake rev: 1eed84c11269c25c13bb444871d84c5dfeabcb73)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:25 +01:00
Cristiana Voicu 63157e2c87 bitbake: hob/bitbake: when an image is saved, it should require an image from layers
Saving an image that requires another image will cause issues when
the second on is removed. So, we have agreed to "require" only the images
from layers.
The functionality is implemented in bitbake, in order to be more abstract,
and it is used by Hob when an image recipe is saved.

[YOCTO #4193]
(Bitbake rev: 28296ca78507ba2e414eb136c81afee65a8e25e5)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:25 +01:00
Cristiana Voicu 08ccfacbc1 bitbake: hob: the saved image should be editable
Also, the image can be saved when the a name is filled.

[YOCTO #4193]
(Bitbake rev: 0edad0ab3ccd165125726d2aa3dfeb19dad246c9)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:25 +01:00
Cristiana Voicu 3bef5a75d6 bitbake: hob: change the name and description for the saveimagedialog
The image name and description should be saved for a future
save.

[YOCTO #4193]
(Bitbake rev: 6dc0fc243ac6046714523d08df4d8f88c48698cc)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:25 +01:00
Cristiana Voicu bb8a265b0f bitbake: hob & bitbake: append a value to a variable from hob throught bitbake
It was necessary to append ${TOPDIR}/recipes/images to BBFILES.
Implemented the mechanism to append a value to a variable: a command and
the method in cooker.

[YOCTO #4193]
(Bitbake rev: 4aedbee90bd92395c2460a68702e6ede00e256c9)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:24 +01:00
Cristiana Voicu 116219ce09 bitbake: hob: make changes in order to permit from UI to edit an image after saving it
Added the image name to the list model, in order to show the image name as
the user named it.

[YOCTO #4193]
(Bitbake rev: 0aba493103d1fe50026a47db16529febbbbd77a2)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:24 +01:00
Cristiana Voicu 564c83be5e bitbake: hob/bitbake: save the description of a custom image
When an new image is saved, the dialog for this action has
a field for the description. Changed how an image is saved, by
appending the DESCRIPTION variable at the end of the .bb file.

[YOCTO #4193]
(Bitbake rev: 5629007f2b984005e3a8ac5d9b71422cbc2f1409)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:24 +01:00
Cristiana Voicu 140744c470 bitbake: hob/bitbake: create a template (a .bb file) from hob through bitbake
Modified generateNewImage function from cooker, in order to be used to
save a template in Hob.
Created a command to ensure that some dirs are created. The templates
(recipes) will be saved in {TOPDIR}/recipes/images folder.
Called these methods from Hob.

[YOCTO #4193]
(Bitbake rev: 96ffa00945c7eb09a0132fa47159aef3ef20fb3e)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:24 +01:00
Cristiana Voicu ee4fe5a229 bitbake: hob: create save image dialog used to save a template
Implemented a new dialog used by Hob. This dialog was desinged
in order to permit to save only in a particular directory.
Also, it has a field where the user can type a description
for the image.
Implemented in the handler a method to retrieve the topdir variable,
because the changes will be saved in {topdir}/recipes/images directory.

[YOCTO #4193]
(Bitbake rev: 117d4809a62e28ffe7e9dcda5433993d76f7d934)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:23 +01:00
Cristiana Voicu 843ef10832 bitbake: hob: labelling changes in Hob
When the design document for templates in Hob was created, we've noticed
that some labels need to change.

[YOCTO #4193]
(Bitbake rev: fcbadbb73a8a94a3d5e330e1a5fa9550130d2c62)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:23 +01:00
Cristiana Voicu adcce841b4 bitbake: hob/packageslist: change image size label to estimated image size
On the "Edit packages list" page, the image size may be computed before
building. We didn't find another way to give a more accurate size, so
we have agreed to inform the user that this an estimated size.

[YOCTO #4388]
(Bitbake rev: 136eda2dcbc32aba4f59783049352dc1375cc945)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:23 +01:00
Cristiana Voicu 4c96451fa5 bitbake: hob/advancedsettings: change toolchain labels to sdk labels
In order to be easier for the user to understand, we have changed the
toolchain labels to sdk.

[YOCTO #3808]
(Bitbake rev: 008afbcf6b1b315eb5463ecfb39fc50e6303687e)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 13:02:23 +01:00
Valentin Popa 888d1f35ee bitbake: bitbake-worker: import needed signal module
bitbake-worker makes use of the signal module
but it doesn't import it. This patch fixes the issue.

[YOCTO #4750]

(Bitbake rev: c2ed639690f135994199eb24d964e37f57259e3a)

Signed-off-by: Valentin Popa <valentin.popa@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-31 06:59:59 +01:00
André Draszik d45486eb1c bitbake: fetch2: fix unpack of .xz files
If a file ends with .xz, it currently gets overwritten during unpack:
The decompress command for .xz files is:
  'xz -dc %s > %s' % (file, efile)
and as efile == file, we end up overwriting file (the source).

Fix this by adding .xz to the list of suffixes that that need to
be removed from a file name for an extract command, leaving the
bare file name. Now, for a given file foo.xz,
file == foo.xz and efile == foo, similar to how .gz .bz2 and .Z
files are treated.

(Bitbake rev: 2cd2d0a48e12ab4358fb967eaf7a56c17993f48d)

Signed-off-by: André Draszik <andre.draszik@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-31 06:59:59 +01:00
Petter Mabäcker bd1c441a21 bitbake: bitbake: runqueue: add warning if invalidating invalid task
Add a warning if 'bitbake -C' is executed with a task that does not
exist.

Fixes [YOCTO #4877]

(Bitbake rev: 6459c1d0eb8f1007246df36149e2496ee531e25f)

Signed-off-by: Petter Mabäcker <petter@technux.se>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-29 15:25:09 +01:00
Cristiana Voicu 0e9049a011 bitbake: hob: sstatemirror is standard also for file://.* regex
(Bitbake rev: 2e3c87569a8c40f7a2ebda22b01eee3bb7c96d1d)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-29 15:25:08 +01:00
Cristiana Voicu e28904e1de bitbake: hob: changed the split of SSTATE_MIRRORS variable
Until now the split made searching the string "file://", but
this is not ok when SSTATE_VARIABLE has the following form:
SSTATE_MIRRORS ?= "\
     file://.* http://someserver.tld/share/sstate/PATH \n \
     file://.* file:///some/local/dir/sstate/PATH"

In the documentation I've found that \n is the list separator.

[YOCTO #4857]
(Bitbake rev: 73bcd96928cb2df390e1fc6d3a8b7ce3e9d546a4)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-29 15:25:08 +01:00
Robert Yang e605ecfd95 bitbake: providers.py: print a debug message for dynamic pacakge
We can't know the dynamic pacakge's name exactly, there might be a
problem, for example, when we use:

IMAGE_INSTALL_append += "ncurses-lib12344"

The ncurses-lib12344 matches ncurses' dynamic packages pattern:

PACKAGES_DYNAMIC = "^${PN}-lib.*"

so there is no errors before the rootfs creation though there is no
ncurses-lib12344.

We can warn this, but I think that we'd better not since there are many
dynamic packages, or there would be too many warnings, for example, the
perl and kernel modules, maybe we can print a debug message for it.

[YOCTO #4798]

(Bitbake rev: df372ca057f0c8c2152223b3e26ad9a30958bab6)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-29 15:25:08 +01:00
Valentin Popa dc86293f04 bitbake: HOB:Proper handle of SIGINT
Modal dialogs doesn't run on the main loop so they cannot
catch any signal from the terminal. This patch makes sure
the dialogs are destroyed when a SIGINT is sent to HOB.

[YOCTO #3329]

(Bitbake rev: 6eee0cc37438cc3f91531b7df524330fba27161b)

Signed-off-by: Valentin Popa <valentin.popa@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-05 15:52:48 +01:00
Cristiana Voicu 8a186a6b38 bitbake: hob: save button from settings called a nonexisting method
The method was removed when the process for saving configuration
in Hob was changed. Replace the call with the right function.

[YOCTO #4793]
(Bitbake rev: b6aa2b63d71cbe82850a375381b2dbc750cf1905)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-03 08:13:35 +01:00
Richard Purdie 624160af6e bitbake: cookerdata: Improve message if BBPATH is unset and bblayers.conf not found
If BBPATH isn't set and bblayers.conf isn't found, improve the message
shown to the user to help their understanding of what the problem might
be.

[YOCTO #3271]

(Bitbake rev: 0e639f5cbc813c8d4719019cfdd4287e9a429610)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
A
2013-06-28 10:34:16 +01:00
Li Wang 10e44f162c bitbake: bitbake: python funcname can not include special character @
[YOCTO #4772]

When path:file change to python function, it maybe include '@' character.
So, add the special character to change to '_' for avoid error.

(Bitbake rev: 684bc6dcb11ecb1fd7a4d25c08909ad9879e8342)

Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-27 10:06:09 +01:00
Cristiana Voicu 4852c4f6a1 bitbake: bitbake: adding a new comment should be placed on a new line
In this case, the comment is appended to the end of the file.
Some text editors, do not place  a '\n' to the end of the file
after saving it.

[YOCTO #4636]
(Bitbake rev: 2beb9589b1bd9773f587b4dc08afdfe50f4ea913)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-27 10:06:09 +01:00
Richard Purdie 011608a7b0 bitbake: data_smart: Fix bug with overrides and weak default values
(aka pay the cookie monster for weak defaults)

If you have code like:

MYVAR = "a"
MYVAR_override ??= "b"

then MYVAR will get the value "a" even when override is in OVERRIDES. The
reason is that the value of ??= is set as a flag not a value and the cookie
monster isn't paid.

The fix is to ensure appropriate payment is made for a defaultval varflag
matching the usual setVar case.

(Bitbake rev: 3d8044bc79c482c5ea008ddf12a8128dcd1527ee)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-21 13:00:57 +01:00
Richard Purdie 353212a533 bitbake: data_smart: Ensure variable flags are accounted for in config data hash
Currently if the flags set against a variable in the base data store
change, it doesn't automatically trigger a reparse when it really
should. For example with the blacklist class setting:

PNBLACKLIST[qemu] = "bar"
PNBLACKLIST[bash] = "foo"

will not trigger a reparse if only one entry is changed and a
blacklisted recipe can still be built.

I did consider using BB_SIGNATURE_EXCLUDE_FLAGS in here however it
doesn't make sense, we want to trigger a reparse when any of the
flags change too (which is different to the sstate signatures which
we wouldn't want to change in those cases).

[YOCTO #4627]

(Bitbake rev: ed74ea50043f6feb698c891e571feda2b9f8513d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-21 09:19:28 +01:00
Cristiana Voicu 78bcf871c6 bitbake: hob: save variables in conf/ directory
Until now the variables were saved in bitbake configuration,
now they are saved in configuration files, in order to be read by
bitbake-worker. This helps to assure the consistency for the rest
of the variables.

(Bitbake rev: ea65ebf43525f173205183aa2fd5d8db303ffd4a)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 16:26:22 +01:00
Cristiana Voicu f3246953c2 bitbake: hob: replace the init cooker with reset in order to keep the history
When the cooker initialization is called, the variables history is lost.
It need a reset, in order to load the configuration files.
Also, concatenated the value for INHERIT variable.

(Bitbake rev: 2b8c0c09e09ab69edc53501b84050c797f0686e4)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 16:26:22 +01:00
Cristiana Voicu 71520c5045 bitbake: bitbake: call the initConfiguration when reparsing
As it is implemented now, when parsing the configuration files is
needed, it also needs an initialization.
Also, implemented a function to create an extra configuration files
which can be used as postfile/prefiles when parsing.

(Bitbake rev: 5fe23c1b51da14f58f8c483f43f30b48766a0913)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 16:26:22 +01:00
Richard Purdie c5a5d23ec4 bitbake: cooker: Ensure configuration matches variable tracking state
When we reset, the current tracking value may change unexpectedly. This
patch ensures that the default value is preserved over a datastore reset.

(Bitbake rev: 0aa27598d9fdc8c3d18839b3ef93d0ba9698f761)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 15:10:32 +01:00
Richard Purdie db6bd113d0 bitbake: build.py: Cleanup data store references
Clean up a number of old style accesses to the datastore.

(Bitbake rev: d872fef2c38749c3c6f5d84344db3ec2f9f134ce)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 15:10:32 +01:00
Cristiana Voicu 7d02de844c bitbake: bitbake: remove the function for reparse because it does nothing
The command for reparse does nothing, so I have managed to remove it,
because it can be misleading. When a reparse is needed, it can be used
the parse function.

(Bitbake rev: 188eaba121789112ffeb1188f0984d23dfe8df4f)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 13:29:53 +01:00
Peter Kjellerstedt 3a74f25cf1 bitbake: Correct a typo
(Bitbake rev: 087ec3a1b2dde04a8e5ce2943802fccd424ab3f3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 13:26:57 +01:00
Peter Kjellerstedt d1ad98b64b bitbake: Allow checksums to be used for files retrieved using SFTP
(Bitbake rev: fd438a334d1f90ff07dded61c9648987da42c34f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 13:26:57 +01:00
Cristiana Voicu 77264ca2ea bitbake: hob: check if imageconfiguration page has the attribute 'warnings_bar'
[YOCTO #4571]
(Bitbake rev: 53c6b65bbcd5a6d3caed8581533f31ac373163a7)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 13:26:57 +01:00
Cristiana Voicu 01f9d1b338 bitbake: bitbake & hob: modify some commands and call them from hob
This patch adds a new command to create an extra configuration
file, in order to create it from Hob.
Also, it calls the enable/disable data tracking when needed.
Modified the prefiles and postfiles variables because the cooker
expects some lists.

(Bitbake rev: 92393701adcfa181a1090e3632bc6df7ee7852e6)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 13:26:57 +01:00
Cristiana Voicu 64eda3e058 bitbake: hob: remove the rest of the old template functionality
Until now, some configuration settings was saved in a hob specific
directory. From now on, it will be saved in conf directory through bitbake.

(Bitbake rev: c53e902b010d1c3f1550f7e60e744f40120f73c2)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 13:26:56 +01:00
Richard Purdie 801fbe5a0c bitbake: fetch2: Enhance error message for BB_NO_NETWORK
BB_NO_NETWORK can be set by bitbake internally by the use of
BB_FETCH_PREMIRRORONLY so update the error message to give users a
hint about this.

[YOCTO #3222]

(Bitbake rev: cac3060d0bf8c7deeacda18d06d92787911380d0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 13:10:47 +01:00
Richard Purdie 5af68d42ba bitbake: runqueue/build: Add recideptask flag
Currently, tasks like fetchall are slightly broken since if a recipe
has specific [depends] which occur after do_fetch and add items not listed
in DEPENDS and RDEPENDS, they are not caught by recrdeptask. We've gone
around in circles on this issue (e.g
http://git.yoctoproject.org/cgit.cgi/poky/commit/bitbake/lib/bb/runqueue.py?id=5fa6036d49ed7befe6ad50ec95c61a50aec48195
) and in many cases the behaviour of recrdepends is correct but tasks like
fetchall need the other behaviour.

To address this we add a recideptask flag which can be used in conjuction
with the recrdeptask flag to specify which task to to the inspection upon.
This means entries like do_rootfs[depends] which have do_fetch tasks are
caught and run.

I'm not 100% happy with needing another flag but I don't see any rational
way to get the correct behaviour in all cases without it.

[YOCTO #4597]

(Bitbake rev: f8c9b292b02ce2c28741b74901205f5e5807ca87)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20 13:10:47 +01:00
Alexandru DAMIAN baff2630b3 bitbake: bitbake: read BBSERVER environement for remote server
This change allows bitbake to connect to a remote server
by reading the BBSERVER environment variable and effecting
the config. Basically a shortcut to the command line parameters.

(Bitbake rev: 81929f86c57ed0a4ad0cda7aaa820fceabaa61e9)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-17 16:09:10 +01:00
Alexandru DAMIAN f5cadbe005 bitbake: knotty, bitbake: add option to terminate a remote server
I add an option to terminate a remote server gracefully
as not to need a kill command.

(Bitbake rev: 7495f835666a9561c2c7d84da7aaa74e4df55b9a)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-17 16:09:10 +01:00
Alexandru DAMIAN 3ea9d647ec bitbake: knotty, xmlrpc: add observer-only mode
I add an observer only mode for the knotty UI and
the XMLRPC server that will allow the UI to register
a callback with a server in order to receive events.

The observer-UI is able to send read-only commands to the
server, and also is able to register as an event handler.

Read-only commands are the commands that do not change
the state of the server and have been marked as such in
the command module.

The observer can switch to a full client if it calls addClient
at any time, and the server has no other client running.

(Bitbake rev: 4de9ee21f1fa4d04937cc7430fb1fc8b7a8f61e2)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-17 16:09:10 +01:00
Richard Purdie e023620773 bitbake: utils: Fix multiprocessing pool reference
Interestingly the previous version comparision was broken and we were always using
the compatibility code, masking this bug. Oops.

(Bitbake rev: d48e8bcb24e8fa5d4fd60fd2c9927a95976d8d8b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 22:01:09 +01:00
Richard Purdie 441c699acb bitbake: compat/server/utils: Jettison pre python 2.7.3 workarounds
Now we've moved to require python 2.7.3, we can jettison the compatibility
workarounds/hacks for older python versions.

(Bitbake rev: a51c402304f2080a76720f9b31d6dfdbed393bba)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 17:26:30 +01:00
Richard Purdie 6c058341f9 bitbake: runqueue: Improve handling of failing setscene tasks with hard dependencies
If a setscene task has a hard dependency on a task like pseudo-native, its
expected that the setscene task will not run unless the dependency is met.

This adds code to ensure that is the case, otherwise a bug would show up
with a usecase like:

bitbake gnome-common
bitbake pseudo-native -c cleansstate
bitbake gnome-common -c clean
bitbake gnome-common

With the double wrapper script environment, we'd not see issues like
this as it would be masked. The problem theoretically affects code like
useradd too as well as anything using a sstate postinstall.

(Bitbake rev: c54e738e2b5dc0d8e6fd8e93b284ed96e7a83051)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 17:08:40 +01:00
Alexandru DAMIAN 4aebdecdd7 bitbake: xmlrpc: removes the event servers controller
XMLRPC API ran a XMLRPC server at port+2 in order
to provide endpoints to register an event server
in which to dump the events.

This is no longer used, so we remove it.

(Bitbake rev: e171a363913a86e56266f4c9d107110c7f5221e3)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 14:34:59 +01:00
Bogdan Marinescu 5aa5fc470e bitbake: bitbake: Add event mask flag support
Add a flag to event handlers which lists the events a given handler wishes to
process. By default event handlers recieve all events but this means
we can stop running code in many cases if we know it doesn't want the event.

This is part of the fix for YOCTO #3812, but implements filtering only
for class event handlers; the other part (events filter for UIs) will be
the subject of a different patch.

(Bitbake rev: 074003a4e7530a72863b9c685fc5c31b0f08c039)

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:52:58 +01:00
Richard Purdie 542d6a87db bitbake: bitbake: Update version to 1.19.1
(Bitbake rev: 6acd444a557bba977ae1772371fdadf5f510e3b6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:52:58 +01:00
Richard Purdie 8408f3dfca bitbake: bitbake: Bump minimum python version to 2.7.3
(Bitbake rev: a01d153a8baac7136c2797c95357e74dd8872026)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:52:57 +01:00
Richard Purdie 5ebd9bfff1 bitbake: prserv: Adapt autostart to bitbake-worker
With the change to bitbake-worker we need to ensure the workers know
how to contact the PR service, the magic 0 port and singleton is
no longer enough.

(Bitbake rev: c761751e259bb8e940552a28794b45887b5a72d9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:52:57 +01:00
Richard Purdie efb877bcdb bitbake: runqueue: Spawn a separate worker for fakeroot tasks
(Bitbake rev: 860ec42b220b7ed3f3bbe52c3546bba66644eac8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:52:57 +01:00
Richard Purdie 0ee02ca2fa bitbake: runqueue: Abstract the start and teardown worker functions
We're going to need a fakeroot/pseudo version of the worker so
abstract the code to start the worker process.

(Bitbake rev: b5d0f12f9df3ab211700473ed145ee6fbd9ca8e9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:52:57 +01:00
Richard Purdie 026c94be2e bitbake: runqueue: Move the bitbake-worker execution to a higher level
The worker was being executed by each execution queue so would get
constructed twice for each build. This is wasteful so move execution
to the main runqueue so we only have to start the worker once.

(Bitbake rev: 8117f8480125b121b2b5ac0afc31b108d9e670ae)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:52:56 +01:00
Richard Purdie d0f0e5d9e6 bitbake: runqueue: Split runqueue to use bitbake-worker
This is a pretty fundamental change to the way bitbake operates. It
splits out the task execution part of runqueue into a completely
separately exec'd process called bitbake-worker.

This means that the separate process has to build its own datastore and
that configuration needs to be passed from the cooker over to the
bitbake worker process.

Known issues:

* Hob is broken with this patch since it writes to the configuration
  and that configuration isn't preserved in bitbake-worker.
* We create a worker for setscene, then a new worker for the main task
  execution. This is wasteful but shouldn't be hard to fix.
* We probably send too much data over to bitbake-worker, need to
  see if we can streamline it.

These are issues which will be followed up in subsequent patches.

This patch sets the groundwork for the removal of the double bitbake
execution for psuedo which will be in a follow on patch.

(Bitbake rev: b2e26f1db28d74f2dd9df8ab4ed3b472503b9a5c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:52:56 +01:00
Richard Purdie cd7b7de91a bitbake: fetch2: Fix AUTOINC handling
AUTOINC was meant to appear once at the start of the version string.
The list of names may not be sorted meaning it could get inserted in
the middle. This patch simplifies the code and ensures it appears at
the start.

Include cache version bump to ensure the cache picks up these changes.

(Bitbake rev: ad8bf10d873abb94d987860a3f6d06b134fb8a99)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:52:56 +01:00
Richard Purdie b87429fdb4 bitbake: Add missing file that went out of sync
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-12 13:13:21 +01:00
Paul Eggleton 5128f0a846 bitbake: bitbake-layers: fix for move of data object to cooker
(Bitbake rev: 063ee01935767ac4c9518d7477c8c85da1c9969a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-10 10:32:58 +01:00
Paul Eggleton 8bdbb71f74 bitbake: tinfoil: fix for move of data attribute to cooker
(Bitbake rev: c400fe36f7609d53fb413484dc03bbce307f31f9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-10 10:32:58 +01:00
Paul Eggleton be78283e6c bitbake: lib/bb/cache.py: invalidate cache when file checksum entry no longer exists
Go through the cached list of file checksums and check if any of the
files no longer exist; if any are missing then invalidate the cached
recipe, which will force it to be reparsed and thus force the list of
files to be collected again. This prevents a warning when moving a file
to a different location that is still picked up by the recipe, e.g.
moving a file from a "files" subdirectory to one named with the recipe
name (${BPN}).

Fixes [YOCTO #4474].

(Bitbake rev: e1aa103593c46612c4d9000524174983b5994dc9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 17:09:26 +01:00
Richard Purdie 3e9456322d bitbake: cooker: Split data from configuration
The reasons for combining these objects is ancient history, it makes
sense to clean things up and separate them out now. This follows on
logically from the configuration cleansups and leads well into the
bitbake-worker changes.

(Bitbake rev: 89ffd62661ebcf2a97ce0c8dfd5e4d5bfbe27de7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 16:56:26 +01:00
Alexandru DAMIAN 0ac7a182aa bitbake: bitbake: Improve remote server handling
Two fixes in bitbake related to running remote servers -
* can now specify correctly the bind port
* the information in print conforms to common server infrastructure

(Bitbake rev: b657208ee15ae065e5fcc2dd6e0051e03d246727)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 14:13:18 +01:00
Alexandru DAMIAN f549cdd712 bitbake: xmlrpc: Allow server to remain memory resident
This patch enables the XMLRPC server to remain
resident in memory after a task is run, and to accept
a new controlling client. To check the server after
task completion, do

lsof bitbake.lock

in the build directory. Kill the server with kill.

(Bitbake rev: e823e1f0675ff3794eb39ef0b4df2d7a220f4013)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 14:13:18 +01:00
Alexandru DAMIAN 748e3c13c8 bitbake: bitbake server: create common server infrastructure
In an attempt to minimize code duplication, create
clear interfaces, and maximize code reuse through OOP,
bb.server adds base classes for the BitBakeServer,
BitBakeServerConnection and actual server implementations
instructed in particular server types.

These classes document the minimum interfaces that the
derived classes must implement, and provide boilerplate code.

Changes to None, Process and XMLRPC servers as to use
the common server infrastructure.

(Bitbake rev: 6db4a64cef20f8d0aba804db4c4e1eec7b112b46)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 14:13:18 +01:00
Richard Purdie 697f74988a bitbake: Drop bitbake-runtask (removed upstream a while ago)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-04 11:54:23 +01:00
Andrei Dinu ea281d3b8e bitbake: Added distroy signal to information dialogs
Added distroy signal to information dialogs
so that when pressing the close button,
the dialog would close.

[HOB #4568]

(Bitbake rev: 265e27857d1d8914486b924d3390bfbe88f4e39b)

Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-31 08:25:40 +01:00
Mark Hatle b5255bb34d bitbake: lib/bb/cache.py: Change debugging note to a debug message
Some apparently debugging was left in in a previous commit.  This caused
bitbake to return a list of bbappends when things changed from the cache.

Make this a proper debug message.

(Bitbake rev: 1965e5cbdfede18d7b7cb0218e0a5147c3f1c884)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-31 08:25:40 +01:00
Richard Purdie 9da832146b bitbake: prserv: Unbreak after bb.server changes
(Bitbake rev: e2cc22fb8b2e97b068b6037540c746ecb1856de6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 18:05:57 +01:00
Richard Purdie eeac1e9dfd bitbake: cookerdata: Fix tinfoil by adding missinge extra_caches default
(Bitbake rev: d513153cac283aa4ec37135a9190f7a091b6c44b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 16:42:34 +01:00
Alexandru DAMIAN d0861b7a12 bitbake: bitbake: xmlrpc remote server
Added code in XMLRPC server that creates a stub local server
for a client-only connection and is able to connect to
a remote server, and receive events from the remote server.

Added the option to start a client with a remote server in
bitbake.

Original code by Bogdan Marinescu <bogdan.a.marinescu@intel.com>

(Bitbake rev: 25b2af76104d5aaf6435de8c158e0407512f97ce)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 10:44:00 +01:00
Alexandru DAMIAN 0fc3a1eddf bitbake: bitbake: xmlrpc transport has identification token
In order to be able to identify different clients over a
stateless XMLRPC connection, we add a custom header named
Bitbake-token, which identifies each client.

We refactor the rest of the code to use the new transport.

Based on a patch by Bogdan Marinescu <bogdan.a.marinescu@intel.com>

(Bitbake rev: a00c2186bffe848a7cedf31969b904f8f7322ae6)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 10:44:00 +01:00
Alexandru DAMIAN b6b30095de bitbake: bitbake: move start server code in a separate function
This is a code sanitization targeted at making further
server-related changes easier (launch a server
separately or creating a mockup-server) to do.

(Bitbake rev: eac00258d213137ef73aed255c92b7981e2f1c75)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 10:20:32 +01:00
Alexandru DAMIAN e6a1b33bc8 bitbake: bitbake: move extra cache collection out of cooker
The collection of the extra caching data should not
be performed by the cooker, but supplied to it.
This patch will also streamline the code for launching servers
without a UI attached.

Based on a patch by Bogdan Marinescu <bogdan.a.marinescu@intel.com>

(Bitbake rev: f0b54280a6bce522508e4741e5f507bc284113a8)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 10:20:32 +01:00
Alexandru DAMIAN e09a159277 bitbake: bitbake: retrieve the entire ui module in launcher
Slight change in bitbake as to retrieve the entire UI module
for further processing instead of just the main function.

Based on a patch by Bogdan Marinescu <bogdan.a.marinescu@intel.com>

(Bitbake rev: f49341a9599d971829ef65b2b02732543740a3c9)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 10:20:31 +01:00
Richard Purdie 52d05125c1 bitbake: fetch2: Fix missing function call
Fix the issue:

File: '/srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/build-appliance/build/bitbake/lib/bb/fetch2/__init__.py', lineno: 813, function: try_mirror_url
     0809:    except bb.fetch2.BBFetchException as e:
     0810:        if isinstance(e, ChecksumError):
     0811:            logger.warn("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (newuri, origud.url))
     0812:            logger.warn(str(e))
 *** 0813:            self.rename_bad_checksum(ud, e.checksum)
     0814:        elif isinstance(e, NoChecksumError):
     0815:            raise
     0816:        else:
     0817:            logger.debug(1, "Mirror fetch failure for url %s (original url: %s)" % (newuri, origud.url))
Exception: NameError: global name 'self' is not defined

(Bitbake rev: 5f960017bb1d4274a5bd5b598971f38c12fc0f11)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 09:54:35 +01:00
Richard Purdie 3fb25ef24b bitbake: server/bitbake: Remove launchUI method
With the removal of the none server type, we can remove the launchUI
method and simplify the code slightly.

(Bitbake rev: 9bef2f2dd0bcaa59528ebcb3c1ce053b7dff1ec6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 09:54:35 +01:00
Richard Purdie e118ee3ad8 bitbake: server: Remove none server
The process server backend has been serving well as the default for a long
time now and the UI model is much better thought out that it used to be. With
the move to make bitbake a memory resident process, the none server is now
looking rather pointless and complicates the code needlessly. Lets therefore
now remove it.

(Bitbake rev: 9af03a89605e3db9bce3cea1e0f2d0b6cfaa6fe1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 09:54:34 +01:00
Richard Purdie fe715c4d1b bitbake: cooker/cookerdata: Fix up event handling for hob
The init function call was clobbering data hob relies on injecting, fix
this so the data injected by hob isn't overwritten.

(Bitbake rev: 64ca1aa1fd5f0473196b6cd805637fa644a92173)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 13:57:40 +01:00
Richard Purdie 3b4b782e07 bitbake: build: Avoid empty promises
The "see xxx for further information" is misleading since it is just
the same information. Clarify just to mention the that this is the location
of the logfile without any empty promise.

[YOCTO #4343]

(Bitbake rev: 7088c0e8553dd3c408b5bc06f8c34d5b72e9ea9a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 11:30:35 +01:00
Paul Eggleton 72accaf7d9 bitbake: bitbake-layers: fix show-appends and flatten for recent cooker changes
Fixes the show-appends and flatten subcommands for recent refactoring in
cooker.

[YOCTO #4536]
[YOCTO #4535]

(Bitbake rev: 54817d0de667941ee68fe3490684159e2d90e9c5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 11:24:01 +01:00
Richard Purdie fa4b1fa257 bitbake: cooker/cookerdata: Improve configuration object handling
Originally it seemed like a good idea to keep the parameters around. Having
seen this in real life use, its incorrect, we should pull all the data we need
into the cooker's configuguration and then use this to build the datastore.

Being able to just build the datastore from the parameters seemed like a good
idea but having a dummy cooker configuration object is now looking like
the better option.

This also fixes failures in hob since the parseFiles command can call
into cooker directly now and reset the configuration prefiles and postfiles
at will, rather than the indirect calls before which were breaking the datastore
(e.g. BBPATH wasn't set).

The cleanup this allows in tinfoil illustrates how this change makes more sense.

(Bitbake rev: f50df5b891bf318f12fc61c74adfcc626cc6f836)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 10:34:53 +01:00
Richard Purdie 7cf87fc083 bitbake: fetch2: Fix missing assignment
The assignment to True was missing from the code, well spotted Saul!

(Bitbake rev: e493fe8cb4953935f01361ffc0240e5818ebb283)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 10:34:53 +01:00
Richard Purdie 507d5cc2cc bitbake: cooker/cookerdata/event: Improve class handlers management
Similarly to the execution context changes, establish better lifetime
management API of the class event handlers.

(Bitbake rev: 54e35a6cceead9521f8b1dacd48e55064e85c8bd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 10:34:53 +01:00
Richard Purdie ea34691791 bitbake: cooker/cookerdata/utils: Improve context management
The current execution context management for bitbake is ugly and the
use of a global variable is nasty. Fixing that is hard, however we
can improve things to start to establish an API for accessing
and changing that context.

This patch also adds in an explicit reset of the context when we reparse
the configuration data which starts to improve the lifecycle of the data
in setups like hob.

(Bitbake rev: 6c3281a140125337fc75783973485e16785d05a1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 10:34:52 +01:00
Richard Purdie b9bd05b672 bitbake: event: Drop Handled/NotHandled status return values
These have long since been deprecated, lets remove them.

(Bitbake rev: 3dc83bbb1bf387bb7ecea2e17f0f72cfccecba92)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 10:34:52 +01:00
Richard Purdie 0130b4c269 bitbake: cooker.py: Remove global scope class event handlers
Its confusing when an event handler in for example a bbclass receives
events for a recipe which doesn't use the class. This is due to the
class event handlers having confusing scope. Worse, the issue is not
deterministic and the events a handler will see depends on the parse
order.

To avoid these issues, remove the class event handler global scope
and only have class handlers recieve events for recipes using the
class.

(Bitbake rev: 7fb95f3d133e440d463d2faa7151c731f8e1ae96)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 10:34:52 +01:00
Richard Purdie 8bef99d3c8 bitbake: methodpool: Retire it, remove global method scope
Having a global method scope confuses users and with the introduction
of parallel parsing, its not even possible to correctly detect conflicting
functions. Rather than try and fix that, its simpler to retire the global
method scope and restrict functions to those locations they're defined
within. This is more what users actually expect too.

If we remove the global function scope, the need for methodpool is reduced
to the point we may as well retire it. There is some small loss of caching
of parsed functions but timing measurements so the impact to be neglibile
in the overall parsing time.

(Bitbake rev: 4d50690489ee8dc329a9b0c7bc4ceb29b71e95e9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 10:34:52 +01:00
Richard Purdie 3c5b9cf15f bitbake: methodpool: Conflicting methodnames should be a fatal error
When this error occurs, the build should stop, not continue uninterrupted.

[YOCTO #4460]

(Bitbake rev: acd6d7ffa8813b3b11cad9145e8e614a695ae04a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 10:34:51 +01:00
Cristiana Voicu 3216f00f86 bitbake: hob: Table sorting criteria should not change after deselecting recipes/packages
After a recipe/package is deselected, the table is sorted as before the
fadeout animation.

[YOCTO #4453]
(Bitbake rev: d4968eac539f777367ab1243a1049117cb261176)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 16:25:11 +01:00
Cristiana Voicu da34a8db49 bitbake: hob: apply a fade out animation when deselecting from tables
-applied a fade out mechanism for deselctiong on all the tabs of
recipes and packages list page
-set cursor on the package/recipe when it is included(important
when the its place is changing; like when the tree si order by
included tab)

[YOCTO #4342]
(Bitbake rev: 8bd0e0681a6a39c00accbfc0041ab248993f3877)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 16:25:10 +01:00
Paul Eggleton 25182cd849 bitbake: cookerdata: rename _parse to parse_config_file
We use this externally in the OE layer index update script, so it
shouldn't really be named as an internal function.

(Bitbake rev: 89332a7874e94c8d91ea24200f9739abb1a50397)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 16:25:10 +01:00
Paul Eggleton a4bf49052b bitbake: tinfoil: fix for changes to cooker config structure
Fix the code here for recent changes to the initialisation of
configuration objects for cooker.

(Bitbake rev: 9d3ca9aa73a448b0594f03ac8e8317403ec0dc8d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 16:25:10 +01:00
Paul Eggleton 25905ae637 bitbake: bitbake-layers: fix for move of calc_bbfile_priority within cooker
calc_bbfile_priority is now in CookerCollectFiles which can be accessed
on the collection attribute of a cooker instance.

Fixes [YOCTO #4513].

(Bitbake rev: 5d941631ad7198737d9a5c5a920a9062fa0431f8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 16:25:10 +01:00
Richard Purdie 49f127827d bitbake: command: Fix function module reference after code rearrangement
(Bitbake rev: ff9f62fd5f76892ad41a5329b75472501e17e712)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 16:21:56 +01:00
Richard Purdie 0c0bb02f51 bitbake: runqueue.py: Ensure export flag is set for fakeroot environment variables
This means the variables show up in the shell execution "run" files since
its useful to know what the fakeroot environment is and how to set it up
manually.

(Bitbake rev: bdf437747b664479acde6deaa9096e2a6bcdf483)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 12:10:14 +01:00
Richard Purdie ba707d0ffa bitbake: bitbake/cookerdata: Explicitly specify cooker configuration options
As the code stands today its hard to know which configuration variables
are used by which parts of the system. Some are used by the UIs, some
by bin/bitbake itself, some by cooker.

This patch changes the configuration to just contain the variables cooker
uses, and changes bin/bitbake to access the variables it needs directly
which hopefully lets us start to untangle this mess.

(Bitbake rev: e57497a24b6157c92519a34accd66035a39ad1f8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 12:10:14 +01:00
Richard Purdie 26d19996a3 bitbake: cooker: Split configuration parsing code into cookerdata
In order to have a memory resident bitbake and to allow task execution, we need
to be able to rebuild the base configuration without a cooker. This moves the
code into its own class so it can be built independently.

The interface is less than ideal here but I didn't want to add parsing methods
a subclassed DataSmart, at least until we've experimented further with this code
and are certain that makes sense. At the very least, the methods are ugly and need
cleaning up.  Spliting the code out seems to be the right thing to do though and
should unblock various activities on BitBake so I believe this code is a step in
the right direction.

Based on a patch from Alexandru Damian <alexandru.damian@intel.com>

(Bitbake rev: 22a0b3cf73d2689db0c118b37aa7492632f8b0a7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 12:10:14 +01:00
Richard Purdie f0930c8d63 bitbake: cooker: Move commandline parsing back into the UI/cookerdata
Building up a set of actions for the server is tricky since we depend upon the
commandline but fall back to values from the datastore. We should be able to build
a datastore without a commandline and vice versa. Ultimately the UI should send
the commands to the server.

This patch amounts to code rearranging, moving the heavy lifting to the UI, though
a helper in the configuration option. This will need further cleanup/tweaking but
this should be the only update needed to the UIs. The code now queries the server
for any missing data should it need to.

This code allows various knowledge of configuration variables to move to the UI side
only, partcularly pkgs_to_build but also all the command specifiers. It should also
be possible to move cmd eventually, I'm just unsure if any callers call the commands
expecting this to default to something sane right now.

(Bitbake rev: 2dbbb1d51dafd4451fef8fe16f095bcd4b8f1177)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 12:10:13 +01:00
Richard Purdie f242f5060b bitbake: bitbake: Create cookerdata splitting config from cooker and bin/bitbake
Currently the UI and server configuration is one big incestuous mess. To
start to untangle this we creater cookerdata, a new module which contains
various confiuration modules and the code for building the base datastore.

To start with we add a ConfigParameters() class which contains information
about both the commandline configuration and the original environment.

The CookerConfiguration class is created to contain the cooker.configuration
options. This means we can transfer new paramters to the server over something
like XMLRPC and then build a new configuration from these on the server.

Based on a patch from Alexandru Damian <alexandru.damian@intel.com>

(Bitbake rev: 35bd5997e8d8e74bc36019030cc10c560a8134f9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 12:10:13 +01:00
Richard Purdie 308ae92100 bitbake: bin/bitbake: Improve exception handling
Due to the internal event processing, this excepting handler usually raises an
Empty error, masking the underlying failure. Ensure the original exception is
raised.

(Bitbake rev: 7d548568a55adfe84a976f2a549995e42da1afef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 12:10:13 +01:00
Richard Purdie 77fc40a0f8 bitbake: fetch2: Shorten long srcrevs
The long srcrevs are mainly used or the workdir construction as well as
the package version. The long entries are hashes generated by the git fetcher
and other scms using a similar revision mechanism.

We need these to change when the package changes however collisions are
unlikely to happen within the domains we care about. The long revisions
have generated negative user feedback due to the use in path and file
names.

This patch therefore truncates the revisions to 10 characters maximum.

This should be safe in the contexts where these revisions are used as
the chances of spatially close collisions is very low (distant
collisions are not a major issue in the way we use these).

(Bitbake rev: 43a8319cda7fae37862dae323eeb24cb39ca21b7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 12:10:13 +01:00
Richard Purdie d228f9d938 bitbake: fetch2/git: Clean up sortable_revision
Now we no longer try and provide increasing values from the fetcher,
we can simplify the function structure for the sortable_revision
pieces and move the AUTOINC handling directly into the function
which needs it, simplifying the code.

(Bitbake rev: fb068bee47bb1a06f02447daf16c2b2a79c03288)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 12:10:12 +01:00
Richard Purdie 608821349c bitbake: data: Ensure dependencies of subfunctions are accounted for
Currently we account of the top level function's vardeps but not
those of any subfunction. This would imply we'd have to manually
write the dependencies of all parent functions which would be crazy.

This patch adds the dependencies to fix the issue.

(Bitbake rev: 658008cc6a8acd5c1f26877c9444c96002db01e7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 12:10:12 +01:00
Richard Purdie 350c36fcd9 bitbake: test/fetch: Allow the conditional network tests to work under python 2.6
The skipIf decorator is unavailable under python 2.6 and finding a syntax
works there is hard. This patch does allow network tests under 2.6.

(Bitbake rev: 565b3e31e0226c6e193ee0b031bd5e7bef25591e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-17 12:42:08 +03:00
Richard Purdie c8ab3b0810 bitbake: test/fetch: Split the network tests from the rest of the fetcher tests
(Bitbake rev: f32265bcc6b4fe5566aca16f6b05555ec6a96d01)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-17 12:42:08 +03:00
Richard Purdie 4d3a53ff36 bitbake: fetch2/utils: Clean up imports
Move various random imports to the start of the modules as cleanup
and avoid an import issue with bb.process on python 2.6.

(Bitbake rev: aed4adfbe3a591ca4f8e41fb763c9f961bf2e6d5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-17 12:42:08 +03:00
Richard Purdie 0a52bdfb9a bitbake: tests/fetch: Allow to work on python 2.6
Currently the fetch tests fail on python 2.6 since check_output
doesn't exist on this version of python. Use bb.process instead
to avoid this problem.

(Bitbake rev: a3637155e829e06bbfe50fb8753de3de7ee8c22e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-17 12:42:08 +03:00
Richard Purdie bd27cca7e6 bitbake: bin/bitbake: Fix queue import for pyhton 2 and 3
(Bitbake rev: 782bc0e797802224f06cb6f9098a50d658c86523)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-14 15:04:18 +03:00
Bogdan Marinescu 4f070506df bitbake: hob: fix for XMLRPC mode
Contains a small fix to the builder.py code
(a missing "self" in a variable assignment).
With this changes, "hob" can run with the XMLRPC backend:

$ hob -t xmlrpc

(Bitbake rev: 3497478f803986af32099ddd124c47df8e89f6da)

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-14 14:57:27 +03:00
Richard Purdie 96b428908c bitbake: cooker/bitbake-layers/tinfoil: Fix recipecache typo
(Bitbake rev: 0f5eee689992f84d263cb817dc2ce755a9a075f7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-13 21:53:37 +03:00
Richard Purdie f7afeeb759 bitbake: bitbake-layers/tinfoil: Catch up with status -> recpiecache rename
(Bitbake rev: 0a9cbe7a6a17c5df38cd442ee8650097d6bbf502)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12 18:00:46 +01:00
Richard Purdie 5ea4d8167d bitbake: cooker: Rename status variable to recipecache
"status" is a relic of very early versions of bitbake, rename it to match what it now
means.

(Bitbake rev: db307fc68773868de2db614a061f51c5c6a90468)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12 08:26:15 +01:00
Richard Purdie 9ed7cd13fd bitbake: cooker: Rename confusing buildDepgraph task to handlePrefProviders
(Bitbake rev: a25722175bf61f22961f45dbd356cb6d79864b35)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12 08:26:15 +01:00
Richard Purdie 8c7a23ed3f bitbake: cooker: Drop pointless variables
(Bitbake rev: 0d7517db234ef5f6b3eb99822ecb5e86cf48fe2e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12 08:26:15 +01:00