[yocto] Preventing a variable from being cached
Paul Knopf
pauldotknopf at gmail.com
Thu Dec 7 07:47:40 PST 2017
I take it that this is not possible?
On Mon, Dec 4, 2017 at 5:15 PM, Paul Knopf <pauldotknopf at gmail.com> wrote:
> 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/20171207/a3f87c5c/attachment.html>
More information about the yocto
mailing list