summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/codeparser.py
AgeCommit message (Collapse)Author
2020-01-19bitbake: lib: remove unused importsFrazer Clews
removed unused imports which made the code harder to read, and slightly but less efficient (Bitbake rev: 4367692a932ac135c5aa4f9f2a4e4f0150f76697) Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04bitbake: bitbake: Add initial pass of SPDX license headers to source codeRichard Purdie
This adds the SPDX-License-Identifier license headers to the majority of our source files to make it clearer exactly which license files are under. The bulk of the files are under GPL v2.0 with one found to be under V2.0 or later, some under MIT and some have dual license. There are some files which are potentially harder to classify where we've imported upstream code and those can be handled specifically in later commits. The COPYING file is replaced with LICENSE.X files which contain the full license texts. (Bitbake rev: ff237c33337f4da2ca06c3a2c49699bc26608a6b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08bitbake: codeparser: Switch to sha256 from md5Richard Purdie
We've reports of hash collision with codeparser. Looking at the way collision problems occur with md5 and the way our function templating works, I can believe we may run into issues. This patch therefore switches to sha256. Performance wise, parse time could appear to rise by 4s in 374s Before: 384329 in 2.966s (md5) After: 349743 in 2.340s (sha256) 34723 in 1.245s (md5) since we still have md5 used elsewhere in the code, something we should look at next (using sha256 everywhere is around 5.3s in total) Unfortunately this does nearly double the size of the codeparser cache file due to the hash size change. (Bitbake rev: 4bed7a97198176503fe8c72d8dd7c36b28fc9dd1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-09bitbake: bitbake: pysh: Improve error handling for shell codeRobert Yang
The p_error() is used for printing errors when parse shell code, but it can't the EOF error correctly - Add the following lines to quilt.inc do_configure_prepend () { find ${s} -name "*.in" -exec sed -i -e "1s,^#\!.*@perl@ -w$,#\! @perl@\nuse warnings;," {} \; if [ hello ]; then } - Before the patch: $ rm -fr cache/ tmp/cache/; bitbake -p [snip] WARNING: /path/to/quilt/quilt-native_0.65.bb: Error during finalise of /path/to/quilt/quilt-native_0.65.bb [snip] bb.pysh.sherrors.ShellSyntaxError: None followed by: We can see that this isn't easy to debug, let p_error() check wheter it is EOF and print appropriate errors can improve the error message. And don't let codeparser.py except pyshlex.NeedMore (in fact, it never worked since p_error() only raise ShellSyntaxError), but make it print the last 5 lines which might be useful for debuging. - After the patch $ rm -fr cache/ tmp/cache/; bitbake -p [snip] ERROR: /path/to/quilt/quilt_0.65.bb: Error during parse shell code, the last 5 lines are: find /path/to/quilt/0.65-r0/quilt-0.65 -name "*.in" -exec sed -i -e "1s,^#\!.*@PERL@ -w$,#\! @PERL@\nuse warnings;," {} \; if [ hello ]; then autotools_do_configure sed -e 's,^COMPAT_SYMLINKS.*:=.*,COMPAT_SYMLINKS :=,' -i /path/to/quilt/0.65-r0/quilt-0.65/Makefile [snip] File "/path/to/bb/pysh/pyshyacc.py", line 649, in p_error(p=None): w('Unexpected EOF') > raise sherrors.ShellSyntaxError(''.join(msg)) bb.pysh.sherrors.ShellSyntaxError: Unexpected EOF (Bitbake rev: 44790597951638e32eb1672de2e40bd5a603326b) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-30bitbake: codeparser: Track oe.utils.conditional usageMartin Jansa
* base_conditional was already removed from oe-core: http://git.openembedded.org/openembedded-core/commit/?id=0391fcad9103abca0796a068f957d0df63ab4776 after the usage was migrated to oe.utils.conditional: http://git.openembedded.org/openembedded-core/commit/?id=c97acbd034532895ce57c6717ed1b3ccc7900b0d so we can handle just ".conditional" version * add 1st parameter to variable dependencies, that way when you use FOO = "${@oe.utils.conditional('VAR', 'VALUE', 'true', 'false')" FOO variable will have dependency on VAR variable and you don't need to add FOO[vardeps] += "VAR" manually every time you use oe.utils.conditional * this is similar to contains tracking from: https://bugzilla.yoctoproject.org/show_bug.cgi?id=3890 http://git.openembedded.org/bitbake/commit/?id=ed2d0a22a80299de0cfd377999950cf4b26c512e http://git.openembedded.org/bitbake/commit/?id=0b9d117631ce909312d53b93289e61defc6be01c but conditional is simpler, we don't need to handle the first parameter as a set (Bitbake rev: 5156b4bb6876dac636be9726df22c8ee792714dd) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05bitbake: codeparser: add some commentsPaul Eggleton
Add a few comments at the top of the file explaining what it's for, and a comment pointing out that you need to increment the cache version when changing any code that changes the output. (Bitbake rev: c1780bc1872bb35bc28c76eff9110717f02d9db2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05bitbake: codeparser: improve handling of contains_any() and filter()Paul Eggleton
Ensure we handle bb.utils.contains_any() as separate items, rather than how we handle contains() where every item must be in the list. Additionally, enable handling bb.utils.filter() which for the purposes of looking at dependencies is the same as contains_any(). Additionally bump the codeparser cache and recipe cache versions to invalidate the user's existing caches (ensuring that the changes take effect and avoiding "taskhash mismatch" errors respectively). (Bitbake rev: 496e3c84820a2a889d99d3604659e47a550941d5) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-29bitbake: lib/bb/codeparser: ensure BufferedLogger respects target logging levelPaul Eggleton
BufferedLogger was sending log records to the target logger without checking if the logger is enabled for the level of the record - and handle() doesn't check this either (it's normally checked earlier when the relevant log function is called e.g. logger.debug()), leading for example to debug messages from codeparser getting printed when the log level for the main BitBake logger was set to logging.WARNING. (Bitbake rev: 968a77388dd1a24c1dadec6ce49bf53ebb5b643f) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30bitbake: codeparser.py: support deeply nested tokensPatrick Ohly
For shell constructs like echo hello & wait $! the process_tokens() method ended up with a situation where "token" in the "name, value = token" assignment was a list of tuples and not the expected tuple, causing the assignment to fail. There were already two for loops (one in _parse_shell(), one in process_tokens()) which iterated over token lists. Apparently the actual nesting can also be deeper. Now there is just one such loop in process_token_list() which calls itself recursively when it detects that a list entry is another list. As a side effect (improvement?!) of the loop removal in _parse_shell(), the local function definitions in process_tokens() get executed less often. Fixes: [YOCTO #10668] (Bitbake rev: d18a74de9ac75ba32f84c40620ca9d47c1ef96a3) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03bitbake: codeparser: Use hashlib for hashing, not hash()Richard Purdie
"hash() is randomised by default each time you start a new instance of recent versions (Python3.3+) to prevent dictionary insertion DOS attacks" which means we need to use hashlib.md5 to get consistent values for the codeparser cache under python 3. Prior to this, the codeparser cache was effectively useless under python3 as shown by performance regressions. (Bitbake rev: 12d43cf45ba48e3587392f15315d92a1a53482ef) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03bitbake: codeparser: Small optimisation to stop repeated hash() callsRichard Purdie
No functionality change, just avoids function call overhead in a function which loops heavily. (Bitbake rev: 633c0c19f87a92497a7e9771811cdc953e1b7047) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02bitbake: bitbake: Convert to python 3Richard Purdie
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-05-19bitbake: codeparser: Increase cache version after code parser dependency changesRichard Purdie
(Bitbake rev: 4d880f1d5794f569b6eb5f6e7e3001dd671633c0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19bitbake: bb.codeparser: track variable flag referencesChristopher Larson
Previously we only tracked the flags (minus excluded) of variables we depend on, but not the flags we use explicitly. (Bitbake rev: bdeb3dcd7c92e62a7c079e7b27048c4114f24a3a) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18bitbake: bb/cache: drop some unused argumentsMarkus Lehtonen
Drop unused 'd' argument from the cache save methods, simplifying the API. (Bitbake rev: 81bc1f20662c39ee8db1da45b1e8c7eb64abacf3) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04bitbake: codeparser: Improve handling of data.expand() dependenciesRichard Purdie
Currently bitbake doesn't parse into data.expand() expressions, relying on high level expansion of python code to handle this. One of the tests does however test this works. We don't really want to be doing string expansion on python code, so specifically parse into expand() function calls so that when the high level behaviour is tweaked, the self tests continue to pass and that we do continue to handle expand() function calls as best we can. (Bitbake rev: b12c17be5e4a74c9680876605c87f46501f78d28) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06bitbake: codeparser: Add support for correct linenumbersRichard Purdie
Currently, if there is something like a python indentation error in a python function, the linenumbers and even file aren't reported correctly. This allows lineno and filename parameters to be passed in to correct this. The lack of a lineno parameter to python's compile() function is worked around by using empty linefeeds. Ugly, but effective and with minimal performance overhead. (Bitbake rev: 5796ed550d127853808f38257f8dcc8c1cf59342) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16bitbake: codeparser: Only load the codeparser cache onceRichard Purdie
The server state gets reset multiple times during startup and currently we reload the codeparser cache each time. This is pointless and causes unnecessary interaction time with bitbake. (Bitbake rev: 4f700316933e8e7b2d27366e5ce6176895b913e7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27bitbake: codeparser: Add repr() methodsRichard Purdie
These aid when debugging parts of the codeparser cache since the object contents becomes identifiable. (Bitbake rev: 344b098c7eafc2bcc5c6b44ea47985bc0cb446b5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27bitbake: codeparser: Allow empty functionsRichard Purdie
The main parser and other code copes with empty python functions but the python codeparser does not. Fix this to avoid errors with code like: python do_build () { } which currently results in the obtuse: "Failure expanding variable do_build: IndexError: string index out of range" [YOCTO #7829] (Bitbake rev: e4f594c670189e04d58ce7d160fc1d86123620af) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-20bitbake: bb.codeparser.py: Remove reference for oe.utils.containsOtavio Salvador
The oe.utils.contains function has been removed from OE-Core metadata as the references for it has been replaced to use the bb.utils.contains. (Bitbake rev: 5cfdebe7a67dccc7552ff80c1ccc970e36d562df) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-26bitbake: codeparser cache improvementsRichard Purdie
It turns out the codeparser cache is the bottleneck I've been observing when running bitbake commands, particularly as it grows. There are some things we can do about this: * We were processing the cache with "intern()" at save time. Its actually much more memory efficient to do this at creation time. * Use hashable objects such as frozenset rather than set so that we can compare objects * De-duplicate the cache objects, link duplicates to the same object saving memory and disk usage and improving speed * Using custom setstate/getstate to avoid the overhead of object attribute names in the cache file To make this work, a global cache was needed for the list of set objects as this was the only way I could find to get the data in at setstate object creation time :(. Parsing shows a modest improvement with these changes, cache load time is significantly better, cache save time is reduced since there is now no need to reprocess the data and cache is much smaller. We can drop the compress_keys() code and internSet code from the shared cache core since its no longer used and replaced by codeparser specific pieces. (Bitbake rev: 4aaf56bfbad4aa626be8a2f7a5f70834c3311dd3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-03bitbake: codeparser: Fix to better catch all getVar referencesRichard Purdie
Currently if you do localdata.getVar, the code parser simply ignores the references. Change the code to use endswith() to catch more of the references. These names are probably unique enough to get away with this. Bump the cache version to ensure things get updated. (Bitbake rev: cf763cddc3faa2361b4c4dbd08419e4ebabf208f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-29bitbake: bb.utils, bb.codeparser: Add bb.utils.contains_anyOtavio Salvador
This includes contains_any in the special handling code for sstate. It does not take into account the equivalence of the values. In current code, considering 'bb.utils.contains_any("A", "foo bar", ...)': A = "foo" A = "bar" A = "foo bar" All those will get different signatures. (Bitbake rev: d1e3345d715e488ec3f5515fb0e1fb39366346bc) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-29bitbake: codeparser: don't interact with the cache for subshellsChristopher Larson
Doing so was causing leakage between the execs of the main value and that of the subshell value, and was causing the cached subshell value to be used for the overall variable. At the least this could cause execs contamination between two variables that while differing, run the same subshell. Beyond that, it's possible we could have been using an incomplete cached value of a subshell for that of the main value. Before this, bb_codeparser.dat would change between parses with differing bbfile parse order. After, it does not change. The codeparser cache version is bumped, to ensure we don't use potentially incorrect cached values from previous runs. This should hopefully resolve the difficult-to-reproduce issues we've seen at Mentor Graphics where bitbake emits a script to run a task and misses dependent functions, resulting in 'command not found' failures. This issue has also been mentioned on the oe devel list, where someone hit a case where oe_runmake was missing from a do_install task (IIRC). Adding debug information showed that bitbake's information about the variable dependencies for this task is inaccurate in the failure cases. (Bitbake rev: 97537e4786a1e3a329249497498b59b8f5174fc3) Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-02bitbake: codeparser: Fix var_execs to append to execs, not referencesRichard Purdie
When using the "execs" information in new code, it became clear that the returned data was incorrect and there were missing exec'd functions. This corrects the error and changes one of the test results to match the correct behaviour. (Bitbake rev: 8a24f2d3b735bbc59ca4a09670cabbadb1868c1a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03bitbake: codeparser/data_smart: Optimise parsing speedRichard Purdie
The previous "contains" changes caused a ~3% parsing speed impact. Looking at the cause of those changes was interesting: * Use of defaultdict was slower than just checking for missing entries and setting them when needed. * Even the "import collections" adversely affects parsing speed * There was a missing intern function for the contains cache data * Setting up a log object for each variable has noticeable overhead due to the changes in the code paths uses, we can avoid this. * We can call getVarFlag on "_content" directly within VariableParse for a noticeable speed gain since its a seriously hot code path. This patch therefore tweaks the code based on the above observations to get some of the speed back. (Bitbake rev: fca802187a2a30686a8a07d2b6b16a3e5716e293) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-26bitbake: data/codeparser: Improve handling of contains functionsRichard Purdie
One of the current frustrations with the sstate checksums is that code like base_contains('X', 'y',...) adds a full dependency on X and varies depend even on whitespace changes in X. This patch adds special handling of the contains functions to expand the first parameter and check for the flag specified by the second parameter (assuming its a string). The result is then appended to the value of the variable with a "Set" or "Unset" status. If the flag is added/removed, the stored variable value changes and hence the checksum changes. No dependency on X is added so it is free to change with regard to other flags or whitespace. This code is far from ideal, ideally we'd have properly typed variables however it fixes a major annoyance of the current checksums and is of enough value its worth adding in a stopgap solution. It shouldn't significantly restrict any propely typed variable implementation in future. (Bitbake rev: ed2d0a22a80299de0cfd377999950cf4b26c512e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-26bitbake: codeparser: Drop unneeded variable separationRichard Purdie
There is no good reason to separately track var_references and references so merge them and remove the unneeded variable. (Bitbake rev: 64d4cbd6360c96574cece70205ea3aecc3f8bae6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-15bitbake: codeparser: Track bb.utils.contains usageRichard Purdie
The bb.utils.contains function usage is getting increasingly used in the metadata but isn't handled automatically by the python dependency tracking code. This patch changes that and also adds the "OE" names for the functions. Whilst there are reasons this is a bad idea, its likely outweighed by the shear number of these references and the current holes in dependency information which we're now relying heavily upon. (Bitbake rev: 0b9d117631ce909312d53b93289e61defc6be01c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-15bitbake: codeparser: Track appendVar and prependVar calls as we do for getVarRichard Purdie
We need to track appendVar and prependVar calls just as we do for getVar in order to ensure we're not missing variable dependencies. (Bitbake rev: 767b4751232f4ee3979deb4d3f733fcf9ee2bd44) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-23bitbake: refactor out codeparser cache into a separate classPaul Eggleton
We want to be able to reuse most this functionality for the file checksum cache. (Bitbake rev: 0fe3cb1438d297f90dd0fc6b26362ecbff75c76d) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-12codeparser: Call intern over the set contents for better cache performanceRichard Purdie
See the comment in the code in the commit for more information. (Bitbake rev: 2d56dc7b1f0d186e14c4c8a949b280b6b3fc31de) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-12codeparser: Compute extra cache components on the fly rather than laterRichard Purdie
In the initial implementation there was a relcutance on my part to generate incremental cache components on the fly since it would lead to some duplicate code. We are now seeing problems where each thread reading in the saved cache file causes significant overhead and can make the process appear to hang on a many core build, particularly when the cache file is large. This patch changes the code to maintain the delta in a separate dict right from the start. The code duplication isn't too bad and could be mitigated in other ways if it becomes an issue. [YOCTO #2039 partial] (Bitbake rev: cdd5d0dee6ab12326b252b6b505a316a52638cac) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27bitbake: Update users of getVar/setVar to use the data store functions directlyRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10codeparser: silence non-literal warnings for vardepsChristopher Larson
If the vardeps flag is not None, we now silence the warnings about non-literal usage for that variable. (Bitbake rev: e724b9f417d1baf898f5afc6376c73c1a2ad8db9) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10codeparser: drop expand trackingChristopher Larson
There are two usual cases involving bb.data.expand: - Calling it with a string literal -- "bb.data.expand('${FOO}/${BAZ}/bleh', d)". - Calling it on getVar results (legacy) -- "bb.data.expand(bb.data.getVar('FOO', d), d)" Nothing in any of the usual layers uses it in any other way, and I'm having trouble coming up with any real use cases beyond this. The first of the above cases is already tracked, via the expandWithRefs called on the python code string. The second didn't emit a warning anyway, since the getVar was already handled. Given this, I see no reason for us to maintain explicit expansion tracking. Further, we weren't using its results anyway (the var_expands member). (Bitbake rev: 405dfe69e6a608826e599ebf2f83ef8cf5083b96) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10codeparser: accept a name for better messagesChristopher Larson
- If a name is passed to the parser, prepend the messages with "while parsing <name>:". This gives a bit more context. - Tweak the warning messages slightly (they had to be altered anyway to inject the variable being parsed). Before: DEBUG: Warning: in call to 'bb.data.getVar': argument ''%s' % var' is \ not a literal After: DEBUG: while parsing emit_pkgdata, in call of bb.data.getVar, argument \ ''%s' % var' is not a string literal (Bitbake rev: 1060193ae4d54e667735dbff5d1d2be49a3f95c9) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10codeparser: simplify how we compare the called node namesChristopher Larson
With the previous method, using the compare_name methods, we split the requested match name by '.', reversed it, then compared them piecemeal during the node traversal. The new method walks the nodes and hands back the name of what's being called, and then we check that. This also consolidates the two different implementations of traversal of the attribute/name nodes (one in compare_name, one for the execs). (Bitbake rev: 84e535b5165c7e936c5b1486bdf4626ed3649f5f) Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10codeparser: merge the nested python parsing classesChristopher Larson
The split is even less necessary now that we use ast.walk rather than an actual NodeVisitor subclass. (Bitbake rev: d6c44fac184abae8395bfa7078f06675218aa534) Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-04codeparser: make var_expands actually hold useful informationChristopher Larson
Previously, it was calling var_expands.update() rather than add(), with a string argument, resulting in adding each character of that string to the var_expands set, rather than the string itself. (Bitbake rev: 8e4e75383e43d6da2c16ec5286186a0d0569b0f8) Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-15codeparser: When loading the cache, ignore ValueErrorRichard Purdie
(Bitbake rev: 9bff182a4ba9571679985b45b309990a6eddad14) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-27bitbake/codeparser: Improve cache handlingRichard Purdie
The current codeparser cache handling hurts performance badly even over a couple of cores and certainly on many core systems, it can spent huge amounts of time in the codeparser cache save functions. This patch reworks the cache handling so that each parsing thread saves out its own "differences" file compared to any existing core cache and then the main bitbake thread picks these up and merges things back together. This was tested on systems with small and large numbers of cores and was found to perform orders of magnitude better in all cases despite the more complex code. (Bitbake rev: 9f27563d66523f5af1028f173d53ee75e0877d46) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-24codeparser.py: fix syntax error in exception handlingOtavio Salvador
Commit 036cf3cd11b3a6836b77f5ffa760ceee6b71b1ef missed the needed brackets to handle more then a type of exception. (Bitbake rev: abecbb4c0af83c6b4ee248b0f03b779f84b13390) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-12codeparser.py: Ignore incomplete cache filesRichard Purdie
(Bitbake rev: 036cf3cd11b3a6836b77f5ffa760ceee6b71b1ef) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-05bitbake/codeparser: Correctly handle a missing/empty cache fileRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-05bitbake/cooker/codeparser: Ensure the code parser cache is saved for each ↵Richard Purdie
parsing process Before this change, the codeparser cache was only being saved for the main server process. This is suboptimal as it leaves code being re-evaluated at task execution time and increases parse time. We use the multiprocess Finalize() functionality to ensure each process saves out its cache. We need to update the cache save function to be multiprocess friendly with locking. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-31codeparser: use ==, not 'is' to compare stringsChris Larson
(Bitbake rev: 8f5cf3a9975d8e6878e403be0e6edc22cc44f396) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-25bitbake/codeparser: fix raising of ShellSyntaxErrorJoshua Lock
To raise the ShellSyntaxError we need to import it's module and reference it by namespace. Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-01-12codeparser: fix spacing in diagnostic messagesBernhard Reutner-Fischer
(Bitbake rev: 8c5555f5ed6d61db57de80d2820c8cec64a27239) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>