| Summary: | bitbake-layers: check layer dependencies before adding | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] BitBake | Reporter: | Patrick Ohly <patrick.ohly> |
| Component: | bitbake | Assignee: | Rebecca Chang <rebecca.swee.fun.chang> |
| Status: | VERIFIED FIXED | QA Contact: | Ashwin Soman <ashwinx.soman> |
| Severity: | enhancement | ||
| Priority: | Medium | CC: | ashwinx.soman, bluelightning, ee.peng.yeoh, humberto.ibarra.lopez, poky.bs.watcher, poky.watcher, rebecca.swee.fun.chang, sgw |
| Version: | unspecified | ||
| Target Milestone: | 2.4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
I found this issue also, but in my case in was with show-layers
[humberto@localhost build]$ bitbake-layers show-layers
Traceback (most recent call last):
File "/home/humberto/poky2/bitbake/bin/bitbake-layers", line 122, in <module>
ret = main()
File "/home/humberto/poky2/bitbake/bin/bitbake-layers", line 89, in main
tinfoil = tinfoil_init(False)
File "/home/humberto/poky2/bitbake/bin/bitbake-layers", line 38, in tinfoil_init
tinfoil.prepare(not parserecipes)
File "/home/humberto/poky2/bitbake/lib/bb/tinfoil.py", line 218, in prepare
self.run_command('parseConfiguration')
File "/home/humberto/poky2/bitbake/lib/bb/tinfoil.py", line 268, in run_command
raise TinfoilCommandFailed(result[1])
bb.tinfoil.TinfoilCommandFailed: Traceback (most recent call last):
File "/home/humberto/poky2/bitbake/lib/bb/command.py", line 81, in runCommand
result = command_method(self, commandline)
File "/home/humberto/poky2/bitbake/lib/bb/command.py", line 315, in parseConfiguration
command.cooker.parseConfiguration()
File "/home/humberto/poky2/bitbake/lib/bb/cooker.py", line 541, in parseConfiguration
self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS"))
File "/home/humberto/poky2/bitbake/lib/bb/cooker.py", line 1284, in handleCollections
raise CollectionError("Errors during parsing layer configuration")
bb.cooker.CollectionError: Errors during parsing layer configuration
Setting the LAYERDEPENDS variable in conf/layer.conf to LAYERDEPENDS_<layer-name> was what caused this issue for me. Using just LAYERDEPENDS as the name of the variable or actually any string other than the layer's name after LAYERDEPENDS causes bitbake-layers to behave normally again.
(In reply to comment #1) > Setting the LAYERDEPENDS variable in conf/layer.conf to > LAYERDEPENDS_<layer-name> was what caused this issue for me. Using just > LAYERDEPENDS as the name of the variable or actually any string other than > the layer's name after LAYERDEPENDS causes bitbake-layers to behave normally > again. I think that's just incidental - you're hiding the dependency and thus the check doesn't think there are any missing dependencies; the dependencies are still missing. Fixed implemented and merged. Bitbake rev: 705ab252e631903e6d2e46202b419a9e8adcd861 Bug is resolved , Layer is not added if dependent Layers are not present/enabled Logs: pokyuser@ecf3a74f7f20:/workdir/build$ bitbake-layers add-layer /workdir/poky/meta-security NOTE: Starting bitbake server... ERROR: Layer 'security' depends on layer 'meta-python', but this layer is not enabled in your configuration ERROR: Layer 'security' depends on layer 'networking-layer', but this layer is not enabled in your configuration ERROR: Layer 'security' depends on layer 'openembedded-layer', but this layer is not enabled in your configuration ERROR: Layer 'security' depends on layer 'perl-layer', but this layer is not enabled in your configuration Summary: There were 4 ERROR messages shown, returning a non-zero exit code. ERROR: Parse failure with the specified layer added pokyuser@ecf3a74f7f20:/workdir/build$ Bug have been resolved and verified |
* check out Poky, set up a build $ bitbake-layers add-layer /work/meta-security (= git://git.yoctoproject.org/meta-security) $ bitbake libtpm-native ERROR: Layer 'security' depends on layer 'filesystems-layer', but this layer is not enabled in your configuration ERROR: Layer 'security' depends on layer 'perl-layer', but this layer is not enabled in your configuration Summary: There were 2 ERROR messages shown, returning a non-zero exit code. $ bitbake-layers add-layer /work/meta-openembedded/meta-filesystems/ Traceback (most recent call last): File "/work/iot-ref-kit/bitbake/bin/bitbake-layers", line 122, in <module> ret = main() File "/work/iot-ref-kit/bitbake/bin/bitbake-layers", line 89, in main tinfoil = tinfoil_init(False) File "/work/iot-ref-kit/bitbake/bin/bitbake-layers", line 38, in tinfoil_init tinfoil.prepare(not parserecipes) File "/work/iot-ref-kit/bitbake/lib/bb/tinfoil.py", line 218, in prepare self.run_command('parseConfiguration') File "/work/iot-ref-kit/bitbake/lib/bb/tinfoil.py", line 268, in run_command raise TinfoilCommandFailed(result[1]) bb.tinfoil.TinfoilCommandFailed: Traceback (most recent call last): File "/work/iot-ref-kit/bitbake/lib/bb/command.py", line 81, in runCommand result = command_method(self, commandline) File "/work/iot-ref-kit/bitbake/lib/bb/command.py", line 315, in parseConfiguration command.cooker.parseConfiguration() File "/work/iot-ref-kit/bitbake/lib/bb/cooker.py", line 541, in parseConfiguration self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS")) File "/work/iot-ref-kit/bitbake/lib/bb/cooker.py", line 1284, in handleCollections raise CollectionError("Errors during parsing layer configuration") bb.cooker.CollectionError: Errors during parsing layer configuration ^CError in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python3.4/multiprocessing/popen_fork.py", line 30, in poll pid, sts = os.waitpid(self.pid, flag) KeyboardInterrupt In other words, adding the meta-security layer without the layers it depends on succeeded, but then rendered the build configuration unusable. In particular, further bitbake-layers invocations to add the missing layers fail and have to be aborted manually. Adding the missing layers manually of course still works. IMHO the best solution would be to check for layer dependencies before adding a layer and then abort with a suitable error message.