[yocto] Preventing a variable from being cached

Paul Knopf pauldotknopf at gmail.com
Mon Dec 4 14:15:56 PST 2017


I have a variable that has a dynamic value that is set from python.

-----------------------
def get_git_position(d):
    import bb.process
    (output, error) = bb.process.run("git rev-parse --abbrev-ref HEAD")
    result = output.rstrip()
    (output, error) = bb.process.run("git rev-parse HEAD")
    result += "-"
    result += output.rstrip()
    return result
BUILD_GIT_POSITION := "${@get_git_position(d)}"
-----------------------

I have a task that I wont the checksum to change when "BUILD_GIT_POSITION"
changes.

-----------------------
do_compile() {
    gitversion "${LAYERROOT}" > ${S}/version.json
}

do_compile[vardeps] += "BUILD_GIT_POSITION"
-----------------------

What I am trying to do is trigger a recipe to rebuild if the git commit has
changed or we changed to a different branch.

However, this is not working. It seems that "BUILD_GIT_POSITION" is getting
cached with a checksum.

How do I prevent BUILD_GIT_POSITION from being cached, forcing the checksum
"do_compile" to be recomputed?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20171204/3b0d2f33/attachment.html>


More information about the yocto mailing list