| Summary: |
layer without priority causes crash instead of reporting error |
| Product: |
[Build System, Metadata & Runtime] BitBake
|
Reporter: |
David Reyna <david.reyna> |
| Component: |
bitbake | Assignee: |
David Reyna <david.reyna> |
| Status: |
RESOLVED
FIXED
|
QA Contact: |
|
| Severity: |
normal
|
|
|
| Priority: |
Medium
|
CC: |
poky.bs.watcher, poky.watcher
|
| Version: |
unspecified | |
|
| Target Milestone: |
2.6 M4 | |
|
| Hardware: |
x86 | |
|
| OS: |
Multiple | |
|
| Whiteboard: |
|
|
OS type for building Yocto:
|
---
|
Type of Regression:
|
---
|
|
Verified:
|
|
Documentation change:
|
No (bug/feature does not impact docs)
|
In "cooker.py" there is a section of code that scans a layer for its priority. However, only the success path avoids an otherwise undefined variable, so the error is not reported and bitbake crashes. This was found while experimenting with a weak layer. UnboundLocalError: local variable 'cre' referenced before assignment Here is the code in question. Notice that 'cre' is only defined on the success path. vvvvvvv # Calculate all layer priorities using calc_layer_priority and store in bbfile_config_priorities for c in collection_list: calc_layer_priority(c) regex = self.data.getVar("BBFILE_PATTERN_%s" % c) if regex == None: parselog.error("BBFILE_PATTERN_%s not defined" % c) errors = True continue elif regex == "": parselog.debug(1, "BBFILE_PATTERN_%s is empty" % c) errors = False else: try: cre = re.compile(regex) except re.error: parselog.error("BBFILE_PATTERN_%s \"%s\" is not a valid regular expression", c, regex) errors = True continue self.bbfile_config_priorities.append((c, regex, cre, collection_priorities[c])) ^^^^^^^^ I propose that the resolution is to move the append right after 'cre' is defined, since that is the only success path.