Yocto, install files in a shared area

I am following this guide: OpenEmbedded (core) - Toradex System/Computer on Modules to build a yocto image for my Colibri iMX6DL (+Viola carrier board).

During the build (bitbake -k angstrom-lxde-image) I get many errors of the following kind

ERROR: linux-libc-headers-4.12-r0 do_package_write_ipk: The recipe linux-libc-headers is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
  /opt/yocto/poky/deploy/ipk/armv7at2hf-neon/linux-libc-headers-dbg_4.12-r0_armv7at2hf-neon.ipk
    (not matched to any task)
  /opt/yocto/poky/deploy/ipk/armv7at2hf-neon/linux-libc-headers-dev_4.12-r0_armv7at2hf-neon.ipk
    (not matched to any task)
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: linux-libc-headers-4.12-r0 do_package_write_ipk: 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.
ERROR: linux-libc-headers-4.12-r0 do_package_write_ipk: Function failed: sstate_task_postfunc
ERROR: Logfile of failure stored in: /opt/yocto/poky/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/linux-libc-headers/4.12-r0/temp/log.do_package_write_ipk.27696
ERROR: Task (/opt/yocto/poky/build/../layers/openembedded-core/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.12.bb:do_package_write_ipk) failed with exit code '1'
ERROR: libgcc-7.3.0-r0 do_package_write_ipk: The recipe libgcc is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
  /opt/yocto/poky/deploy/ipk/armv7at2hf-neon/libgcc-s-dbg_7.3.0-r0_armv7at2hf-neon.ipk
    (not matched to any task)
  /opt/yocto/poky/deploy/ipk/armv7at2hf-neon/libgcc1_7.3.0-r0_armv7at2hf-neon.ipk
    (not matched to any task)
  /opt/yocto/poky/deploy/ipk/armv7at2hf-neon/libgcc-s-dev_7.3.0-r0_armv7at2hf-neon.ipk
    (not matched to any task)
Please verify which recipe should provide the above files.

Are these errors to be expected? The build itself has not failed and is continuing.

Hi

I assume you tried to start a clean build by removing build/tmp-glibc but you did not remove deploy/ . Now bitbake does not have the information that the files under deploy/ can be safely overwritten.

The build is continuing since you started bitbake with the -k option. In the end it fail though.

Stop the build, remove build/tmp-glibc and deploy/ and restart.

Max

Thanks, that helped me resolve the problem.

Perfect, that it works. Thanks for the feedback.