When a wrong path to a layers is found in bblayers.conf, the command bitbake-layers show-layers throws an exception. This should either ignore the failing layer or show a more graceful error message to the user. humberto@yctb03:~/poky/build-test> echo "BBLAYERS += \"/foo/path\"" >> conf/bblayers.conf; bitbake-layers show-layers ERROR: Traceback (most recent call last): File "/home/humberto/poky/bitbake/lib/bb/cookerdata.py", line 179, in wrapped return func(fn, *args) File "/home/humberto/poky/bitbake/lib/bb/cookerdata.py", line 203, in parse_config_file return bb.parse.handle(fn, data, include) File "/home/humberto/poky/bitbake/lib/bb/parse/__init__.py", line 113, in handle return h['handle'](fn, data, include) File "/home/humberto/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 124, in handle abs_fn = resolve_file(fn, data) File "/home/humberto/poky/bitbake/lib/bb/parse/__init__.py", line 136, in resolve_file raise IOError(errno.ENOENT, "file %s not found" % fn) IOError: [Errno 2] file /foo/path/conf/layer.conf not found ERROR: Unable to parse /foo/path/conf/layer.conf: [Errno 2] file /foo/path/conf/layer.conf not found
Have been checking this and have a few comments to make: -About the problem To me it does look like something we need to solve. Stack traces can be confusing and I believe that those should only be shown when we do not know what is the exact failure. Here, we know that the layer conf file can't be found, we should be failing gracefully. This situation is not much different from issuing "bitbake-layers add-layer <name>" when trying to add a layer that does not exist, and that command fails gracefully with no stack trace. This error message shouldn't behave differently from that one. -About Implementation: The solution to this is not as easy as handling the error in the bitbake-layers script though. Unlike the add-layer subcommand, show-layers relies on cookerdata to handle the parsing of config files, so the fix must be inside a script used by many parts of the code. Still wondering about the best way to proceed here. Adding a sys.exit under a conditional solves the problem, but the abrupt exit does not look like the ideal solution. Throwing a specific exception could work but I see no advantage in dealing with separate exceptions for each simple case like this one. I will continue looking into this.
Sent patch. http://lists.openembedded.org/pipermail/bitbake-devel/2016-May/007431.html
Sent patch v2 http://lists.openembedded.org/pipermail/bitbake-devel/2016-May/007433.html
Sent patch v3 http://lists.openembedded.org/pipermail/bitbake-devel/2016-May/007456.html
It has been noted that this will be solved at a higher level with the current migration to python3.
(In reply to comment #5) > It has been noted that this will be solved at a higher level with the > current migration to python3. I do not get it. The patch that you sent is valid either on python2 or 3. So, in my opinion, it should be merged on bitbake master. Leo
Working as expected Validated on : commit 7b9e1f5ad8a427356f2ec516b1718138a7d3c64e ********************** ERROR: Layer directory '/foo/path' does not exist! Please check BBLAYERS in /home/jgperezc/work/YoctoProject/poky_test/build/conf/bblayers.conf