summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorMarta Rybczynska <rybczynska@gmail.com>2022-02-21 18:44:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-21 23:37:26 +0000
commitda4c443ac5ae7024d053f7e224c576f750a90085 (patch)
tree96e49098ad2fdeda27b9644828b9df0297409960 /bitbake/lib/bb
parentf7fccbe289c216b5bee7336d433589192f9cb6b0 (diff)
downloadpoky-da4c443ac5ae7024d053f7e224c576f750a90085.tar.gz
bitbake: lib/bb: fix exit when found renamed variables
Until now, if a renamed variable was found, bitbake exited immediately if it was in a class, but continued after an error message if the variable was in a recipe. This was caused by cookerdata.py CookerDataBuilder::parseBaseConfiguration checking a different DataSmart instance than the variable was set in. To solve the issue, add a special variable and set it when we find a renamed variable. Check for it in ast.py and bail out if needed. (Bitbake rev: d12400600e30549c88dc9e7883dc3d63b1dc1117) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/data_smart.py4
-rw-r--r--bitbake/lib/bb/parse/ast.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 7b06d3a107..e7047d79ca 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -546,6 +546,8 @@ class DataSmart(MutableMapping):
546 shortvar = var.split(":", 1)[0] 546 shortvar = var.split(":", 1)[0]
547 if shortvar in self._var_renames: 547 if shortvar in self._var_renames:
548 _print_rename_error(shortvar, loginfo, self._var_renames, fullvar=var) 548 _print_rename_error(shortvar, loginfo, self._var_renames, fullvar=var)
549 # Mark that we have seen a renamed variable
550 self.setVar("_FAILPARSINGERRORHANDLED", True)
549 551
550 self.expand_cache = {} 552 self.expand_cache = {}
551 parsing=False 553 parsing=False
@@ -737,6 +739,8 @@ class DataSmart(MutableMapping):
737 739
738 if var in self._var_renames: 740 if var in self._var_renames:
739 _print_rename_error(var, loginfo, self._var_renames) 741 _print_rename_error(var, loginfo, self._var_renames)
742 # Mark that we have seen a renamed variable
743 self.setVar("_FAILPARSINGERRORHANDLED", True)
740 744
741 if 'op' not in loginfo: 745 if 'op' not in loginfo:
742 loginfo['op'] = "set" 746 loginfo['op'] = "set"
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 31bcc8e7ac..4b1b44ce19 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -333,6 +333,10 @@ def runAnonFuncs(d):
333def finalize(fn, d, variant = None): 333def finalize(fn, d, variant = None):
334 saved_handlers = bb.event.get_handlers().copy() 334 saved_handlers = bb.event.get_handlers().copy()
335 try: 335 try:
336 # Found renamed variables. Exit immediately
337 if d.getVar("_FAILPARSINGERRORHANDLED", False) == True:
338 raise bb.BBHandledException()
339
336 for var in d.getVar('__BBHANDLERS', False) or []: 340 for var in d.getVar('__BBHANDLERS', False) or []:
337 # try to add the handler 341 # try to add the handler
338 handlerfn = d.getVarFlag(var, "filename", False) 342 handlerfn = d.getVarFlag(var, "filename", False)