Commit Graph

168 Commits

Author SHA1 Message Date
Chris Larson 36d1dcef65 cooker: show a useful message for ParsingFailure
(Bitbake rev: a41c217c6e9195f8b9ea2de6e1d335b10b904558)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:24 +01:00
Richard Purdie d276be69d2 bitbake/cooker.py: Fix debug message arguments
(From Poky rev: 06bb59d)

(Bitbake rev: b420e865f6dfb04b58c1dbc5f1b5332b137f49ff)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:23 +01:00
Richard Purdie cd3c4292e7 bitbake: Cleanup bitbake server init process to be clearer to follow
Create a standard format server class instance with method calls
for each step in the server setup. There should be enough hooks
for each of the different server types.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 11:37:26 +01:00
Liping Ke 5af197b55a cache: Implement multiple extra cache fields request support
This patch is to support extra cache. If user needs to request
extra cache fields besides CoreRecipeInfo fields, just add a new
XXXRecipeInfo class definition as Hob Does.
Currently supported Extra RecipeInfo name is an array. We can
support multiple extra cache fields at the same time besides
CoreRecipeInfo which is needed by all clients.

(Bitbake rev: 077657e50ad032c0fa876bf54e9802af2686e0fb)

Signed-off-by: Liping Ke <liping.ke@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-07 22:40:01 +01:00
Liping Ke b3c41b1f46 Introduce new param caches_array into Cache impl.
When using hob ui interface, we need extra cache fields.
We will save ui required extra cache fields into a separate
cache file. This patch introduce this caches_array parameter.
It will be used in the extra cache implementation (following patch).
Caches_array at least contains CoreRecipeInfo. If users need extra
cache fields support, such as 'hob', caches_array will contain
more relevant elements such as HobRecipeInfo.

(Bitbake rev: d50389ae692377c957afec7c846fc2ce2c070a09)

Signed-off-by: Liping Ke <liping.ke@intel.com>
2011-06-07 22:39:52 +01:00
Paul Eggleton 58bdecbc43 bitbake: use layer priority when applying bbappends
If the priority of a layer has been specified with BBFILE_PRIORITY_ then
use that to sort the list of BBFILES entries, which will affect the order
in which .bbappend files are applied.

