diff options
author | Christopher Larson <chris_larson@mentor.com> | 2016-04-30 12:52:46 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-19 09:05:20 +0100 |
commit | a809f1c6afb8d3cf2309078103f5fbdbf071cf09 (patch) | |
tree | afc23bdaecba39804c9426ca3412b57879736dc6 /bitbake | |
parent | b00282fd20f711033d40993a6d86fdac97e8a3a3 (diff) | |
download | poky-a809f1c6afb8d3cf2309078103f5fbdbf071cf09.tar.gz |
bitbake: bb.cooker: show limited traceback for parsing ExpansionError
It's useful to see tracebacks for ExpansionErrors, but only if we skip the
leading bitbake-internal elements, otherwise we see elements of the expansion
process.
As one example:
Before:
ERROR: ExpansionError during parsing /scratch/yocto-new/external-as-needed/poky/meta/recipes-core/glibc/glibc-locale_2.23.bb: Failure expanding variable PV[:=], expression was ${@get_external_libc_version(d)} which triggered exception AttributeError: 'module' object has no attribute 'external'
After:
ERROR: ExpansionError during parsing /scratch/yocto-new/external-as-needed/poky/meta/recipes-core/glibc/glibc-locale_2.23.bb
Traceback (most recent call last):
File "PV[:=]", line 1, in <module>
File "/scratch/yocto-new/external-as-needed/meta-sourcery/recipes-external/glibc/glibc-external-version.inc", line 3, in get_external_libc_version(d=<bb.data_smart.DataSmart
object at 0x7f05d2566950>):
sopattern = os.path.join(d.getVar('base_libdir', True), 'libc-*.so')
> found_paths = oe.external.find_sysroot_files([sopattern], d)
if found_paths:
ExpansionError: Failure expanding variable PV[:=], expression was ${@get_external_libc_version(d)} which triggered exception AttributeError: 'module' object has no attribute 'external'
(Bitbake rev: 7ff5b9eed82b7f4fd138fc6d746a0b79efbea98a)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 5b76b4d20d..219c79ec69 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -2147,8 +2147,11 @@ class CookerParser(object): | |||
2147 | return False | 2147 | return False |
2148 | except bb.data_smart.ExpansionError as exc: | 2148 | except bb.data_smart.ExpansionError as exc: |
2149 | self.error += 1 | 2149 | self.error += 1 |
2150 | _, value, _ = sys.exc_info() | 2150 | bbdir = os.path.dirname(__file__) + os.sep |
2151 | logger.error('ExpansionError during parsing %s: %s', value.recipe, str(exc)) | 2151 | etype, value, _ = sys.exc_info() |
2152 | tb = list(itertools.dropwhile(lambda e: e.filename.startswith(bbdir), exc.traceback)) | ||
2153 | logger.error('ExpansionError during parsing %s', value.recipe, | ||
2154 | exc_info=(etype, value, tb)) | ||
2152 | self.shutdown(clean=False) | 2155 | self.shutdown(clean=False) |
2153 | return False | 2156 | return False |
2154 | except Exception as exc: | 2157 | except Exception as exc: |