[bitbake-devel] [PATCH 1/2] bb.cookerdata: don't show traceback for ParseError/ExpansionError
Christopher Larson
chris_larson at mentor.com
Fri Jul 31 18:17:39 UTC 2015
On Fri, Jul 31, 2015 at 11:16 AM, Christopher Larson <kergoth at gmail.com>
wrote:
> From: Christopher Larson <chris_larson at mentor.com>
>
> Tracebacks are of extremely limited usefulness in this context. The
> exceptions
> carry the necessary context already, and the user doesn't care about the
> calls
> in bitbake internals that led to an expansion or parse failure.
>
> Signed-off-by: Christopher Larson <chris_larson at mentor.com>
Example of a parse error:
ERROR: Traceback (most recent call last):
File "/scratch/poky/bitbake/lib/bb/cookerdata.py", line 175, in
wrapped
return func(fn, *args)
File "/scratch/poky/bitbake/lib/bb/cookerdata.py", line 185, in
parse_config_file
return bb.parse.handle(fn, data, include)
File "/scratch/poky/bitbake/lib/bb/parse/__init__.py", line 108, in
handle
return h['handle'](fn, data, include)
File "/scratch/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py",
line 155, in handle
statements.eval(data)
File "/scratch/poky/bitbake/lib/bb/parse/ast.py", line 39, in eval
statement.eval(data)
File "/scratch/poky/bitbake/lib/bb/parse/ast.py", line 63, in eval
bb.parse.ConfHandler.include(self.filename, s, self.lineno, data,
False)
File "/scratch/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py",
line 106, in include
raise ParseError("Error parsing %s: %s" % (fn, exc.strerror),
parentfn, lineno)
ParseError: ParseError at /scratch/poky/meta/conf/bitbake.conf:679:
Error parsing /scratch/build/conf/local.conf: Permission denied
ERROR: Unable to parse conf/bitbake.conf: ParseError at
/scratch/poky/meta/conf/bitbake.conf:679: Error parsing
/scratch/build/conf/local.
conf: Permission denied
Example of an expansion error:
ERROR: Traceback (most recent call last):
File "/scratch/poky/bitbake/lib/bb/cookerdata.py", line 175, in
wrapped
return func(fn, *args)
File "/scratch/poky/bitbake/lib/bb/cookerdata.py", line 185, in
parse_config_file
return bb.parse.handle(fn, data, include)
File "/scratch/poky/bitbake/lib/bb/parse/__init__.py", line 108, in
handle
return h['handle'](fn, data, include)
File "/scratch/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py",
line 155, in handle
statements.eval(data)
File "/scratch/poky/bitbake/lib/bb/parse/ast.py", line 39, in eval
statement.eval(data)
File "/scratch/poky/bitbake/lib/bb/parse/ast.py", line 63, in eval
bb.parse.ConfHandler.include(self.filename, s, self.lineno, data,
False)
File "/scratch/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py",
line 96, in include
bb.parse.handle(fn, data, True)
File "/scratch/poky/bitbake/lib/bb/parse/__init__.py", line 108, in
handle
return h['handle'](fn, data, include)
File "/scratch/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py",
line 155, in handle
statements.eval(data)
File "/scratch/poky/bitbake/lib/bb/parse/ast.py", line 39, in eval
statement.eval(data)
File "/scratch/poky/bitbake/lib/bb/parse/ast.py", line 111, in eval
val = e.expand(groupd["value"], key + "[:=]")
File "/scratch/poky/bitbake/lib/bb/data_smart.py", line 380, in expand
return self.expandWithRefs(s, varname).value
File "/scratch/poky/bitbake/lib/bb/data_smart.py", line 370, in
expandWithRefs
raise ExpansionError(varname, s, exc)
ExpansionError: Failure expanding variable FOO[:=], expression was
${@alpha beta theta} which triggered exception SyntaxError: invalid syntax
(FOO[:=], line 1)
ERROR: Unable to parse conf/bitbake.conf: Failure expanding variable
FOO[:=], expression was ${@alpha beta theta} which triggered exception
SyntaxError: invalid syntax (FOO[:=]
, line 1)
--
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20150731/0d93ff78/attachment-0002.html>
More information about the bitbake-devel
mailing list