I have a Yocto-based Linux image for a Gumstix board. The image includes the Bluez5 Bluetooth stack.
local.conf:
... DISTRO_FEATURES_append = " bluetooth bluez5" ...
This successfully builds an image where I can use the Bluetooth module from the CLI. I want to use the Bluetooth module in Python, so I add pybluez support -
myimage.bb:
... PYTHON_INSTALL_append = "python-pybluez \" ...
python_pybluez.bb:
DESCRIPTION = "Python bindings for the Linux Bluetooth stack"
SECTION = "devel/python"
DEPENDS = "bluez5"
LICENSE = "GPL"
SRC_URI = "https://github.com/karulis/pybluez/archive/master.zip"
SRC_URI[md5sum] = "37733f35ad5a0522b86fe39467481fd1"
SRC_URI[sha256sum] = "8e7e5e4e343da7e0ec2cd37b6dc12ee77da8e4c0863dd8a2d03ab06f9b657238"
S = "${WORKDIR}/PyBluez-${PV}"
inherit distutils
This causes a huge number of conflicts when bitbaked and the build fails:
NOTE: Preparing RunQueue
ERROR: Multiple .bb files are due to be built which each provide bluez-hcidump (/home/parallels/yocto/poky/meta/recipes-connectivity/bluez5/bluez5_5.28.bb /home/parallels/yocto/poky/meta/recipes-connectivity/bluez/bluez-hcidump_2.5.bb).
This usually means one provides something the other doesn't and should.
NOTE: Executing SetScene Tasks
ERROR: The recipe bluez5 is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
/media/parallels/build/tmp/sysroots/overo/pkgdata/runtime-reverse/libasound-module-bluez
Matched in manifest-overo-bluez4.packagedata
/media/parallels/build/tmp/sysroots/overo/pkgdata/runtime/libasound-module-bluez.packaged
Matched in manifest-overo-bluez4.packagedata
/media/parallels/build/tmp/sysroots/overo/pkgdata/runtime/libasound-module-bluez
Matched in manifest-overo-bluez4.packagedata
Please verify which recipe should provide the above files.
The build has stopped as continuing in this scenario WILL break things, if not now, possibly in the future (we've seen builds fail several months later). If the system knew how to recover from this automatically it would however there are several different scenarios which can result in this and we don't know which one this is. It may be you have switched providers of something like virtual/kernel (e.g. from linux-yocto to linux-yocto-dev), in that case you need to execute the clean task for both recipes and it will resolve this error. It may be you changed DISTRO_FEATURES from systemd to udev or vice versa. Cleaning those recipes should again resolve this error however switching DISTRO_FEATURES on an existing build directory is not supported, you should really clean out tmp and rebuild (reusing sstate should be safe). It could be the overlapping files detected are harmless in which case adding them to SSTATE_DUPWHITELIST may be the correct solution. It could also be your build is including two different conflicting versions of things (e.g. bluez 4 and bluez 5 and the correct solution for that would be to resolve the conflict. If in doubt, please ask on the mailing list, sharing the error and filelist above.
ERROR: If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.
WARNING: Logfile for failed setscene task is /media/parallels/build/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/bluez5/5.28-r0/temp/log.do_packagedata_setscene.16687
WARNING: Setscene task 803 (/home/parallels/yocto/poky/meta/recipes-connectivity/bluez5/bluez5_5.28.bb, do_packagedata_setscene) failed with exit code '1' - real task will be run instead
ERROR: The recipe bluez5 is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
/media/parallels/build/tmp/sysroots/overo/usr/lib/libbluetooth.so
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/lib/libbluetooth.la
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/lib/libbluetooth.so.3
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/lib/pkgconfig/bluez.pc
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/sdp.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/bnep.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/cmtp.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/hci.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/rfcomm.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/bluetooth.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/hci_lib.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/l2cap.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/sco.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/hidp.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/sdp_lib.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/sysroot-providers/bluez-hcidump
Matched in manifest-overo-bluez-hcidump.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/lib/udev/hid2hci
Matched in manifest-overo-bluez4.populate_sysroot
Please verify which recipe should provide the above files.
The build has stopped as continuing in this scenario WILL break things, if not now, possibly in the future (we've seen builds fail several months later). If the system knew how to recover from this automatically it would however there are several different scenarios which can result in this and we don't know which one this is. It may be you have switched providers of something like virtual/kernel (e.g. from linux-yocto to linux-yocto-dev), in that case you need to execute the clean task for both recipes and it will resolve this error. It may be you changed DISTRO_FEATURES from systemd to udev or vice versa. Cleaning those recipes should again resolve this error however switching DISTRO_FEATURES on an existing build directory is not supported, you should really clean out tmp and rebuild (reusing sstate should be safe). It could be the overlapping files detected are harmless in which case adding them to SSTATE_DUPWHITELIST may be the correct solution. It could also be your build is including two different conflicting versions of things (e.g. bluez 4 and bluez 5 and the correct solution for that would be to resolve the conflict. If in doubt, please ask on the mailing list, sharing the error and filelist above.
ERROR: If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.
It looks like pybluez is depending on a whole heap of Bluez4 recipes & libraries, which conflict with their Bluez5 counterparts. Would it be correct to resolve this by forcing pybluez to use the Bluez5 versions - if so, how and where should this be specified to Bitbake - if not, is it even possible to use pybluez with Bluez5 in a Yocto Linux system?
It looks like pybluez is depending on a whole heap of Bluez4 recipes & libraries
This is incorrect based on what you've shown. Your python-pybluez recipe only depends on bluez5 (and the python things distutils brings in). Yocto may magically add runtime dependencies to your packages based on linkage, but in that case you would get a warning about possibly missing build-time DEPENDS.
I think it's much more likely that the image you use contains bluez4 package already (maybe it's old or maybe they just haven't updated) and python-pybluez dragging in bluez5 breaks things.
Oh, forgot the beef: Did you notice the end of the message: you're advised to wipe out tmp and rebuild (reusing sstate is fine) -- building python-pybluez recipe alone should proceed if you just wipe your TMPDIR and build again. You'll still need to deal with the conflicts before image creation if your image does really contain bluez4