From ba0472a672eacbbbb2295252a0d2056d3399c6a9 Mon Sep 17 00:00:00 2001 From: Chris Laplante Date: Mon, 27 Jul 2020 19:21:23 -0400 Subject: build: print traceback if progress handler can't be created Before: ERROR: expat-native-2.2.9-r0 do_compile: 'NoneType' object has no attribute 'get' ERROR: Logfile of failure stored in: /home/laplante/repos/oe-core/build/tmp-glibc/work/x86_64-linux/expat-native/2.2.9-r0/temp/log.do_compile.90289 Log data follows: | ERROR: 'NoneType' object has no attribute 'get' ERROR: Task (virtual:native:/home/laplante/repos/oe-core/meta/recipes-core/expat/expat_2.2.9.bb:do_compile) failed with exit code '1' After: ERROR: expat-native-2.2.9-r0 do_configure: Failed to create progress handler ERROR: expat-native-2.2.9-r0 do_configure: Traceback (most recent call last): File "/home/laplante/repos/oe-core/bitbake/lib/bb/build.py", line 400, in exec_func_shell logfile = create_progress_handler(func, progress, logfile, d) File "/home/laplante/repos/oe-core/bitbake/lib/bb/build.py", line 344, in create_progress_handler cls_obj = functools.reduce(resolve, cls.split("."), bb.utils._context) File "/home/laplante/repos/oe-core/bitbake/lib/bb/build.py", line 343, in resolve return x.get(y) AttributeError: 'NoneType' object has no attribute 'get' ERROR: expat-native-2.2.9-r0 do_configure: 'NoneType' object has no attribute 'get' ERROR: Logfile of failure stored in: /home/laplante/repos/oe-core/build/tmp-glibc/work/x86_64-linux/expat-native/2.2.9-r0/temp/log.do_configure.22982 ERROR: Task (virtual:native:/home/laplante/repos/oe-core/meta/recipes-core/expat/expat_2.2.9.bb:do_configure) failed with exit code '1' Signed-off-by: Chris Laplante Signed-off-by: Richard Purdie --- lib/bb/build.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/bb/build.py b/lib/bb/build.py index 23b6ee455..cb2e75b14 100644 --- a/lib/bb/build.py +++ b/lib/bb/build.py @@ -398,7 +398,13 @@ exit $ret progress = d.getVarFlag(func, 'progress') if progress: - logfile = create_progress_handler(func, progress, logfile, d) + try: + logfile = create_progress_handler(func, progress, logfile, d) + except: + from traceback import format_exc + logger.error("Failed to create progress handler") + logger.error(format_exc()) + raise fifobuffer = bytearray() def readfifo(data): -- cgit 1.2.3-korg