Bug 7024

Summary: Need dependencies from tasks on postprocessing variables
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: coreAssignee: Magnus Olsson <magnus>
Status: RESOLVED DUPLICATE QA Contact:
Severity: minor    
Priority: Medium CC: magnus, meta.mr.watcher, meta.watcher, richard.purdie
Version: 1.6   
Target Milestone: 1.8   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Paul Eggleton 2014-12-03 14:57:09 UTC
Since we did the rewrite of our image and SDK generation in python, we have lost the variable dependencies between some of the variables that feed into these functions and the functions themselves, which means that changing the value of one of those variables doesn't cause the task to re-execute. We should add explicit vardeps on these to fix this.

For do_rootfs we need to add vardeps on:

IMAGE_PREPROCESS_COMMAND
IMAGE_POSTPROCESS_COMMAND
ROOTFS_PREPROCESS_COMMAND
ROOTFS_POSTINSTALL_COMMAND
ROOTFS_POSTPROCESS_COMMAND
OPKG_PREPROCESS_COMMANDS
OPKG_POSTPROCESS_COMMANDS
RPM_POSTPROCESS_COMMANDS
RPM_PREPROCESS_COMMANDS
DEB_POSTPROCESS_COMMANDS
DEB_PREPROCESS_COMMANDS

(the latter two aren't actually implemented at the moment, but we might as well add them at the same time)

For do_populate_sdk we need to add vardeps on:

SDK_POSTPROCESS_COMMAND
POPULATE_SDK_POST_TARGET_COMMAND
POPULATE_SDK_POST_HOST_COMMAND
Comment 1 Richard Purdie 2014-12-03 15:05:51 UTC
If you look at _depends_list() in lib/oe/rootfs.py, you'll see that at least some of these do have dependencies. We therefore need to figure out which ones are missing.
Comment 2 Paul Eggleton 2014-12-03 15:11:24 UTC
Right, I'd completely missed that, and most of the variables I've listed (if not all, I haven't gone through and checked every one) seem to be covered by that mechanism, which suggests it may not be working according to the reports I have received.
Comment 3 Magnus Olsson 2014-12-03 15:37:24 UTC
I've encountered issues where changes to IMAGE_PREPROCESS_COMMAND-functions does not trigger a rebuild.

IMAGE_PREPROCESS_COMMAND += "test; "

test() {
    install -m 0755 ${DEPLOY_DIR_IMAGE}/${DTB_FILENAME} ${IMAGE_ROOTFS}
}

If test() is changed, Bitbake does not re-trigger build unless I explicitly taint the sstate-cache (-f).
Comment 4 Paul Eggleton 2015-01-23 10:42:09 UTC
After some digging, I can confirm that we do have code not only to add these variables (all of them) as dependencies of do_rootfs but also we get the functions as dependencies for the variables, so I think we do have the mechanism already as Richard pointed out.

Magnus, I've tried the exact example you gave on both master and dizzy and haven't been able to reproduce the issue - changing the contents of the function causes do_rootfs to re-execute the next time I build the image. Is there something else going on in your setup that I'm not replicating?
Comment 5 Magnus Olsson 2015-01-27 10:48:51 UTC
I've been unable to reproduce this on Dizzy, it seems to an issue on Daisy only.

Fixed in oe-core b8b6214b885a0757f0e628937f8fe21c92c45155 by [YOCTO #6502].

*** This bug has been marked as a duplicate of bug 6502 ***