Fixes [YOCTO #1125]

(Bitbake rev: a8ab0af776ba20c83832215054180fbd15c274c0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-01 14:08:32 +01:00
Richard Purdie fd00566144 bitbake/codeparser: Improve cache handling
The current codeparser cache handling hurts performance badly even
over a couple of cores and certainly on many core systems, it can
spent huge amounts of time in the codeparser cache save functions.

This patch reworks the cache handling so that each parsing thread
saves out its own "differences" file compared to any existing core
cache and then the main bitbake thread picks these up and merges
things back together.

This was tested on systems with small and large numbers of cores
and was found to perform orders of magnitude better in all cases
despite the more complex code.

(Bitbake rev: 9f27563d66523f5af1028f173d53ee75e0877d46)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-27 17:55:51 +01:00
Richard Purdie 00c71132d5 bitbake/cooker.py: Ensure BBFILES is processed in order
The files found by collect_bbfiles should be processed in order but due
to being processed using python's set(), the order was not being preserved.

Use a list instead as whilst the code is slightly more ugly, order
is preserved.

Addresses [YOCTO #1100]

Acked-by: Darren Hart <dvhart@linux.intel.com>
(Bitbake rev: c12dd868368bdc3a4f800e075a30c67edca28d47)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-27 17:55:50 +01:00
Richard Purdie 65b5553278 bitbake/cooker.py: Fix -b option regexp handling
bitbake -b core-image was showing no matches when it should list all targets
containing the fragment "core-image". This patch only calls os.path.abspath()
on things that look like paths and passed the path around more consistently to
various functions to get this use case working again.

(Bitbake rev: 6e9119c42d3f4cb3dab3d25856eee8b4bf4ad94f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-27 17:55:50 +01:00
Richard Purdie 42076dc9b6 cooker.py: Don't show spurious warnings for collections of .bbappend files
Seeing warnings like:

WARNING: No bb files matched BBFILE_PATTERN_yocto '^/xxx/meta-yocto/'

are not encouraging to users and we shouldn't show these if we found
.bbappend files (but no .bb files). This change stops these warnings
from appearing.

(Bitbake rev: 48899fe7b3791dd897968f44c317e98bad14e146)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-25 23:47:22 +01:00
Chris Larson 628bd54d93 cooker: fix -b with BBCLASSEXTEND
(Bitbake rev: 58bdaeb679d3c84cda827a33d09ce543547c45b4)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-06 15:37:39 +01:00
Richard Purdie 001a555c2f bitbake/cache.py: Ensure skipped recipes make it into the cache to avoid reparsing
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-05 15:53:09 +01:00
Richard Purdie c8928e93dd bitbake/cooker/codeparser: Ensure the code parser cache is saved for each parsing process
Before this change, the codeparser cache was only being saved for the main
server process. This is suboptimal as it leaves code being re-evaluated at
task execution time and increases parse time.

We use the multiprocess Finalize() functionality to ensure each process
saves out its cache. We need to update the cache save function to be multiprocess
friendly with locking.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-05 15:52:53 +01:00
Saul Wold 28e7041a9c universe target: add a new target to collect all recipe targets
This new universe target is not intended to be used for
compiling or building everything, it use is for sanity checking
and other tasks that need to find all targets. This does not
exclude any broken or virtual targets.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-05-03 12:10:53 +01:00
Joshua Lock 3c113f355b bitbake/cooker: don't error in prepareTreeData for unbuildable targets
Set abort to False in prepareTreeData so that unbuildable targets do not
raise an exception.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-03-14 20:48:02 +00:00
Joshua Lock c2814caa5d bitbake/cooker: don't drop possible_world ref count
We need this if we want to run the buildWorldTargetList function more than
once, for example in a UI where we can change the MACHINE and DISTRO as much
as we like before triggering a build.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:53 +00:00
Joshua Lock a13304e1c6 bitbake/[cooker|cache]: cache summary, license and group. Add to targets tree
Add summary, license and group metadata to RecipeInfo and the cache.
Unfortunately this impacts parse speed but gives us a much richer set of
metadata to expose through UI's which can be accessed via the
generateTargetsTree command.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:51 +00:00
Joshua Lock 3c1a3b0724 bitbake/cooker: reduce code duplication
Move runqueua and taskdata initialisation into a new function,
prepareTreeData(), so that generateDepTreeData() and
generateTargetsTreeData() are not duplicating the same logic.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:51 +00:00
Joshua Lock dcfc5ae7b1 bitbake/cooker: add generateTargetsTree method
The generateTargetsTree() command needs to return a model which includes more
metadata than the one generated by generateDepTree().

This patch adds a new method generateTargetsTreeData() to the cooker, based
on generateDepData(), and switches generateTargetsTree() to use it.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:51 +00:00
Joshua Lock 3939a216a5 bitbake: implement command to find configuration files for a config variable
Some configuration variables (MACHINE, MACHINE-SDK and DISTRO) set which
confguration files bitbake should use.
The added command , findConfigFiles, enables a UI to query which files are
suitable values for a specified parameter.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:51 +00:00
Joshua Lock 1b3eb0c35f bitbake: implement command to get all possible targets and their dependencies
Add a new command generateTargetsTree() which returns a dependency tree of
possible targets (tasks and recipes) as well as their dependency information.

Optional parameter 'klass' also ensures any recipes which inherit the
specified class path (i.e. 'classes/image.bbclass') are included in the model

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:50 +00:00
Richard Purdie 56a92105fe bitbake/cooker: Fix parsing failure zombie problem
When parsing if a SystemExit event is triggered, it causes the parsing thread to
exit and the main process hangs waiting for it to finish indefintely. Add code to
catch BaseExceptions and raise these with the main process gracefully instead
of just hanging indefinitely with zombie processes.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-23 11:09:07 +00:00
Richard Purdie 579ecccc22 bitbake/cooker: Ensure delays are accurately transfered to the idle loops from runqueue
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-15 23:18:39 +00:00
Richard Purdie 0e26f53f9e bitbake/cooker.py: Fix merge conflict with upstream which was preventing clean bitbake shutdown
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07 13:54:50 +00:00
Richard Purdie 0090a798eb bitbake: Sync a load of whitespace and other non-functionality changes with bitbake uptream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:54 +00:00
Chris Larson d951aa40a0 Move LAYERDIR expansion hack into DataSmart
(Bitbake rev: 40778a6e9e82c7ea4673a74fc19574430fa63e8d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:52 +00:00
Bob Foerster 2735a70ece Show the user progress when loading the cache
(Bitbake rev: bdd7813d8eecf7b6b636322e748ca6bf69118513)

Signed-off-by: Bob Foerster <robert@erafx.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:51 +00:00
Chris Larson 2984877989 cooker: don't swallow recipe parse errors
(Bitbake rev: 1f5d49ce64e5e1c7705edbfa3c8e19649c21edd2)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:51 +00:00
Chris Larson 098f63d672 Rename command events, adjust compareRevisions
- Moved the logic for comparing revisions from cooker into command
- Removed 'Cooker' from the event names
- Renamed the 'ExitCode' event into CommandExit, and changed CommandFailed to
  be a subclass of CommandExit

(Bitbake rev: c51ed5d7a9971fad6019dac6c35a71b8a54ab16a)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:49 +00:00
Chris Larson 246bd18613 cooker: add shutdown/stop methods
(Bitbake rev: fc64eff03fe1f41e59128cb3df0ef2161e24a8cb)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:47 +00:00
Chris Larson 825e5045f4 cooker: merge cookerState and cookerAction
(Bitbake rev: c7c8945ef7ca9465312e630b7fa5f0a87ac8b6c7)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:47 +00:00
Chris Larson ac4d926f41 cooker: use a pool, abort on first parse error
(Bitbake rev: 9caf65e79f95fe0045e727391e974c4c1e7411ff)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:46 +00:00
Chris Larson 7ea3c96938 Fix the <100 recipe progress fix
(Bitbake rev: 424428a764651183218f9cc93bc05496867aa5de)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:46 +00:00
Chris Larson c4e07bc033 cooker: don't choke on <100 recipes to parse
(Bitbake rev: 2be5169a01e57bcfcb1f75cbd6bac3bf0f230edd)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:45 +00:00
Chris Larson b8aedaa6b5 cooker: no cached in progressbar and add ETA
Rather than updating the progress bar based on the recipe being processed
(whether cached or parsed), consider only parsed recipes.  This reduces the
instability in progress rate introduced by the cached entries, and allows the
ETA to be resurrected and be a bit more useful.

(Bitbake rev: 618480f7739f6ae846f67a57bee5a78efb37839d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:45 +00:00
Chris Larson 5bff22988c cooker: pass back child exceptions to the server
(Bitbake rev: 0f68f8bcd0e0aa944f76f88a4a85c9bcc1e42bee)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:45 +00:00
Chris Larson 7a7e2f4e59 cooker: ensure that the cache sync completes
Without explicitly joining the thread, it's possible for the process to end
(e.g. after a bitbake -p) and kill off the thread without waiting for it to
exit cleanly.  So, register the thread join with atexit.

(Bitbake rev: 97ce57e6f860d3e6f34cc7a603ed1eeac4f423d3)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:44 +00:00
Chris Larson f4a06aac98 cooker: get number of threads in constructor
(Bitbake rev: e7fd259d1528f48b0812fb7b0a54dd6d5d22f4a9)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:44 +00:00
Chris Larson a519031f23 cooker: don't add info for skipped recipes
(Bitbake rev: ac596d55de4ad86e1cdc84dabfea1350dd54efd0)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:44 +00:00
Chris Larson 60226ff35c cooker: show progress bar before initializing the cache
This ensures that the time spent loading the cache from disk occurs with the
progress bar up.  Though the progress bar stays at 0% during this period, I
think this is an improvement over the multi-second stall which occurred
previously before the progress bar came up.  Ideally, we'd integrate cache
loading from disk into the progress display, but this is a first step.

(Bitbake rev: f6d0a5c219f9deb84f702450d30d868ba6271f77)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:44 +00:00
Chris Larson 6cd15a1ea0 cooker: save progress chunk value (total/100)
(Bitbake rev: 09333737cbeeb9875d938521ddcd519fc808bcc3)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:43 +00:00
Chris Larson 739bb5a2d1 cooker: stop loading the cache for -b
Previously, the cache was actually being loaded from disk twice whenever using
-b or -e -b.  This also moves the bb_cache instance into the CookerParser, as
it's not needed by the cooker itself at all.

(Bitbake rev: dd0ec2f7b18e2a9ab06c499b775670516bd06ac8)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:43 +00:00
Bob Foerster 065da895d2 cooker: don't fire unnecessary parse progress events
(Bitbake rev: 7cf7d5f14405681496fced3640a50a20ef1acac1)

Signed-off-by: Bob Foerster <robert@erafx.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:43 +00:00
Chris Larson 7c9444e9a5 cache: sync the cache file to disk in the background
This version uses a thread rather than a process, to avoid problems with
waitpid handling.  This gives slightly less overall build time reduction than
the separate process for it did (this reduces a -c compile coreutils-native by
about 3 seconds, while the process reduced it by 7 seconds), however this time
is quite insignificant relative to a typical build.

The biggest issue with non-backgrounded syncing is the perceived delay before
work begins, and this resolves that without breaking anything, or so it seems.

(Bitbake rev: 5ab6c5c7b007b8c77c751582141afc07c183d672)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:43 +00:00
Chris Larson 32ea766871 Implement parallel parsing support
This utilizes python's multiprocessing module.  The default number of threads
to be used is the same as the number of available processor cores, however,
you can manually set this with the BB_NUMBER_PARSE_THREADS variable.

(Bitbake rev: c7b3ec819549e51e438d293969e205883fee725f)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:42 +00:00
Chris Larson acca344057 cache: create and use a RecipeInfo class
This class holds the particular pieces of information about a recipe which are
needed for runqueue to do its job.

By using it, I think we improve code clarity, reduce method sizes, reduce
overuse of primitive types, and prepare for parallel parsing.  In addition,
this ditches the leaky abstraction whereby bb.cache attempted to hide the
difference between cached data and a full recipe parse.  This was a remnant
from the way things used to be done, and the code using it had to know the
difference anyway.  If we choose to reimplement caching of the full recipes,
we can do it in bb.parse, in a completely transparent way.

(Bitbake rev: 992cc252452221f5f23575e50eb67528b2838fdb)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:42 +00:00
Bob Foerster c6328564de Prefer xrange over range for small performance gain.
range() allocates an actual list when called.  xrange() is just an iterator
and creates the next range item on demand.  This provides a slight
performance increase.

In python 3, range will do what xrange does currently, but the upgrade will
be handled by the 2to3 tool.

(Bitbake rev: 73b40f06444cb877a5960b2aa66abf7dacbd88f0)

Signed-off-by: Bob Foerster <robert@erafx.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:42 +00:00
Chris Larson 9c7c18d06f Pre-explode rundeps/runrecs in CacheData
(Bitbake rev: 0c8e0f3191252ccedb83c431c48e5c7d905e2717)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:40 +00:00
Chris Larson 17ea152990 Fix GraphViz .dot output for rdepends and rrecs
Use bb.utils.explode_deps to break up the rdepends and rrecommends strings.
This fixes the same issue which was fixed by a number of patches floating
around, but uses explode_deps rather than regular expressions.

(Bitbake rev: 83cdb23f8b89453a3527a276bd0b4deb85d63deb)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:38 +00:00
Chris Larson 493f0cff71 Resurrect display of failed files
This was inadvertantly removed when trying to reduce the amount of duplicated
information the user sees when a failure occurs.

(Bitbake rev: 850d6158ea9daa58e896fd6b258d586df797dcf4)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:38 +00:00
Chris Larson c81cd1be64 Fix syntax issue and don't include 'd' in ui_queue
(Bitbake rev: bed8e09971dc577f5443ad3d89aa14634c54eb16)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:37 +00:00
Chris Larson 26eda93337 Queue up events before the UI is spawned
- Queue up any events fired to the UI before the UI exists
- At exit, check if UIs exist, and if not, flush the queue of LogRecords to
  the console directly.
- When establishing a connection from the UI to the server, flush the queue of
  events to the queue in the server connection, so the UI will receive them
  when it begins its event loop.

(Bitbake rev: 73488aeb317ed306f2ecf99cc9d3708526a5933c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:37 +00:00
Chris Larson 9897d56861 Simplify build exception handling
- Drop EventException
- Use FuncFailed as the primary function failure exception, using TaskFailed
  for the event (leaving it up to the process running exec_{func,task} to
  display the more detailed information available in the exception).
- Switch InvalidTask to an exception rather than an event, as that's a
  critical issue.
- Reduce the number of messages shown to the user when a task fails -- they
  don't need to be told it fails 12 times.  Work remains in this area though.

(Bitbake rev: 06b742aae2b8013cbb269cc30554cff89e3a5667)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:35 +00:00
Chris Larson ecc68fa4fb Switch bitbake internals to use logging directly rather than bb.msg
We use a custom Logger subclass for our loggers

This logger provides:
- 'debug' method which accepts a debug level
- 'plain' method which bypasses log formatting
- 'verbose' method which is more detail than info, but less than debug

(Bitbake rev: 3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:33 +00:00
Richard Purdie 0ba9a9fffe bitbake: Overhaul environment handling
Currently, anything whitelisted in the environment makes it into the worker
processes. This is undesireable and the worker environment should be as
clean as possible. This patch adapts bitbake sosme variables are loaded into
bitbake's datastore but not exported by default. Any variable can be exported
by setting its export flag.

Currently, this code only finalises the environment in he worker as doing so
in the server means variables are unavailable in the worker. If we switch
back to fork() calls instead of exec() this code will need revisting.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-09 13:16:14 +00:00
Joshua Lock c538ef33aa bitbake/cooker: fix idle command processing in servers
idle command processing in each of the servers does not handle an explicit
None return value, which means the goggle UI ends up repeatedly adding
"Tasks Summary:" rows to the list.

This patch modifies BBCooker.buildTargets.buildTargetsIdle to return False
when BuildCompleted is fired, as is done in BBCooker.buildFile.buildFileIdle.
It may be that the correct way to fix this is to change the idle command
processing in the servers.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-12-09 12:41:44 +00:00
Richard Purdie d4125bcac0 bitbake: Simplfy pre and post cooker hooks
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-28 13:54:31 -08:00
Richard Purdie 05ba6fc7cb bitbake: Rewrite profiling code so its functional for both none and xmlrpc backends
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-13 21:23:54 +08:00
Richard Purdie 9747616600 bitbake/siggen: Ensure full signature data is not held unless needed, reducing memory consumption
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-29 10:47:17 +01:00
Richard Purdie 43595fabbe bitbake: Implement signatures
Includes functionality to find out what changes between two different singature data dumps.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-03 16:08:32 +01:00
Richard Purdie 9897b81e56 bitbake/codeparser: Implement persistent cache
For a given input to this code, the output doesn't change to implement a persistent
cache of the data to speed up parsing.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-31 14:49:14 +01:00
Richard Purdie ca09a6f08c bitbake/cooker.py: Don't init the fetcher in the worker case
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-20 11:26:14 +01:00
Richard Purdie b6bfe14205 bitbake: Switch to use subprocess for forking tasks and FAKEROOTENV to run shell and python under a fakeroot environment
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 22:36:25 +01:00
Richard Purdie 96ec9f8a60 bitbake/cooker.py: Allow idle handlers to pass through a true value
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 11:41:44 +01:00
Richard Purdie 5d9f37873d bitbake: Split Runqueue into two classes, a data processor and the execution part
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-18 11:49:58 +01:00
Richard Purdie 36e81a844b bitbake/cooker: Make sure no locks are held before we start forking workers
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-12 14:41:32 +01:00
Richard Purdie 16d299c6ce cooker.py: Fix case of -b option with a full filepath
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-04 16:12:46 +01:00
Richard Purdie 63e6ba8567 bitbake: Add support for .bbappend files (see mailing lists for detais)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 15:10:40 +01:00
Richard Purdie 90db9f3074 bitbake: Remove two layers of unnecessary functions from task execution
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 12:31:19 +01:00
Richard Purdie 14df571486 bitbake: Fix handling of empty variables in local config files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Chris Larson 04b2a78837 Add a warning if a BBFILE_PATTERN doesn't match any bb files
Likely cause is, of course, typo in the pattern or incorrect BBFILES, so we
should warn the user about this.

(Bitbake rev: b781317b5006bc047a59e7fa3c93344115e78ccb)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Chris Larson ef1de9ecaf Apply some 2to3 refactorings
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Chris Larson b9f8af16f4 Until the interactive mode is fixed, kill it from the valid options, to avoid confusion
(Bitbake rev: 65a51bb20677148a29b9e472f6d9d0a97798f024)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Chris Larson 56f083ad13 Switch from our own 'dummywrite' class to StringIO
(Bitbake rev: f5b7e16adf86950d91a88a343031e71beb0f08a6)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:36 +01:00
Chris Larson 39f6ec5f63 cooker: Kill __getitem__ usage on exception objects (python 3 prep)
(Bitbake rev: 1239df8b82ddcd607630da5a888ca83051a22fa8)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:36 +01:00
Bernhard Reutner-Fischer 186f857466 cooker: use time.strftime() instead of spawing sh with date
time.strftime() defaults to using time.localtime(), use that instead
of spawning "sh -c 'date +<FMT>'"

(Bitbake rev: ec1f2773b4811b3beb52710120bb5a9b215c174e)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:35 +01:00
Chris Larson 4802a9d07a Move a var definition in cooker.parse_next
(Bitbake rev: 1b378ddf3dc9b2aa5384e8b28945b63fc623a6a4)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:34 +01:00
Chris Larson c3eae29efa Don't try to expand non-string values
(Bitbake rev: fe36a726b9f930bbd6fd758c0aee78559e95f02b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:34 +01:00
Chris Larson c04cee7ce8 Search up the directory tree for bblayers.conf
(Bitbake rev: 1c6b31c649474b4c2b63ef9d9311e61de20bc8c2)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson 3238125138 Add a hack to avoid the req that all vars using LAYERDIR be immediately expanded
See the comment in the code for details.

(Bitbake rev: 849dbd63244cbc4eaca0f1beedbb67baca024629)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson dc39ebe91e Move the unset BBPATH sanity check after the bblayers processing
This way we can fully utilize bblayers, you can do everything in bblayers.conf
and avoid setting any environment variables at all.

(Bitbake rev: 5def1c8c31432968349f9b29d6333d7962260a8b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson ad543e2e41 Apply the 2to3 print function transform
(Bitbake rev: ff2e28d0d9723ccd0e9dd635447b6d889cc9f597)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson 1c74fd768f Import fixups
(Bitbake rev: 4fa052f426e3205ebace713eaa22deddc0420e8a)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson 7acc132cac Formatting cleanups
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson 87f62d7c8d Ensure we always utilize the correct messaging domains
(Bitbake rev: 92a2e2e90981c0615171abe03645a772d84f6986)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:31 +01:00
Enrico Scholz ca9a956abc Made '-b' work with BBCLASSEXTEND
When BBCLASSEXTEND is set, '-b' builds usually failed with messages
like

| ERROR: Parsing error data_fn virtual:native:<recipe>.bb and fn
<recipe>.bb don't match
|
|   File ".../bb/providers.py", line 47, in sortPriorities
|     priority = dataCache.bbfile_priority[f]
| KeyError: 'virtual:native:<recipe>.bb'

This patch fixes it and allows to specify the alternative class in a
way like

| ./bitbake -b virtual:native:<recipe>.bb

This patch was written to be so minimal as possible; variables should be
probably renamed to reflect their new meaning.

(Bitbake rev: f1c7fe9fc12161ceb3fe201cde370b929b208729)

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:31 +01:00
Jeff Dike f9d7e9e3be bitbake: Move the logger initialization from cooker to utils
In order to move the environment cleaning, which wants to log a
message, before cooker creation, the logging facility initialization
needs to happen earlier.  So, it is now in init_logger in utils.py and
called from bitbake before the creation of the data object.

It also seems more correct to initialize a global facility like this
from a more global context than the creation of an object, of which
there could theoretically be many.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-29 13:32:04 +01:00
Richard Purdie 871f731e57 bitbake/cooker.py: Finishing the command needs to happen after the BuildCompleted event else the cooker can shutdown first
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:31:23 +00:00
Chris Larson 19d5f2b067 BBFILES: use a set to remove duplicates when collecting.
(Bitbake rev: b1b06133da4ca379a60775552d481f7fbf77e999)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:26:02 +00:00
Richard Purdie 666c753d4b bitbake/cooker.py: Add support for a bblayers.conf file
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 17:48:31 +00:00
Bernhard Reutner-Fischer 04263dc426 cooker: bail out early if no files to build
This prevents a misleading backtrace:
ERROR: no files to build.
Command execution failed: Traceback (most recent call last):
  File ".../bitbake/build/lib/bb/command.py", line 83, in runAsyncCommand
    self.cooker.updateCache()
  File ".../bitbake/build/lib/bb/cooker.py", line 779, in updateCache
    if not self.parser.parse_next():
  File ".../bitbake/build/lib/bb/cooker.py", line 969, in parse_next
    cooker.bb_cache.sync()
UnboundLocalError: local variable 'cooker' referenced before assignment

(Bitbake rev: 060ef3d957615b7eb1209dc0d01ebeb53f8c4edc)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 15:03:46 +00:00
Chris Larson ada2a8494a Avoid unnecessary calls to keys() when iterating over dictionaries.
dict objects provide an __iter__ method for the iteration which gives you the
keys, so calling keys directly is unnecessary, and isn't really a best
practice.  The only time you really need to call the keys is if there's a
danger of the dict changing out from underneith you, either due to external
forces or due to modification of the iterable in the loop.  Iterations over
os.environ are apparently subject to such changes, so they must continue to
use keys().

As an aside, also switches a couple spots to using sorted() rather than
creating a temporary list with keys() and sorting that.

(Bitbake rev: 5b6ccb16c6e71e23dac6920cd2df994d67c2587b)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 15:01:59 +00:00
Richard Purdie 7e8025459e bitbake/cooker: Drop unneeded import
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-22 00:04:18 +00:00
Richard Purdie 22c29d8651 bitbake: Switch to bitbake-dev version (bitbake master upstream)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20 18:46:02 +00:00
Richard Purdie cb8684f9bc bitbake/cooker.py: Fix handling of extra configuration files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 12:48:49 +00:00
Richard Purdie 483f85802a bitbake: Sync various functions with those from bitbake-dev and bitbake upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
Richard Purdie 64b04685b6 bitbake: Add a --revisions-changed commandline option to indicate when floating srcrevs have changed
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-07-29 14:33:14 +01:00
Richard Purdie 81ff3a90f8 bitbake: Update to work without warnings with python 2.6
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-05-12 16:53:22 +01:00
Richard Purdie 107a9da006 bitbake: Merge further fixes from upstream 1.8 branch
* Make the test functionality work
* Optimise BBPATH handling when changing directory
* Optimise file globing for BBFILES

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-05-11 22:41:17 +01:00
Richard Purdie ade351e2f4 bitbake: Add in code to support the BBCLASSEXTEND variable. Virtual native/sdk recipes then become possible 2009-01-03 16:25:20 +00:00