[bitbake-devel] How to detect change on a repo manifest.git and rebuild the recipe with "repo://"

Andre McCurdy armccurdy at gmail.com
Fri Aug 25 22:11:02 UTC 2017


On Thu, Aug 24, 2017 at 7:06 PM, GUAN Ben (ST-FIR/ENG1-Zhu)
<Ben.Guan at cn.bosch.com> wrote:
> The source code of my SW consist of multiple components from different
> repository, which is managed by a repo manifest repository. So I want to use
>repo://” for the repo manifest repository instead of multiple “git://” to
> include all repositories in the SRC_URI.
>
> I add the following to MyRecipe_git.bb:
> ```
> SRC_URI = “repo://git@<MY_HOST>/manifest.git;protocol=ssh;branch=master”
>
> Now I can build my recipe with Yocto, but there is an issue:  When there is
> any change required in the repositories of my application, I will change the
> code and update the tags in default.xml of manifest.git. I want Yocto could
> detect this change, fetch the change, them rebuild the recipe.
>
> With “git://”, it is easy to achieve via setting “${AUTOREV}” to “SRCREV”.
> But the fetch2.repo doesn’t support SRCREV. I have go through the existing
> recipe within meta-oe and oe-core, no recipe is using “repo://”.
>
> Does anybody have experience about it and help? Thank you in advance.

Right, the repo fetcher doesn't support SRCREV. It's not even clear
how a repo manifest could map to a SRCREV, since the manifest could
define an arbitrary combination of fixed revisions and/or branches for
an arbitrary number of git repos.

You could perhaps append a call to "repo sync" to the do_patch etc
task in your recipe but it would certainly be a hack and you would run
into dependency problems (do_patch might not be re-run and without a
SRCREV bitbake wouldn't know if/when the code had changed and
therefore if/when to re-run dependent tasks).

As you have discovered by looking oe-core and meta-oe, the repo
fetcher isn't used much. The preferred solution for recipes which need
to fetch from multiple git repos is to include multiple git://
references in SRC_URI.



More information about the bitbake-devel mailing list