Commit Graph

81 Commits

Author SHA1 Message Date
Richard Purdie 0f2c59367a bitbake: bitbake: Convert to python 3
Various misc changes to convert bitbake to python3 which don't warrant
separation into separate commits.

(Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:02 +01:00
Richard Purdie ef1df51651 bitbake: bitbake: Drop futures usage since we're python 3
(Bitbake rev: bf25f05ce4db11466e62f134f9a6916f886a93d9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:02 +01:00
Richard Purdie 99184d7879 bitbake: BBHandler/ast: Merge handMethod and handleMethodFlags
The functionality overlap between these two functions is significant and
its clearer to handle both things together since they are intimately
linked. There should be no behaviour change, just clearer code.

(Bitbake rev: 391aa4afc91be90d8d3ee47e1bf797d6ebe61a71)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:32:46 +00:00
Richard Purdie 6ae662acdc bitbake: parse/ast: Mark anonymous functions as python functions
Anonymous functions are python functions, set the variable
flags as such so we can detect them and avoid expansion where
needed.

(Bitbake rev: 1b303785c578bbae3a89be8d751d80fba860f62e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04 23:47:49 +00:00
Richard Purdie 4628fe12e7 bitbake: lib/bb: Add expansion parameter to getVarFlag
This sets the scene for removing the default False for expansion from
getVarFlag. This would later allow True to become the expand default.

On the most part this is an automatic translation with:

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

There should be no functional change from this patch.

(Bitbake rev: 7c3b99c6a716095af3ffce0b15110e91fb49c913)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04 23:47:49 +00:00
Richard Purdie f8185ff9f8 bitbake: ast: Add filename/lineno to mapped functions
Where we add in mappings for EXPORT_FUNCTIONS, add dummy filename
and lineno data so ensure the assumption that all python functions
have this is correct.

(Bitbake rev: 547128731e62b36d2271c4390b3fee2b16c535dc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:35 +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
Christopher Larson 383450c78a bitbake: build: delete tasks thoroughly
We want addtask to be able to bring back a deleted task, but we don't want its
previous dependencies to come back with it, so rather than marking a task as
deleted and then skipping tasks marked as such, actually delete the task and
its dependency information in deltask.

While we're in that part of the code, also fix a couple 'not foo in bar'
instances to 'foo not in bar', which is preferred in python.

(Bitbake rev: 94b3f3d6bdfbfa47f7eb3c3de64940a145b2ddd1)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:33:08 +01:00
Richard Purdie 933e19697b bitbake: parse/ast/data_smart: Add parsing flag to getVar/setVar
When parsing we find problems if we clear prepends/appends when
setting variables during the initial parsing phases. Later, we actively
want to do this (in what would be post finalisation previously).

To handle this, pass a parsing flag to the operations to control
the correct behaviour for the context.

(Bitbake rev: ae87f5b8bf16191b3201cfb445062938eab992a0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:50:45 +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
Pascal Bach 087424d925 bitbake: parse/ast: Fix issue if path contains '&'
(Bitbake rev: 4fea138f7cef53626a40decb96207dbaf9284020)

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-29 22:11:35 +00:00
Richard Purdie 2e26745a13 bitbake: ast: Add error when trying to use dash in sh function names
A dash character is illegal in function names in sh (but not bash). Since
our shell tasks run under sh and the shell parser is sh based, EXPORT_FUNCTIONS
won't work with class names containing a dash.

We can't change sh, we can ensure the user is warned about the problem
straight away though.

[YOCTO #7006]

(Bitbake rev: 86704281b79e524dccccc88cbf996b299b33bae2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-08 10:38:36 +00:00
Ross Burton b92ec90ea4 bitbake: data: rename defaultval to _defaultval
The defaultval field is intended to be internal and the only use of that field
outside of data.py is to skip over it when iterating over a value's flags.

For clarity and convenience, rename the field to _defaultval so that it is
considered internal and not exposed through the data API.

(Bitbake rev: 2800958dadaa5c055ba21d52c98d842d360f0785)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-03 12:24:00 +00:00
Richard Purdie 91a164cb87 bitbake: event: Add SkipRecipe event to replace SkipPackage
In the depths of time we were rather confused about naming. bb files
are recipes, the event to skip parsing them should be SkipRecipe,
not SkipPackage. This changes bitbake to use the better name but
leaves the other around for now. We can therefore start removing
references to it from the metadata.

(Bitbake rev: 98d9e6e0f514a7cb7da1d99bf4bd5602b89426d6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-01 14:29:31 +01:00
Richard Purdie bc391938c4 bitbake: parse/ast: Show append logging at lower log level
It was reported that bitbake -D made no mention of which append files it
was using. bitbake -DD does but it makes sense to increase the log level
of this piece of debug information.

[YOCTO #6262]

(Bitbake rev: 5824bf9c6feea05567d155911f4ab2e371911d34)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11 12:27:56 +01:00
Richard Purdie 249a24eee0 bitbake: parse/ast: Optimise data finalisation
The optimisation where only the data we're interested in was finalised
was good but it turns out we can do better. In the case where a
class-extension is to be targeted, we can skip the other targets.

This change does that and speeds up parsing at the bitbake-worker
execution time. Specifically, you can see an improvement in the speed
of bitbake X -n.

(Bitbake rev: b56918c7ef7913e84356c69ee9b269844a446728)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-23 11:43:29 +01:00
Jacob Kroon f5a344441a bitbake: ast: Fix support for anonymous methods in wildcard .bbappend files
When using wildcard .bbappend files with anonymous methods in them,
bitbake/python fails to parse the generated code since the '%' is encoded
in the generated method name.

Fix this by including '%' in the convert-to-underscore list during
method name mangling.

While we're at it, move the method name mangling translation table
to a class variable, as suggested by Chris Larson.

[YOCTO #5864]

(Bitbake rev: 537f1f9bbe110acc9848ef95f43468c07d87af79)

Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-24 12:42:40 +00:00
Richard Purdie ba82035412 bitbake: build/ast: Create strong task add/del API in bb.build
Currently its near impossible to control task addition/deletion from
metadata context. This adds stong add/deltask API to bb.build
which is traditionally where it resided. The rather broken
remove_tasks function was removed, it didn't appear to do anything
useful or have any users.

This allows us to clean up hacks currently in use in metadata and use
standard API for it instead.

(Bitbake rev: bf7138dd38fc1f8efca80891198e3422fef64093)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-18 17:08:07 +00:00
Richard Purdie 8a82a3835c bitbake: ast/BBHandler/build: Add support for removing tasks (deltask)
Back in the depths of time we did support task removal. In the pre
AST days it was nearly impossible to continue supporting it, it wasn't
used so it was dropped. With the modern codebase we can easily now support
deltask and it would be very useful within the metadata since it can
massively simplify dependency trees.

As an example, a core-image-sato had 47703 inter task dependencies before
this patch and a patch to native.bbclass, afterwards with the noexec tasks
deleted, we had 29883. Such a significant simplification is worthwhile
and justifies adding a deltask operation to the system.

(Bitbake rev: acecbde6fb70ff3c96deab3cdf819d8442e87ed4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-18 17:08:07 +00: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
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 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
Peter Seebach fe30cbc2cb bitbake: bitbake: data_smart.py and friends: Track variable history
This patch adds tracking of the history of variable assignments.
The changes are predominantly localized to data_smart.py and
parse/ast.py. cooker.py and data.py are altered to display the
recorded data, and turn tracking on for the bitbake -e case.
The data.py update_data() function warns DataSmart.finalize()
to report the caller one further back up the tree.

In general, d.setVar() does what it used to do. Optionally,
arguments describing an operation may be appended; if none
are present, the operation is implicitly ignored. If it's
not ignored, it will attempt to infer missing information
(name of variable, value assigned, file and line) by examining
the traceback. This slightly elaborate process eliminates a
category of problems in which the 'var' member of the keyword
arguments dict is set, and a positional argument corresponding
to 'var' is also set. It also makes calling much simpler for
the common cases.

The resulting output gives you a pretty good picture of what
values got set, and how they got set.

RP Modifications:

a) Split from IncludeHistory to separate VariableHistory
b) Add dedicated copy function instead of deepcopy
c) Use COW for variables dict
d) Remove 'value' loginfo value and just use 'details'
e) Desensitise code for calling order (set 'op' before/after
   infer_caller_details was error prone)
f) Fix bug where ?= "" wasn't shown correctly
g) Log more set operations as some variables mysteriously acquired
   values previously
h) Standardise infer_caller_details to be triggered from .record()
   where at all possible to reduce overhead in non-enabled cases
i) Rename variable parameter names to match inference code
j) Add VariableHistory emit() function to match IncludeHistory
k) Fix handling of appendVar, prependVar and matching flag ops
l) Use ignored=True to stop logging further events where appropriate

