| Summary: |
Conditional append to distro feature causes infinite recursion parsing error |
| Product: |
[Build System, Metadata & Runtime] BitBake
|
Reporter: |
richard.neill |
| Component: |
bitbake | Assignee: |
Unassigned <unassigned> |
| Status: |
RESOLVED
WONTFIX
|
QA Contact: |
|
| Severity: |
normal
|
|
|
| Priority: |
Medium
|
CC: |
poky.bs.watcher, poky.watcher, randy.macleod, richard.purdie
|
| Version: |
unspecified | |
|
| Target Milestone: |
5.99 | |
|
| Hardware: |
x86 | |
|
| OS: |
Multiple | |
|
| Whiteboard: |
|
|
OS type for building Yocto:
|
---
|
Type of Regression:
|
---
|
|
Verified:
|
|
Documentation change:
|
No (bug/feature does not impact docs)
|
On poky master (6204a3f5f4), either of these lines: DISTRO_FEATURES_append_machine = " ${@bb.utils.contains('DISTRO_FEATURES', 'feature', ' another_feature', '', d)}" DISTRO_FEATURES_machine += "${@bb.utils.contains('DISTRO_FEATURES', 'feature', 'another_feature', '', d)}" Results in a parse error where it infinitely parses the conditional code: $ bitbake feature-image-minimal ERROR: Unable to parse <expansion> Traceback (most recent call last): File "/home/<user>/project/poky/bitbake/lib/bb/data_smart.py", line 416, in DataSmart.expandWithRefs(s=" feature ${@bb.utils.contains('DISTRO_FEATURES', 'feature', ' another_feature', '', d)}", varname='DISTRO_FEATURES'): tb = sys.exc_info()[2] > raise ExpansionError(varname, s, exc).with_traceback(tb) from exc File "/home/<user>/project/poky/bitbake/lib/bb/data_smart.py", line 403, in DataSmart.expandWithRefs(s=" feature ${@bb.utils.contains('DISTRO_FEATURES', 'feature', ' another_feature', '', d)}", varname='DISTRO_FEATURES'): try: > s = __expand_python_regexp__.sub(varparse.python_sub, s) except SyntaxError as e: File "/home/<user>/project/poky/bitbake/lib/bb/data_smart.py", line 116, in VariableParse.python_sub(match=<re.Match object; span=(20, 96), match="${@bb.utils.contains('DISTRO_FEATURES', 'feature>): > parser = bb.codeparser.PythonParser(self.varname, logger) parser.parse_python(code) File "/home/<user>/project/poky/bitbake/lib/bb/codeparser.py", line 279, in PythonParser.__init__(name='DISTRO_FEATURES', log=<BBLogger BitBake.Data (Level 8)>): self.references = set() > self.log = BufferedLogger('BitBake.Data.PythonParser', logging.DEBUG, log) File "/home/<user>/project/poky/bitbake/lib/bb/codeparser.py", line 184, in BufferedLogger.__init__(name='BitBake.Data.PythonParser', level=10, target=<BBLogger BitBake.Data (Level 8)>): def __init__(self, name, level=0, target=None): > Logger.__init__(self, name) self.setLevel(level) bb.data_smart.ExpansionError: Failure expanding variable DISTRO_FEATURES, expression was feature ${@bb.utils.contains('DISTRO_FEATURES', 'feature', ' another_feature', '', d)} which triggered exception RecursionError: maximum recursion depth exceeded This also occurs if I use a temporary variable to store the result of the conditional, and append the value of that temporary variable to DISTRO_FEATURES for the machine. My rationale for doing this is that we have some dependent layers, and we need 'another_feature' known by the parser (for a particular machine) even if the layer implementing 'feature' (which has a dependency on 'another_feature') is optionally later in bblayers.conf. Regardless of the rationale, provided the inclusion isn't breaking any rules then I would expect it to either succeed or fail gracefully?