When oe-selftest is used with `--newbuilddir` option, it triggers code in meta/lib/oeqa/selftest/context.py which replaces relative paths in conf/bblayers.conf with absolute paths (see function setup_builddir). It does so by evaluating the final value of BBLAYERS variable (via `bitbake-getvar --value BBLAYERS`) and writing `BBLAYERS =` with final value at the end of the file. This breaks tests when bblayers.conf contains BBLAYERS:append because :append statements are evaluated AFTER all assignments and we end up with the appended layer added twice - first by evaluating final value of the variable, then again by bitbake evaluating BBLAYERS:append. The error is as follows: AssertionError: Command 'bitbake -e' returned non-zero exit status 1: ERROR: Found duplicated BBFILE_COLLECTIONS 'layer-name', check bblayers.conf or layer.conf to fix it.
Oleksandr, Are you able to work on a fix and send a patch to the oe-core list? The fellow CCed, Christo (?) is going to try to reproduce the issue as well.
hi so, i took the following actions: - create new layer 'meta-appendlayer' - add manually in the end of 'bblayers.conf' the line: BBLAYERS:append = " /home/cg/CG/TestPoky/poky/meta-appendlayer" - source again the environment - BBLAYERS variable contains the 'meta-appendlayer' (absolute path) - run random test individually: oe-selftest --newbuilddir /home/cg/CG/TestPoky/newbuilddir -r archiver.Archiver.test_archiver_allows_to_filter_on_recipe_name (i tried 3-4 of them all ok) - test completed ok without errors or warnings -I tried to run all tests (oe-selftest --newbuilddir /home/cg/CG/TestPoky/newbuilddir -a). i had to stop it manually after 16h that didnt even run half of them. Oleksandr, i have few questions: - did you append the new layer inside the 'bblayers.conf' ? - which tests did you run when the error generated? all of them? - did you try to use '+=' instead of 'append'? *ofc if you want to fix the issue yourself please go ahead :)
Hi Christos, As I mentioned in my report, this has to do with the code which replaces relative paths to layers with absolute paths. So, to clarify, in order to reproduce this issue you need to have - at least one layer added via :append - at least one layer defined via a relative path, specifically using '..' (reference to parent directory) I think this can be the same layer (?) See setup_builddir function in meta/lib/oeqa/selftest/context.py for implementation details. Regards, Oleksandr
Using `unset` statement prior to assignment appears to clear :append history. I have sent the necessary patch to oe-core mailing list. Please review.
hi i have reproduced the issue with the following bblayers.conf ------------------ BBLAYERS ?= " \ /home/cg/CG/TestPoky/poky/meta \ ${TOPDIR}/../meta-poky \ /home/cg/CG/TestPoky/poky/meta-yocto-bsp \ /home/cg/CG/TestPoky/poky/meta-selftest \ /home/cg/CG/TestPoky/poky/build/workspace \ " BBLAYERS:append = " /home/cg/CG/TestPoky/poky/meta-appendlayer" ----------------- I tested your patch you submitted and looks that fixes the issue. Br Christos
hi the patch for this bug is this: https://lists.openembedded.org/g/openembedded-core/message/208494?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3Arecentpostdate%2Fsticky%2C%2COleksandr%2C20%2C2%2C0%2C110013818 I have checked and it does exist in master
It's useful to have a link or at least a commit id when resolving defects: https://git.openembedded.org/openembedded-core/commit/?id=3ca9192cf16e15e95ba1c3db4ba28fc6130de8e0 Just merged as of: 2025-01-23 12:17:38 Thanks Oleksandr !
Oops, the last comment has the wrong link. It should be: https://git.openembedded.org/openembedded-core/commit/?id=516c8e8f722ed0eb85a715a23b5e68d05abe9275 oeqa/selftest: Fix failure when configuration contains BBLAYERS:append Thanks to Christos for asking me about it!