Re: does git SRC_URI really *require" a SRCREV setting?

Peter Kjellerstedt

We use tags in SRCREV for our own recipes since we have control over them and know that the tags won’t move. If one sets BB_SRCREV_POLICY = "cache", then bitbake will not do `git ls-remote` for the tags more than once. So as long as you have built once you can then build again without network. (Setting BB_SRCREV_POLICY = "cache" currently breaks ${AUTOREV}, but I sent patches for that the other day.)




From: yocto@... <yocto@...> On Behalf Of Martin Jansa
Sent: den 15 februari 2020 18:39
To: Rudolf J Streif <rudolf.streif@...>
Cc: rpjday@...; Yocto discussion list <yocto@...>
Subject: Re: [yocto] does git SRC_URI really *require" a SRCREV setting?


Both recipes should be updated to use SRCREV like any other recipe, I'll send patch for that.


The documentation should also mention that using tag names in SRCREV (or tag parameter) is not recommended, because tags can be moved and bitbake will always use "git ls-remote" to map the tag name to actual git sha, which needs to upstream repo to be available (breaking the builds without access to the network).


On Sat, Feb 15, 2020 at 6:33 PM Rudolf J Streif <rudolf.streif@...> wrote:

The wording might need improvement but both of your examples actually do provide SRC_REV but in the inline form with SRC_URI (rev/tag).

The documentation should probably say something like SRC_REV needs to be provided but it can either be done by setting the variable explicitly or by using the rev/tag option with SRC_URI.


On 2/14/20 10:35 PM, rpjday@... wrote:

  yes, yes, more obsessive-compulsive nitpickery, but YP dev tasks
manual, section 3.3.5, reads:
"Another way of specifying source is from an SCM. For Git
repositories, you must specify SRCREV and you should specify PV to
include the revision with SRCPV."
  you *must* specify SRCREV? i don't think that's true -- a couple
examples from meta-oe ... here's
SRC_URI = "git://;protocol=git;rev=f58dd249d6ed47a7e835463c3b04722972281dbb \
  and here's
SRC_URI = "git://;tag=b2fa7593586b141298e6159f40f521d2b0f4f894 \
  neither of which specify SRCREV (clearly since they don't need to
given the SRC_URI options in use).
p.s. bitbake's fetcher code makes no mention of the "rev"
option in its opening docstring. just an observation if anyone wants
to tweak that.


Rudolf J Streif
CEO/CTO ibeeto
+1.855.442.3386 x700


Join to automatically receive all group messages.