[bitbake-devel] [PATCH 1/1] bitbake: cookerdata: Avoid double exceptions for bb.fatal()

Robert Yang liezhi.yang at windriver.com
Thu May 9 08:03:03 UTC 2019


The bb.fatal() raises BBHandledException() which causes double exceptions,
e.g.:

Add 'HOSTTOOLS += "hello"' to conf/local.conf:
$ bitbake -p
[snip]
During handling of the above exception, another exception occurred:
[snip]
ERROR: The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:
  hello

Use "raise" rather than "raise bb.BBHandledException" to fix the double
exceptions.

[YOCTO #13267]

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
 bitbake/lib/bb/cookerdata.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index f8ae410..585edc5 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -301,7 +301,9 @@ class CookerDataBuilder(object):
             if multiconfig:
                 bb.event.fire(bb.event.MultiConfigParsed(self.mcdata), self.data)
 
-        except (SyntaxError, bb.BBHandledException):
+        except bb.BBHandledException:
+            raise
+        except SyntaxError:
             raise bb.BBHandledException
         except bb.data_smart.ExpansionError as e:
             logger.error(str(e))
-- 
2.7.4



More information about the bitbake-devel mailing list