Commands to reproduce: git clone git://git.yoctoproject.org/poky cd poky . oe-init-build-env cat >> conf/local.conf << 'EOF' RM_OLD_IMAGE = "1" PRSERV_HOST = "localhost:0" INHERIT += "buildhistory" BUILDHISTORY_COMMIT = "1" INHERIT += "rm_work" IMAGE_FSTYPES = "vdi" EOF bitbake core-image-minimal bitbake core-image-minimal NOTE: Started PRServer with DBfile: [...]/poky/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 40437, PID: 31804 WARNING: Host distribution "ArchLinux" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution. Parsing recipes: 100% |#######################################################################################################################| Time: 0:00:12 Parsing of 864 .bb files complete (0 cached, 864 parsed). 1313 targets, 47 skipped, 0 masked, 0 errors. NOTE: Resolving any missing task queue dependencies Build Configuration: BB_VERSION = "1.31.1" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "universal" TARGET_SYS = "i586-poky-linux" MACHINE = "qemux86" DISTRO = "poky" DISTRO_VERSION = "2.1+snapshot-20160818" TUNE_FEATURES = "m32 i586" TARGET_FPU = "" meta meta-poky meta-yocto-bsp = "master:6c24a6446a2e5310088bd13c0deaa2d2ac3484c9" Initialising tasks: 100% |####################################################################################################################| Time: 0:00:03 NOTE: Executing SetScene Tasks NOTE: Executing RunQueue Tasks ERROR: core-image-minimal-1.0-r0 do_bootdirectdisk: Function failed: Unable to open [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/core-image-minimal-1.0/syslinux_vm.cfg ERROR: Logfile of failure stored in: [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_bootdirectdisk.495 Log data follows: | DEBUG: Executing python function do_bootdirectdisk | DEBUG: Executing python function build_syslinux_cfg | DEBUG: Python function build_syslinux_cfg finished | DEBUG: Python function do_bootdirectdisk finished | ERROR: Function failed: Unable to open [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/core-image-minimal-1.0/syslinux_vm.cfg ERROR: Task [...]/poky/meta/recipes-core/images/core-image-minimal.bb:do_bootdirectdisk ([...]/poky/meta/recipes-core/images/core-image-minimal.bb:do_bootdirectdisk) failed with exit code '1' NOTE: Tasks Summary: Attempted 2337 tasks of which 2336 didn't need to be rerun and 1 failed. NOTE: Writing buildhistory Summary: 1 task failed: [...]/poky/meta/recipes-core/images/core-image-minimal.bb:do_bootdirectdisk Summary: There was 1 WARNING message shown. Summary: There was 1 ERROR message shown, returning a non-zero exit code.
This seems to be a regression caused by http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=efc07c293695c21329442d69fe34411027416188. The issue disappears after reverting the commit.
I can reproduce the issue and confirm that it's caused by commit efc07c293695c21329442d69fe34411027416188 The fix for syslinux failure is quite straightforward. see attached patch. However, I suspect other bootloaders, buildhistory, wic-related and possibly other tasks to expect rootfs directory and files to be present. So, the question is should we revert efc07c293695c21329442d69fe34411027416188 or should we get ready to fix similar issues when they appear?
Created attachment 3369 [details] fix v.1
(In reply to comment #2) > I can reproduce the issue and confirm that it's caused by commit > efc07c293695c21329442d69fe34411027416188 > > The fix for syslinux failure is quite straightforward. see attached patch. > > However, I suspect other bootloaders, buildhistory, wic-related and possibly > other tasks to expect rootfs directory and files to be present. > > So, the question is should we revert > efc07c293695c21329442d69fe34411027416188 or should we get ready to fix > similar issues when they appear? I get the following after applying your fix and running "bitbake -c cleanall core-image-minimal; bitbake core-image-minimal; bitbake core-image-minimal": ERROR: core-image-minimal-1.0-r0 do_image_complete: Function failed: buildhistory_get_imageinfo (log file is located at [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_complete.28557) ERROR: Logfile of failure stored in: [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_complete.28557 Log data follows: | DEBUG: Executing python function do_image_complete | NOTE: Executing write_deploy_manifest ... | DEBUG: Executing python function write_deploy_manifest | DEBUG: Python function write_deploy_manifest finished | NOTE: Executing buildhistory_get_imageinfo ... | DEBUG: Executing shell function buildhistory_get_imageinfo | [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/run.buildhistory_get_imageinfo.28557: line 171: cd: [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/rootfs: No such file or directory | WARNING: [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/run.buildhistory_get_imageinfo.28557:1 exit 1 from '[ "$3" = "fakeroot" ]' | DEBUG: Python function do_image_complete finished | ERROR: Function failed: buildhistory_get_imageinfo (log file is located at [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_complete.28557) ERROR: Task [...]/poky/meta/recipes-core/images/core-image-minimal.bb:do_image_complete ([...]/poky/meta/recipes-core/images/core-image-minimal.bb:do_image_complete) failed with exit code '1'
yep, this is exactly what I was talking about. buildhistory expects roots directory and files to exist.
Firstly, functions should be creating directories they write too, they shouldn't assume something else did it for them. Rather that os.makedirs, you can use the function [dirs] flag. Secondly, I think that commit being pointed too is missing a *do_image_* which is likely needed after the split of do_rootfs into separate tasks. If we do that, I suspect it would solve a lot of the issues mentioned here?
I think the images shouldn't be rebuilt in the first place as there are no changes on the second run of "bitbake core-image-minimal".
(In reply to comment #7) > I think the images shouldn't be rebuilt in the first place as there are no > changes on the second run of "bitbake core-image-minimal". A closer looks shows that rm_work.bbclass is removing the stamps for the following tasks: * do_bootimg (image-live.bbclass) * do_bootdirectdisk (image-vm.bbclass) * do_vmimg (image-vm.bbclass) The stamps being removed causes the tasks to always execute even when there are no changes to the image when rm_work is enabled. A quick workaround would be to exclude those from do_rm_work() in rm_work.bbclass just like we do for do_image. A better solution would be if we can refactor image-live.bbclass and image-vm.bbclass to use IMAGE_CMD and avoid manually adding tasks (e.g. http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/classes/sdcard_image-rpi.bbclass).
first fix has been merged to master: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=f019bb933f8016d33937d755887700f9a446408e
> A quick workaround would be to exclude those from do_rm_work() in > rm_work.bbclass just like we do for do_image. A better solution would be if > we can refactor image-live.bbclass and image-vm.bbclass to use IMAGE_CMD and > avoid manually adding tasks (e.g. > http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/classes/ > sdcard_image-rpi.bbclass). Thank you for the investigation! I'm for a quick fix for now. Feel free to create new bugs if you want refactoring work to be done.
Quick fix has been sent for review: http://lists.openembedded.org/pipermail/openembedded-core/2016-August/125456.html
the fix has been merged to poky master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=1a620968b1775f5fde27fa513ba7ef0eed501785