Hi Paul,

thanks a lot for the clarification. Now I know much better what to expect. The pulling from the repository seems to work fine after I set the

SRCREV = "${AUTOREV}" variable.

That seems to have been the mistake causing most of the confusion.

If I encounter unexpected behavior with the locally kept repositories, I will come back to the mailing list (maybe it was just my confusion about all the revision juggling which let me believe, that building an EXTERNAL_SRC repo also does not work as expected).

All the Best and Thanks again,
Jakob

On 04.04.2018 06:13, Paul Eggleton wrote:
Hi Jakob,

On Thursday, 29 March 2018 12:41:33 AM NZST Jakob Hasse wrote:
Right now it's still a mystery for me when bitbake builds the latest
version of a repository and why. I make changes in my code and whether I
commit them or not, sometimes bitbake builds a package with the recent
version, sometimes with an old version.
So my strategy is doing mock changes (adding whitespaces, "enhencing"
documentation) and adding signed commits as well as forcing a PR in the
recipe and re-running bitbake until it works somehow (I heard the
bitbake prefers the signed commits somehow could not verify this yet).

Hence, I would like to know what I have to do to build only the latest
version of a repository...
1. When it's local on my computer (with EXTERNALSRC_BUILD_pn-<package> =
"/home/some/local/location/" in local.conf),
If you are using the externalsrc class (specifically with EXTERNALSRC set,
since EXTERNALSRC_BUILD only controls where the build is actually run) then
you should find that any change to files within the source tree should trigger
do_compile to rerun next time you build the recipe. If that does not happen
then that's a bug which we should explore further.

2. When I build from a github or any remote repository.
In this case you need to be pulling the latest revision:

SRCREV = "${AUTOREV}"

If you need to specify a branch other than master, use ;branch=branchname in
SRC_URI.

In order to force it to rebuild the latest version every time however, you
will likely also need something like this:

PV = "1.0+git${SRCPV}"

The "1.0" bit can be anything you like - usually it would be whatever the
latest release version was prior to the commit. A couple of further notes:

1) The result of the above will be that every time you run a build, even if
the recipe in question is not being built, bitbake will need to query the
remote repository in order to determine the latest available version.

2) If you want to ensure that PV never appears to go backwards (which is
important if you are using package management to perform upgrades within the
target image) then you will need to enable the PR server - see the manual for
information on how to do this.

Cheers,
Paul

--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to