cowboydan
cowboydan

Reputation: 1102

bitbake do_image dependency not cached

I have a task do_image_custom that has a dependency on task do_image_ext4.

That task (do_image_ext4) generates an image file containing DATETIME.

The first time I build my image, no errors. dependency_DATETIME.rootfs.ext4 is generated and used by its dependents.

If I make a change to the consuming task of the ext4 file, because I need to stipulate the dependency on DATETIME.rootfs.ext4.

After I build a second time (without cleaning), I get the error that do_image_custom cannot find newer_datetime.rootfs.ext4

I check the IMGDEPLOYDIR and sure enough, that file doesn't exist and the do_image_ext4 task still has the first timestamp.

My question is, what am I doing wrong here in do_image_custom such that it re-evaluates DATETIME every time it is run without checking with (perhaps) the sstate cache?

Upvotes: 0

Views: 663

Answers (1)

cowboydan
cowboydan

Reputation: 1102

The problem was that my custom task (do_image_custom) depended on the output of a prior task. That task output generates an ext4 image with a timestamp in the name.

do_image_custom re-evaluated the DATETIME, even though the dependency (the ext4 file with an earlier DATETIME did not, and therefore was not rebuilt. Hence when do_image_custom executed, it referenced a file that did not exist (the error) because it was not generated (correctly so, because the basehash for the dependency task was unchanged).

The solution was (in front of me all along) to modify my custom task (do_image_custom) to refer to a symlink (also generated in the same step as the ext4) which does not have a DATETIME in the symlink name, hence making do_image_custom invariant to any or no changes to it's dependent step.

Upvotes: 1

Related Questions