Commit Graph

48 Commits

Author SHA1 Message Date
Richard Purdie 51abd41ff6 bitbake: cooker: Add BB_LIMITEDDEPS support
When we're running with bitbake -b, BB_TASKDEPDATA is incorrect and limited.
We really need a way to know this from the metadata and this new variable
provides this in worker context. This means existing code can stop having
to guess.

(Bitbake rev: 05763bc886024dcce2ce6b3060fb00abf79a9402)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:52:52 +00:00
Richard Purdie dbb247cac5 bitbake: cookerdata: Convert multiconfig to use BB_CURRENT_MC
People are struggling with multiconfig as the point the conf file
is injected into the data store is not what people expect. We can't
really use a post config since that is too late and we can't really
use a pre config file since that is too early. In OE terms, we need
something right around the local.conf point so it behaves in a similar
way.

A way to handle this is to set the new variable BB_CURRENT_MC to be the
currently selected multiconfig, then the metadata itself can choose
when to inject the approriate configuration.

(Bitbake rev: 518b9015c2be8d3894277a8e54890d6f04d656c0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22 12:36:40 +00:00
Paul Eggleton e271d7dc60 bitbake: command: provide a means to shut down from the client in memres mode
In memory resident mode we don't really want to actually shut down since
it's only the client going away.

(Bitbake rev: 74db369c46043116359101cab70486afd82372c0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-14 12:25:07 +00:00
Joshua Lock ddaac5e4e3 bitbake: bitbake: remove True option to getVarFlag calls
getVarFlag() now defaults to expanding by default, thus remove the
True option from getVarFlag() calls with a regex search and
replace.

Search made with the following regex:
getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\)

(Bitbake rev: c19baa8c19ea8ab9b9b64fd30298d8764c6fd2cd)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:09 +00:00
Joshua Lock 1fce7ecbbb bitbake: bitbake: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(Bitbake rev: 3b45c479de8640f92dd1d9f147b02e1eecfaadc8)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:09 +00:00
Mark Hatle 08af663a15 bitbake: cookerdata.py: Catch BBHandledException, preventing a backtrace in an event
The event handling 'Exception' was catching and triggering a backtrace.  This
trace was obscuring any errors from an event handler that had raised the
BBHandledException, which should indicate do not print additional information.

(Bitbake rev: 51ca5193a5674b27d816140b0254f485912177a2)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Markus Lehtonen 088d386ddb bitbake: cookerdata: allow multiple passes of config re-parsing
[YOCTO #10188]

(Bitbake rev: 07a03a1290fd206df2b40ffc28381b5b3c10ba4a)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-16 15:24:03 +01:00
Markus Lehtonen e3e239ba54 bitbake: cookerdata: fire ConfigParsed event after re-parse
[YOCTO #10188]

(Bitbake rev: ec1c951a4ee0c33acdde29e578f79ad719a34aca)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-16 15:24:03 +01:00
Markus Lehtonen 3658f6d477 bitbake: cookerdata/ast: Fail gracefully if event handler function is not found
[YOCTO #10186]

(Bitbake rev: 107c47c4e6de6a596cf1aeca5c18dbc1c5b44dc4)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:49 +01:00
Richard Purdie 218b81acb6 bitbake: bitbake: Initial multi-config support
This patch adds the notion of supporting multiple configurations within
a single build. To enable it, set a line in local.conf like:

BBMULTICONFIG = "configA configB configC"

This would tell bitbake that before it parses the base configuration,
it should load conf/configA.conf and so on for each different
configuration. These would contain lines like:

MACHINE = "A"

or other variables which can be set which can be built in the same
build directory (or change TMPDIR not to conflict).

One downside I've already discovered is that if we want to inherit this
file right at the start of parsing, the only place you can put the
configurations is in "cwd", since BBPATH isn't constructed until the
layers are parsed and therefore using it as a preconf file isn't
possible unless its located there.

Execution of these targets takes the form "bitbake
multiconfig:configA:core-image-minimal core-image-sato" so similar to
our virtclass approach for native/nativesdk/multilib using BBCLASSEXTEND.

Implementation wise, the implication is that instead of tasks being
uniquely referenced with "recipename/fn:task" it now needs to be
"configuration:recipename:task".

We already started using "virtual" filenames for recipes when we
implemented BBCLASSEXTEND and this patch adds a new prefix to
these, "multiconfig:<configname>:" and hence avoid changes to a large
part of the codebase thanks to this. databuilder has an internal array
of data stores and uses the right one depending on the supplied virtual
filename.

That trick allows us to use the existing parsing code including the
multithreading mostly unchanged as well as most of the cache code.

For recipecache, we end up with a dict of these accessed by
multiconfig (mc). taskdata and runqueue can only cope with one recipecache
so for taskdata, we pass in each recipecache and have it compute the result
and end up with an array of taskdatas. We can only have one runqueue so there
extensive changes there.

This initial implementation has some drawbacks:

a) There are no inter-multi-configuration dependencies as yet

b) There are no sstate optimisations. This means if the build uses the
same object twice in say two different TMPDIRs, it will either load from
an existing sstate cache at the start or build it twice. We can then in
due course look at ways in which it would only build it once and then
reuse it. This will likely need significant changes to the way sstate
currently works to make that possible.

(Bitbake rev: 5287991691578825c847bac2368e9b51c0ede3f0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:27 +01:00
Richard Purdie 249686927b bitbake: cookerdata: Simplify prefiles/postfiles
The current codepaths are rather confusing. Stop passing these
as parameters and use the ones from when the object is created.

(Bitbake rev: 8c992c148d9619b10eeae8bbd9376ecf408037a5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Markus Lehtonen 2660ddeb2d bitbake: cookerdata: print an error if layer dir does not exist
Makes it easier for user to identify problems, e.g. typos, in BBLAYERS.

[YOCTO #9507]

(Bitbake rev: 32c9689e4b492dc5821749e284e397d717af2a6c)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03 13:13:30 +01:00
Christopher Larson 32ee30a46d bitbake: Provide LAYERDIR_RE for layer.conf
This variable is a regex-escaped version of LAYERDIR, for safer use in
BBFILE_PATTERN, so as to avoid issues with regex special characters in the
layer path.

[YOCTO #8402]

(Bitbake rev: 72900522778b6ff08b135bf8bb97dff3f1a20bd9)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:21 +01:00
Richard Purdie 2fc5d5da6f bitbake: cookerdata: Fix log messages and ensure we exit
The string formatting wasn't correct and we should exit if we hit
errors here similar to the other exception handlers.

(Bitbake rev: b90a16408a5c45ce5312384f278e19d09f8dda4d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Robert Yang f719386841 bitbake: cookerdata.py: remove slash in the end
It's very possible that we added layer as:
BBLAYERS += "/path/to/meta/"

then there would be warning:
WARNING: No bb files matched BBFILE_PATTERN_core '^/path/to/meta//'

This patch can fix the problem.

(Bitbake rev: 2b1cb21d18fb18399e682021b866babeced9a4aa)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31 09:13:04 +01:00
Richard Purdie ddbeb56f4f bitbake: cookerdata: Improve handling of ParseError
If local.conf contains an invalid line, e.g.:

 APPEND += " igor"

(note the leading space) then nasty tracebacks are shown which confuse the
user. Change so the parse error is simply shown without a traceback, improving
the user experience.

[YOCTO #9332]

(Bitbake rev: 148aa1fb45dcb37a756a08301a7daf270e753180)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-29 23:21:52 +01:00
Richard Purdie 46731daa5f bitbake: main/runqueue: Add --setscene-only option to bitbake
Its turning out that we really need a way to have bitbake just run
the setscene tasks but not any real tasks, particularly for SDK
operations.

Add an option for this since its pretty straight forward. This allows
various nasty workarounds in OE-Core to be removed.

(Bitbake rev: e4a2aafa1650a227a04d92a8a0b31efaed2c310e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:32 +00:00
Richard Purdie 0019edc818 bitbake: ast/event/utils: Improve tracebacks to include file and line numbers more correctly
Currently bitbake tracebacks can have places where the line numbers are
inaccurate and filenames may be missing. These changes start to try and
correct this.

The only way I could find to correct line numbers was to compile as a
python ast, tweak the line numbers then compile to bytecode. I'm open
to better ways of doing this if anyone knows of any.

This does mean passing a few more parameters into functions, and putting
more data into the data store about functions (i.e. their filenames
and line numbers) but the improvement in debugging is more than worthwhile).

Before:
----------------
ERROR: Execution of event handler 'run_buildstats' failed
Traceback (most recent call last):
  File "run_buildstats(e)", line 43, in run_buildstats(e=<bb.build.TaskStarted object at 0x7f7b7c57a590>)
NameError: global name 'notexist' is not defined

ERROR: Build of do_patch failed
ERROR: Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 560, in exec_task
    return _exec_task(fn, task, d, quieterr)
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 497, in _exec_task
    event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 170, in fire
    fire_class_handlers(event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 109, in fire_class_handlers
    execute_handler(name, handler, event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 81, in execute_handler
    ret = handler(event)
  File "run_buildstats(e)", line 43, in run_buildstats
NameError: global name 'notexist' is not defined

----------------

After:
----------------
ERROR: Execution of event handler 'run_buildstats' failed
Traceback (most recent call last):
  File "/media/build1/poky/meta/classes/buildstats.bbclass", line 143, in run_buildstats(e=<bb.build.TaskStarted object at 0x7efe89284e10>):
         if isinstance(e, bb.build.TaskStarted):
    >        trigger = notexist
             pn = d.getVar("PN", True)
NameError: global name 'notexist' is not defined

ERROR: Build of do_package failed
ERROR: Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 560, in exec_task
    return _exec_task(fn, task, d, quieterr)
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 497, in _exec_task
    event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 170, in fire
    fire_class_handlers(event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 109, in fire_class_handlers
    execute_handler(name, handler, event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 81, in execute_handler
    ret = handler(event)
  File "/media/build1/poky/meta/classes/buildstats.bbclass", line 143, in run_buildstats
    trigger = notexist
NameError: global name 'notexist' is not defined
----------------

(Bitbake rev: 1ff860960919ff6f8097138bc68de85bcb5f88b0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-18 12:18:19 +00:00
Ed Bartosh 4ab7202c31 bitbake: cooker: preserve pre and post configs
Additional config files passed to bitbake server with --read and
--postread options are rewritten by client bitbake even if
it doesn't use those options.

This is a show stopper for toaster as toaster command line
builds are based on the assumption that server is aware of
toster configs, provided by --postread option.

This behaviour is fixed by preserving values of --read and
--postread options when bitbake server starts and restoring
them if client bitbake doesn't explicitly specify them.

(Bitbake rev: 02c64f7487ca8ec5d32c440f5002c4b8f64b76a6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:30 +00:00
Richard Purdie 40fae3260c bitbake: cookerdata: Rename BBPKGS -> BBTARGETS
BBPKGS is a confusing name from before we tried to straighten out our
terminology. Its also a mostly unknown variable that isn't in wide use.

I've been asked about it recently and before people start relying more
heavily on it, I'd like to rename it BBTARGETS which better describes
what it does. Its not currently in the manuals, I'd prefer to document
it under the better name. I've not provided any migration path for the
variable since I believe its unused currently.

It allows the targets to built to be specified from a conf file in
addition to those on the commandline.

(Bitbake rev: f60c6a2172bceeb5682dcb738a02c4bf26176566)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:38 +01:00
Christopher Larson 7c4fdb8c17 bitbake: bb.cookerdata: include useful traceback for ExpansionError/ParseError
Show the user only the portion of the traceback which was from the metadata,
nothing from bitbake's internal calls.

(Bitbake rev: c45054aef03393fa0bf70e853ddcfc55988493cf)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:59 +01:00
Paul Eggleton 7ce27b9fce bitbake: cooker: ensure prefile/postfile can work in memory resident mode
The prefile/postfile options weren't working in memory resident mode
because they weren't being passed through to the server, so ensure that
they do get passed through and that the server is reset when the values
come through.

(Bitbake rev: a3f7dc042fc7b1c308bfd248431930eb8ba50326)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:45 +01:00
Christopher Larson 75fc6bf0a0 bitbake: bb.cookerdata: don't show traceback for ParseError/ExpansionError
Tracebacks are of extremely limited usefulness in this context. The exceptions
carry the necessary context already, and the user doesn't care about the calls
in bitbake internals that led to an expansion or parse failure.

(Bitbake rev: 9b95fa94eaae452ac7814f1e67c2f7a6314c52f1)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:19 +01:00
Richard Purdie 69b6919341 bitbake: bitbake: Add explict getVar param for (non) expansion
Rather than just use d.getVar(X), use the more explict d.getVar(X, False)
since at some point in the future, having the default of expansion would
be nice. This is the first step towards that.

This patch was mostly made using the command:

sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *`

(Bitbake rev: 659ef95c9b8aced3c4ded81c48bcc0fbde4d429f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:57:53 +01:00
Ed Bartosh f9b160571f bitbake: cookerdata: Allow ~ in bblayers
Implemented processing of ~ in bblayer's paths if HOME
environment variable is approved.

(Bitbake rev: 3b8a656d3ccb543c32696229184ebf12237ad38e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-19 13:37:31 +01:00
Ed Bartosh 4e18659633 bitbake: bin/bitbake: Create bitbake_main API
Moved most of functionality of bin/bitbake to lib/bb/main.py
to be able to call bitbake from python code.

(Bitbake rev: d377f7f88d73f4e5d2dffef03d6acee809827ac6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-25 12:39:50 +00:00
Richard Purdie db45ddeeaf bitbake: command/cooker/knotty: Fix memres handling of command environment changes
If the environment changes, we need memory resident bitbake to adapt to those
changes. This adds in functionality to handle this alongside the configuration
option handling code. This means that the common usage:

MACHINE=X bitbake Y

now works with the memory resident server.

(Bitbake rev: 4d1343010da757a0c126bc22475354da44aaf8e3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-21 14:37:39 +00:00
Alexandru DAMIAN 85a17f86ea bitbake: add option to write offline event log file
This patch adds a "-w/--write-log" option to bitbake
that writes an event log file for the current build.

The name of the file is passed as a parameter to the "-w"
argument. If the parameter is the empty string '', the file
name is generated in the form bitbake_eventlog_DATE.json,
where DATE is the current date and time, with second precision.

The "-w" option can also be supplied as the BBEVENTLOG
environment variable.

We add a script, toater-eventreplay, that reads an event
log file and loads the data into a Toaster database, creating
a build entry.

We modify the toasterui to fix minor issues with reading
events from an event log file.

Performance impact is undetectable under no-task executed builds.

(Bitbake rev: 1befb4a783bb7b7b387d4b5ee08830d9516f1ac2)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:24:06 +00:00
Richard Purdie ff5fba8462 bitbake: knotty: Ensure commandline parameters are updated in memres server
When using options like -k, -f, -v and so on with the memory resident
server, they'd currently only be set on the initial values passed to
the original command. This ensures they now match those specified
on the commandline for the options where this makes sense.

To make this work, a command to update the options on the server side
is required so this is added.

[YOCTO #5292]

(Bitbake rev: 1c75cc4d0c8b606c1fe76e6bf60bf6a32298b105)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-23 20:06:06 +01:00
Richard Purdie ab29933898 bitbake: cookerdata: Improve error handling
If we see errors during parsing, firstly its bad to show a traceback
for an expansion error so lets suppress this.

Secondly, raise a BBHandledException instead of a SystemExit to show
we've informed the user about the condition (printing a traceback in the
default unknown case).

(Bitbake rev: e01988d9a1b7c40e31161c6ce7b85c4405671068)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-01 14:29:31 +01:00
Richard Purdie 774eb753d8 bitbake: bitbake: Force -S option to take a parameter
There is no easy way to make this change. We really need parameters for the -S
(dump signatures) handling code. Such a parameter can then be used within the
codebase to handle the signatures in different ways.

For now, "none" is the recommended default and "printdiff" will execute the
new (and more expensive) comparison algorithms.

(Bitbake rev: b9873588696507dfb6aade6821f6f75cb9a19e0a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-27 09:42:07 +00:00
Jason Wessel a67fde0ab1 bitbake: bitbake.lock: Add host:port to bitbake.lock for memres server
The idea is to build on the --status-only option for bitbake and
expose a mechanism where the oe init scripts can easily switch between
memres server and the non-memres server.

In the case of the standard oe init script the following
can shut down the server:

if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then
    grep ":" bitbake.lock > /dev/null && BBSERVER=`cat bitbake.lock` bitbake --status-only
    if [ $? = 0 ] ; then
       echo "Shutting down bitbake memory resident server with bitbake -m"
       BBSERVER=`cat bitbake.lock` bitbake -m
    fi
fi

A similar function can be used to automatically detect if the server
is already running for the oe memres init script.  This new
functionality allows for the memres init script to be started in a new
shell and connect up to an alaready running server without seeing the
error of trying to start the server multiple times.

(Bitbake rev: b1803958de8d7c3c3279841e38604a08dc2316cc)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-02 17:33:14 +00:00
Alexandru DAMIAN ba83eb315d bitbake: bitbake: cooker,xmlrpc,servers: implement CookerFeatures
Implementing feature set selection that allows a client
to enable specific features in the server at connection time.

Only enabling of features is supported, as there is
no way to safely remove data loaded into the cooker.
Once enabled, a feature will remain enabled for the
life of the cooker.

Client-server connection now supports specifying the feature
set required by the client. This is implemented in the Process
server using a managed proxy list, so the server cooker
will now load dynamically needed features based on what client
connects to it.

In the XMLRPC server the feature set is requested by
using a parameter for registerUIHandler function.
This allows observer-only clients to also specify features
for the server.

The server code configuration now is completly separated
from the client code. All hardcoding of client knowledge is
removed from the server.

The extra_caches is removed as the client can now specify
the caches it needs using the feature. The UI modules
now need to specify the desired featureSet. HOB is modified
to conform to the featureSet specification.

The only feature available is CookerFeatures.HOB_EXTRA_CACHES
which forces loading the bb.cache_extra:HobRecipeInfo class.

(Bitbake rev: 98e594837aab89ea042cfa9f3740d20a661b14e2)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-22 12:19:43 +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 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
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 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 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 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
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 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
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
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