(Bitbake rev: f00524a3729000cbcb3317fee933ac448fae5e2d)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18 12:35:19 +00:00
Richard Purdie 8ead7dc3cc bitbake: BBHandler/ast: Simplify/fix EXPORT_FUNCTIONS usage
The current usage of EXPORT_FUNCTIONS is rather problematic since a class
list (classes) is passed into the ast statement and cached as it was
when first parsed. This class list may be different in other cases but
is locked once in the cache.

Worse, the construction of classes can be broken by exceptions during parsing
at the wrong moments since the state of the parser is not always reset
correctly. This can lead to leakage of other classes into the classes list.

The current EXPORT_FUNCTIONS implementation looks at the last two currently
inherited classes and sets up an indirect function call view the second last
class inherited, e.g.:

 do_configure calls gnomebase_do_configure
 gnomebase_do_configure calls autotools_do_configure

This intermediary doesn't seem to serve a useful purpose.

This patch therefore makes builds deterministic and fixes various cache problems
and indirection by removing the intermediaries and simply performing
directly mapping for the cases where its needed.

(Bitbake rev: 9fc98f96f0e0320beda0ce9546275a99336732c1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-11 15:59:42 +00:00
Richard Purdie 1e59ae05c1 bitbake: ast: Store anonymous python function contents in the datstore
This is useful if we need to disable part of one during a backtrace
for debugging purposes.

(Bitbake rev: 80a0c1b06a30a6ba9977c29fac0437a208d8cbbc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-23 09:22:44 +01:00
Richard Purdie ce682323a9 bitbake: ast: Extract text variable in PythonMethodNode
(Bitbake rev: 2e98f740b4a57a3467b1a00b1ebc1aaee33a8ff0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-23 09:22:44 +01:00
Richard Purdie 9e8ba3036d bitbake: ast: Rename PythonMethodNode define variable to modulename
It was hard for me to understand what the define variable was, modulename
is hopefully a bit better.

(Bitbake rev: 79f9f46319de85f85613ebe248c327f5852225ba)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-23 09:22:44 +01:00
Richard Purdie c8cce4e0d6 bitbake: methodpool: Clean up the parsed module list handling to be slightly less insane
This removes some dubious functions and replaces them with a simpler, cleaner
API which better describes what the code is doing. Unused code/variables are
removed and comments tweaked.

(Bitbake rev: f1e943aebfb84e98253f3f21646d6765c4fa1d66)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-23 09:22:44 +01:00
Richard Purdie 21773a997a bitbake: event/ast: Use better_exec instead of simple_exec
This improves the stacktraces dumped by bitbake when for example anonymous
python functions fail.

Also default to passing code strings to better_exec to match the behaviour of
simple_exec to aid the transition.

(Bitbake rev: 7e8205929ae953731a6854ea80b197847cff5771)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-22 13:59:57 +01:00
Richard Purdie 798415bd21 bitbake: bitbake: Warn upon finding tab indentation in python functions
Mixed spacing in python functions can cause subtle issues and
generally confuses users. We've standardised on 4 space indentation,
adding this warning helps ensure consistency and avoid bugs. It
also makes _prepend and _append operations on python functions slightly
less risky.

(Bitbake rev: c51cfaf48d3b12a19b01e824b6ba4230376bcad4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Richard Purdie d3d9a37aa7 parse/ast: Expand inherit statements before splitting them
This means that statements that expand to more then one entry
such as:

CLASSES = "a b"
inherit ${CLASSES}

work correctly instead of trying to inherit a class called "a b".

(Bitbake rev: 2568e9ace6e6f483e1bf2a9ef2f4d8318d6c85b7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-15 22:56:16 +00:00
Lianhao Lu 959981da53 bitbake: Added BBINCLUDED variable.
Added new variable BBINCLUDED indicating the file dependency
information. It exposes the internal variable '__base_depends' and
'__depends'.

(Bitbake rev: af524a656fce32d01687481b86c31bef00eb9fc3)

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 12:27:21 +00:00
Paul Eggleton 99d326a818 bitbake: add file and line number to ParseError
Ensure that a file and line number are reported for ParseError where
possible. This helps particularly in the case of inherit and require
which previously did not report either of these upon failure.

(Bitbake rev: f588ba69622a2df35417ced184e56c79ac1b40d5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23 22:52:15 +00:00
Richard Purdie 4cd9671078 bitbake: Update users of getVar/setVar to use the data store functions directly
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27 10:35:30 +00:00
Paul Eggleton 4a7ddff183 bitbake/ast: include class name when arguments given in variant
For multilib this produces variants of e.g. "multilib:lib64" instead of
just "lib64"; however we set BBEXTENDVARIANT to "lib64" and the latter
will be used when composing filenames for multilib.

(Bitbake rev: de7a2b91512bb3ab058f5eb5cd188acd2b8a2220)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-25 12:09:40 +01:00
Richard Purdie 56e46f0bc4 bitbake/ast: Fix ??= vs. ?= handling
As the code stands, setting a variable with ??= could result in a ?=
variable not overriding it. This patch fixes the issue by allowing
the ast to make lookups that ignore any ??= set variables.

(Bitbake rev: 32fee2e650dfdd3aa9a7572dad1251e0c24ca34b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-05 11:39:05 +01:00
Richard Purdie a2b9ef9d78 bitbake/ast: Add optional argument for BBCLASSEXTEND
Add an optional argument to BBCLASSEXTEND entries which gets passed to
the extention class as BBEXTENDVARIANT. Also add BBEXTENDCURR whic
is set to the current extension class name.

This mode functions slightly differently to the previous BBCLASSEXTEND
code in that PN is not changed.

(Bitbake rev: 8d3c899e0a15840c54de26d2f1fc552430517778)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-28 15:27:43 +01:00
Richard Purdie 21c5985812 bitbake/ast: Call expandkeys after the RecipePreFinalise event
This means the event handler can change variables such as PN and those
changes will be reflected in the updated variable key names.

(Bitbake rev: 664b85742d1afc94b291a85fd245abebffacdf3d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-28 15:27:42 +01:00
Richard Purdie b8321c5658 bitbake/event/ast: Add RecipePreFinalise event
One of the implications is we need to register the event handlers before
executing the anonymous python functions. I can't find any issue with making
that change in any existing metadata use cases.

(Bitbake rev: a981df3cc9bf410d24f39919959952bdc6c76d03)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09 22:43:46 +01:00
Richard Purdie af93b8937e bitbake/parse/ast: We always need to finalize the default data since otherwise overrides to BBCLASSEXTEND may not be applied
(Bitbake rev: f22ac9149cc9ab96510bb377deb82cd9bceb95c1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09 22:43:45 +01:00
Paul Eggleton 81e2f52fb8 track skipped packages
Add skiplist to cooker that allows access to the list of packages skipped
via SkipPackage (this includes COMPATIBLE_MACHINE, INCOMPATIBLE_LICENSE,
etc.) This can be used to enhance error reporting.

(From Poky rev: 6c12b7b1099c77b87d4431d55e949cf7c5f52ded)

(Bitbake rev: 7d2363f35350be27a33f568c23eb07fcd3d27e53)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09 18:12:51 +01:00
Chris Larson 3eed3aac4c parse: pass a useful (if mangled) key to bb.data.expand for :=
(Bitbake rev: 8e1be0ca414d9d26e013ae212abdd9c39fa8df26)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-07 22:29:25 +01:00
Richard Purdie 9211fd9c37 bitbake/ast.py: Only run finalise() for the specified variant
Allows the heavy finalise function to only be run for the case we're
interested in when running tasks, saving some processing time.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-05 15:52:36 +01:00
Richard Purdie 6ea24f04cd bitbake/data_smart: Improve the way lazyassignment works
Currently, if a variable has been set with ??= and the code looks it up
before the data finalisation phase, no value is found. This is causes
serious problems for anonymous python functions which manipulate data, or
for the fetcher revision handling code where revisions can be set with
??=.

There is also a significant performance implication for processing lazy
assignment in finalise.

Moving the check for a default value into getVarFlag addresses both
the timing issue and the performace. This change gives a 7% real time
performance improvement to parsing the Poky metadata. The cost of the
check at this point is minimal since we have all the data flags available.

This should also fix Yocto bug 752.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-23 11:48:01 +00:00
Chris Larson b127874ee6 parse: pass filename, lineno into the ast
We will be needing this information to improve the tracebacks of python code
from the metadata, as well as to give the user information about where
variables were defined, so they know how it ended up the way it is.

(Bitbake rev: 9615c538b894f71a2d1a0ba6b3f260db91e75786)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:03 +00:00
Chris Larson 37391f667f parse.ast: drop __word__ regular expression
We can use the string split method for this instead.

(Bitbake rev: aa9646717b3ee1006628246a7c495f601e62391c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 10:49:29 +00:00
Chris Larson 1204ed79fc parse.ast: avoid code duplication for inherit
(Bitbake rev: 0b11a3d4eab84b372fd45b9537cf0327008daf8d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 10:49:01 +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 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 e8ed1454ae bitbake/ast: Ensure function definitions are always added to the dictonary
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-03 16:08:31 +01:00