<div dir="ltr">In order to support a use-case that embeds information about the Git revision of Yocto itself that was used to make a build, I would like to run some arbitrary Python code and dump the results (Git SHA1's, tag names, etc) into a Bitbake variable.<div><br></div><div>The idea is that the variable would get consumed in a do_install() task to populate some cookie-crumb file in the package payload.</div><div><br></div><div>Something like:</div><div><br></div><div>  DEPENDS = "git-native"</div><div><br></div><div>  python () {</div><div>  Â  # This pseudocode isn't strictly functional for invoking Git, but you get the idea</div><div>  Â  d.setVar('GIT_INFO', subprocess.Popen(['git', 'rev-list', ...]).communicate().stdout)</div><div>  }</div><div><br></div><div>  do_install () {</div><div>  Â  install -d ${D}/etc</div><div>  Â  echo "${GIT_INFO}" > ${D}/etc/git-info.txt</div><div>  }</div><div><br></div><div>This all works on a fresh run, but Bitbake appears not to be evaluating the anonymous Python function on each execution. This leads it to have out-of-date information about the Git working copy when global state changes but happens not to impact the particular recipe holding this logic.</div><div><br></div><div>Is there any trick available to cause the Python function to execute (and hence update the value of ${GIT_INFO} each Bitbake execution so that the up-to-the-moment contents of it filter into the calculation of the signature for do_install()? Or am I just trying a wrong-headed approach and doing something illegitimate?</div><div><br></div><div>-Matt</div></div>