[yocto] Task vardeps on a variable changed externally

Richard Purdie richard.purdie at linuxfoundation.org
Wed Oct 9 07:44:17 PDT 2019


On Wed, 2019-10-09 at 10:42 +0100, Andrei Gherzan wrote:
> I struggle to figure out an issue that I lately got into. I want to
> have a recipe which writes a manifest of all the layers part of the
> build. 
> These layers are all git repositories and I want their revision to
> be exposed at runtime. So I obviously have a a python function which 
> computes let's say, for the sake of example, a revision of one layer.
> 
> def get_rev(d):
>      # returns revision of a repository
> 
> LAYER_REVISION := "${get_rev(d)}"
> 
> The recipe also has a `do_compile` variable dependency:
> do_compile[vardeps] += "LAYER_REVISION"
> 
> Checking the task signature I see the inclusion of the expanded
> variable 
> LAYER_REVISION.
> 
> Now, if I externally change the revision of that respective layer
> the 
> task is not re-triggered even so the recipe environment reports the 
> updated variable (bitbake -e). What is even more confusing is that
> if 
> for whatever reason the do_compile task gets invalidated (or I force 
> it), the build system returns a "basehash value changed" error.
> 
> I would expect that the change of revision to trickle a task 
> invalidation and the task to be rerun but that doesn't seem to happen
> as described above.

The hashes are generated at parse time. The key question is how does
bitbake know when to reparse this recipe?

You'd need to make the recipe always reparse so it can rerun that
function.

I think BB_DONT_CACHE = "1" may do that.

Cheers,

Richard



More information about the yocto mailing list