aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/parse/ast.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-14 12:48:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-14 13:12:07 +0100
commit0219271d4130c1f4cf071c7577a4101c54c04921 (patch)
tree81cfed29c26b33027ff1d4373b98a9eeb9c38529 /lib/bb/parse/ast.py
parent8aa84abc952835792db1614b6fe2305ab9dca9e1 (diff)
downloadbitbake-0219271d4130c1f4cf071c7577a4101c54c04921.tar.gz
parse/ast, event: Ensure we reset registered handlers during parsing
When parsing, we should reset the event handlers we registered when done. If we don't do this, parse order may change the build, depending on what the parse handlers do to the metadata. This issue showed up as a basehash change: ERROR: Bitbake's cached basehash does not match the one we just generated ( /media/build1/poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb.do_unpack)! This is due to the eventhandler in nativesdk.bbclass being run, despite this .bb file not inheriting nativesdk.bbclass. The parse order was different between the signature generation and the main multithreaded parse. Diffsigs showed: bitbake-diffsigs 1.0-r2.do_unpack.sigbasedata.* basehash changed from 887d1c25962156cae859c1542e69a8d7 to cb84fcfafe15fc92fb7ab8c6d97014ca Variable PN value changed from 'nativesdk-buildtools-perl-dummy' to '${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}' with PN being set by the event handler. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/parse/ast.py')
-rw-r--r--lib/bb/parse/ast.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index 548929f63..8b9baa764 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -306,7 +306,8 @@ def handleInherit(statements, filename, lineno, m):
statements.append(InheritNode(filename, lineno, classes))
def finalize(fn, d, variant = None):
- all_handlers = {}
+ saved_handlers = bb.event.get_handlers().copy()
+
for var in d.getVar('__BBHANDLERS', False) or []:
# try to add the handler
handlerfn = d.getVarFlag(var, "filename", False)
@@ -331,6 +332,7 @@ def finalize(fn, d, variant = None):
d.setVar('BBINCLUDED', bb.parse.get_file_depends(d))
bb.event.fire(bb.event.RecipeParsed(fn), d)
+ bb.event.set_handlers(saved_handlers)
def _create_variants(datastores, names, function, onlyfinalise):
def create_variant(name, orig_d, arg = None):