summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse
AgeCommit message (Collapse)Author
2015-11-16bitbake: parse: Don't try to expand __base_depends/__dependsRichard Purdie
Trying to expand a variable which isn't a string doesn't make sense. (Bitbake rev: 62367cca1f1793eb9827406bcdd5980fdeb80a60) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03bitbake: build: delete tasks thoroughlyChristopher Larson
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-08-19bitbake: lib/bb/parse: properly handle OSError when updating mtime cachePaul Eggleton
If a file no longer exists, drop it from the cache silently instead of generating a traceback. This was visible in some cases when a recipe was deleted when bitbake was resident in memory. (Bitbake rev: fe105b9042bdac4afd9f38fcf92bfdc2c04ec23f) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01bitbake: bb.parse: properly error out on filesystem errorsChristopher Larson
We've had a long-standing bug where a legitimate error reading a file (IOError or OSError) is always suppressed as though it was a 'file not found' case. As a concrete example, if you do a `chmod 000 conf/local.conf`, it'll silently not parse local.conf, rather than erroring to let the user know about the problem. Fix this by handling the ENOENT case specifically. (Bitbake rev: e691312a3add222b04e7b2f52f8df6abcb9068bf) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12bitbake: parse/ast/data_smart: Add parsing flag to getVar/setVarRichard Purdie
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-06-23bitbake: bitbake: Add explict getVar param for (non) expansionRichard Purdie
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-05bitbake: parse/BBHandler: Avoid repeatedly resetting FILERichard Purdie
If we're not going to change the value of FILE, or we know it isn't going to have changed (ext == bbclass), don't set FILE. This avoids messy looking history of the variable as well as optimises parsing speed slightly. (Bitbake rev: 88e4600aa66dda2e6c807f9d97af8982bcd8817b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29bitbake: ConfHandler: Fix bogus dependency problemsRichard Purdie
Adding a dependency when errors occur accessing a file when calling handle() is not the correct thing to do. THe handle() code calls resolve_file() which can raise an exception without ever touching "fn" itself, it has also already marked all the dependencies correctly. This leads to bogus files being resolved to the local cwd and hence triggers reparses for no good reason. The solution is to simply remove the bogus dependency. (Bitbake rev: 366af3be1cffd64e4a79c15990c1e05869022c14) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29bitbake: BBHandler: Drop cwd from search pathRichard Purdie
Whilst bitbake has done this for a long time, the behaviour of resolving class files against cwd is not desirable. This can be seen during base configuration parsing when looking for base.bbclass where a dependency on cwd is added. If cwd then changes, the cache is invalid and triggers a re-parse. The only real option is to drop this entry and if files can't be found, we fix BBPATH in the cases where it needs fixing. I didn't find any in the random selection of layers I tested parsing locally. (Bitbake rev: 508aad9d5db7e51328b1fd6ee53b4bc3720a30b7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-15bitbake: BBHandler: Error for incomplete function definitionsRichard Purdie
Add some sanity checks on the parsing state engine when returning data so that incomplete functions raise parse errors. This means a recipe doing: do_somefunction { echo 1 VAR = "1" will now raise a ParseError. To get the right file/line information, __infunc__ was changed to a list. [YOCTO #7633] (Bitbake rev: 6b54a72638f57882d4fd5aab96b2752a09e065af) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-29bitbake: parse/ast: Fix issue if path contains '&'Pascal Bach
(Bitbake rev: 4fea138f7cef53626a40decb96207dbaf9284020) Signed-off-by: Pascal Bach <pascal.bach@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-16bitbake: ConfHandler: Clean up bogus importsRichard Purdie
The import statements here are plain bizarre. Remove them, tweaking some of the function calls to match current practices. I can't find any reason these old imports are as they are. (Bitbake rev: 4c2f1fe51a13ddc97e518327714292af46b9e1ab) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-16bitbake: ConfHandler: Rename oldfn to parentfn to be clearerRichard Purdie
Looking at this function I had no idea what oldfn was, I doubt anyone else would either without looking up what the caller does. "parentfn" would seem a more appropriate name so rename it. (Bitbake rev: fc70ed596703a1aa954223b169d4ad51193a6ec1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-14bitbake: cooker/cache/parse: Implement pyinofity based reconfigureRichard Purdie
Memory resident bitbake has one current flaw, changes in the base configuration are not noticed by bitbake. The parsing cache is also refreshed on each invocation of bitbake (although the mtime cache is not cleared so its pointless). This change adds in pyinotify support and adds two different watchers, one for the base configuration and one for the parsed recipes. Changes in the latter will trigger a reparse (and an update of the mtime cache). The former will trigger a complete reload of the configuration. Note that this code will also correctly handle creation of new configuration files since the __depends and __base_depends variables already track these for cache correctness purposes. We could be a little more clever about parsing cache invalidation, right now we just invalidate the whole thing and recheck. For now, its better than what we have and doesn't seem to perform that badly though. For education and QA purposes I can document a workflow that illustrates this: $ source oe-init-build-env-memres $ time bitbake bash [base configuration is loaded, recipes are parsed, bash builds] $ time bitbake bash [command returns quickly since all caches are valid] $ touch ../meta/classes/gettext.bbclass $ time bitbake bash [reparse is triggered, time is longer than above] $ echo 'FOO = "1"' >> conf/local.conf $ time bitbake bash [reparse is triggered, but with a base configuration reload too] As far as changes go, I like this one a lot, it makes memory resident bitbake truly usable and may be the tweak we need to make it the default. The new pyinotify dependency is covered in the previous commit. (Bitbake rev: 0557d03c170fba8d7efe82be1b9641d0eb229213) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-08bitbake: ast: Add error when trying to use dash in sh function namesRichard Purdie
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>
2014-12-03bitbake: data: rename defaultval to _defaultvalRoss Burton
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-06-01bitbake: event: Add SkipRecipe event to replace SkipPackageRichard Purdie
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-05-11bitbake: parse: Improve file inheritance loggingRichard Purdie
The file inheritance logging has been here since the dawn of time. It duplicates output many times over and logs to debug level 2. When running with the debug option, its understandable the user may want to see the paths of files included in the build. These changes remove pointless/duplicate output and print the include paths clearly at debug level one in a form which users should be able to more easily parse. (Bitbake rev: 633a56987df639295fe9128418da5634050063e5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11bitbake: parse/ast: Show append logging at lower log levelRichard Purdie
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-04-23bitbake: parse/ast: Optimise data finalisationRichard Purdie
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-03-21bitbake: ConfHandlerr: Use full path in variable historyMarius Avram
When an evaluation was made for a configuration file the path to the file was saved as a relative one. The change in this commit will save the location as an absolute path. This way the user will have full information regarding the location of the file where a variable was changed and the line withing the file. [YOCTO #5562] (Bitbake rev: df9e22901555b06fef308f7136547f2c47ccec35) Signed-off-by: Marius Avram <marius.avram@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-24bitbake: ast: Fix support for anonymous methods in wildcard .bbappend filesJacob Kroon
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-17bitbake: parse: make vars_from_file return None for non-recipesPaul Eggleton
It doesn't really make sense to set PN from .conf files, for example. More concretely, this avoids the config hash changing unnecessarily within Hob due to PN effectively changing (since bblayers.conf is parsed first and then .hob.conf). (Bitbake rev: 22e03ef7ac9bb6b7245250347ae9c10c19f1d74e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-18bitbake: build/ast: Create strong task add/del API in bb.buildRichard Purdie
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-18bitbake: ast/BBHandler/build: Add support for removing tasks (deltask)Richard Purdie
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-11-30bitbake: parse/ConfHander/BBHandler/utils: Fix cache dependency bugsRichard Purdie
Currently bitbake only adds files to its dependency list if they exist. If you add 'include foo.inc' to your recipe and the file doesn't exist, then later you add the file, the cache will not be invalidated. This leads to another bug which is that if files don't exist and then you add them and they should be found first due to BBPATH, again the cache won't invalidate. This patch adds in tracking of files we check for the existence of so that if they are added later, the cache correctly invalidates. This necessitated a new version of bb.utils.which which returns a list of files tested for. The patch also adds in checks for duplicate file includes and for now prints a warning about this. That will likely become a fatal error at some point since its never usually desired to include a file twice. The same issue is also fixed for class inheritance. Now when a class is added which would be found in the usual search path, it will cause the cache to be invalidated. Unfortunately this is old code in bitbake and the patch isn't the neatest since we have to work within that framework. [YOCTO #5611] [YOCTO #4425] (Bitbake rev: 78d285871e4b8c54ccc4602d571e85f922e37ccd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26bitbake: parse: Return IOError when including file with absolute pathMartin Jansa
* resolve_file was behaving different when relative and absolute paths were passed to it * include relative-path/non-existent-file.inc works correctly resolve_file throws IOError, BBHandler.py:handle() doesn't catch it, ConfHandler.py:include() catches IOError and shows: DEBUG: CONF file 'relative-path/non-existent-file.inc' not found * include /absolute-path/non-existent-file.inc was failing, because resolve_file just returns fn, BBHandler.py:handle() calls bb.parse.mark_dependency(d, abs_fn) which throws: OSError: [Errno 2] No such file or directory: '/absolute-path/non-existent-file.inc' and parsing fails. Ad isfile() test for absolute fn and throw IOError to make resolve_file behavior consistent for both paths. * I know we had some issues with -b relative-path-to-recipe.bb and absolute path, so consider this patch only as RFC and documentation of this problem * Catch OSError too in ConfHandler.py:include() e.g. in case the file exists, but user cannot read it or something like that. (Bitbake rev: b0bbd89a4f0b98fa1ab28b8e0526cd9ddb76fa57) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-27bitbake: bitbake: python funcname can not include special character @Li Wang
[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-14bitbake: bitbake: Add event mask flag supportBogdan Marinescu
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-05-24bitbake: methodpool: Retire it, remove global method scopeRichard Purdie
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-09bitbake: lib: Clean up various file access syntaxRichard Purdie
Python 3 is stricter about how files are accessed. Specficially: * Use open(), not file() * Use binary mode for binary files (when checksumming) * Use with statements to ensure files get closed * Add missing file close statements (Bitbake rev: 9f08b901375ba640f47596f1bcf43f98a931550f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-15bitbake: ConfHandler: Use re.X to make long regexp more readableOlof Johansson
The __config_regexp__ in ConfHandler is quite long, and using re.X to break the expression onto several lines make it a bit easier to read. (Bitbake rev: 54dce9e14ab0657d76f0d0ae22eef7fab8e8950d) Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-14bitbake: ConfHandler: Improve regexp to fix mis-parsing of += and no whitespaceRichard Purdie
If you have: FOO = "a" FOO += "b" FOO+= "c" The expected result is "a b c" however we were seeing "a b" with the FOO+ variable being assigned the value "c". This isn't the expected result. We need to make the name part of the variale non-greedy so that any + character becomes part of the operator. This patch does that. I compared the configuration in OE-Core before and after the change and only the test case changed. [YOCTO #3834] (Bitbake rev: 2cd8d7fd12a646e6516e2c985e6a54121d19eb59) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-22bitbake: parse_py: add ~ to config_regexpConstantin Musca
- enable the '~' character in bitbake variables (Bitbake rev: 7c15ff1d50d7b601414f1d55c90e3c59981a0876) Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-21bitbake: BBHandler/ConfHandler: Merge fix for multiline commentsRichard Purdie
This was meant to be squashed into the previous commit for multiline comment handling. It fixes the case the commented multiline is followed by an empty line which was resulting in a traceback instead of a sane error message. (Bitbake rev: 7e7d692e244fe8dca533f842ca143b9c821e317c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-21bitbake: bitbake: BBHandler/ConfHandler: Improve multiline comment handlingRichard Purdie
Faced with an expression like: # Some comment \ FOO = "bar" what should bitbake do? Technically, the \ character means its multiline and currently the code treats this as a continuation of the comment. This can surprise some people and is not intuitive. This patch makes bitbake simply error and asks the user to be clearer about what they mean. (Bitbake rev: 589d31ce41e019ee6a7cb6527d67bc76c0b6382a) (Bitbake rev: 79c00fabe08b4c210a3bd81cfaffbc47ffdc2e2b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18bitbake: bitbake: data_smart.py and friends: Track variable historyPeter Seebach
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-18bitbake: bitbake: data_smart.py and friends: Track file inclusions for ↵Peter Seebach
bitbake -e This code adds inclusion history to bitbake -e output, showing which files were included, in what order. This doesn't completely resolve timing questions, because it doesn't show you which lines of a file were processed before or after a given include, but it does let you figure out what the path was by which a particular file ended up in your build at all. How it works: data_smart acquires a .history member, which is an IncludeHistory; this represents the inclusion of a file and all its inclusions, recursively. It provides methods for including files, for finishing inclusion (done as an __exit__), and for dumping the whole tree. The parser is modified to run includes inside a with() to push and pop the include filename. RP Modifications: a) Split Include and Variable tracking b) Replace deepcopy usage with dedicated copy function c) Simplify some variable and usage (Bitbake rev: b2dda721262da8abb7dc32d019e18fbc32ed8860) Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18bitbake: BBHandler/data: Standardise some setVar access formatsRichard Purdie
(Bitbake rev: e12c1a485f96a4701144ac81179ae1af348e5bf3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-14bitbake: data_smart/BBHandler: Fix SkipParse exception handlingRichard Purdie
If SkipParse is raised from something which isn't anonymous python, it wasn't being handled correctly. This improves the handling for example from within inline python. (Bitbake rev: 7467d7d66b24cc8f43ab168e65895e7c4aee6092) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-11bitbake: BBhandler/data: Fix __inherit_cache duplicationRichard Purdie
The inherits cache contains duplicate entries, some with the full patch, some just starting classes/xxx. This is a waste of parse time and potentially error prone. This patch fixes various pieces of code so the absolute paths are always preferred and work correctly. The inherits_class function did not work with full paths so the patch fixes this. (Bitbake rev: f3a71e509af196391ec126d079cf1bd178e62ad5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-11bitbake: BBHandler/ast: Simplify/fix EXPORT_FUNCTIONS usageRichard Purdie
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-07bitbake: Revert "BBHandler: Ensure parser state engine is correctly reset ↵Richard Purdie
for new parsing" This reverts commit 3dc5e896a97154914cee6c47900e3bb2a2627cdb. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-07bitbake: BBHandler: Ensure parser state engine is correctly reset for new ↵Richard Purdie
parsing The classes variable in particular could be in an odd state if parsing of a previous recipe had abruptly ended. (Bitbake rev: 3dc5e896a97154914cee6c47900e3bb2a2627cdb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-20bitbake: parse/cache/cooker: Preserve order in the file inclusion listRichard Purdie
The data returned by get_file_depends() may me used in contexts like checksums where order is important. The current usage of sets means that some of the checksums can change in circumstances they should not. This patch changes to use lists, thereby removing the problem. (Bitbake rev: a44285fc4109236ab89f7aad0a1fc9220eec19b6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-28bitbake: parse/ConfHandler: Add negative lookahead to spot some quoting problemsRichard Purdie
Syntax like: FOO = "bar" # eek" would result in FOO taking the value 'bar" #eek' which is clearly not the intention. Whilst our metadata is riddled with mixtures of even quotes like: FOO = "d.getVar("X")" odd numbers of quotes seem rare. This patch adds detection of one odd quote which we don't have any of in OE-Core so it seems a valid sanity improvement. (Bitbake rev: 5f892d9b083550e20e37576070ec7d1a94cc88fe) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-23bitbake: ast: Store anonymous python function contents in the datstoreRichard Purdie
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-23bitbake: ast: Extract text variable in PythonMethodNodeRichard Purdie
(Bitbake rev: 2e98f740b4a57a3467b1a00b1ebc1aaee33a8ff0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-23bitbake: ast: Rename PythonMethodNode define variable to modulenameRichard Purdie
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-23bitbake: methodpool: Clean up the parsed module list handling to be slightly ↵Richard Purdie
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>