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.)

 

//Peter

 

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.

:rjs

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 hiredis_0.13.1.bb:
 
SRC_URI = "git://github.com/redis/hiredis;protocol=git;rev=f58dd249d6ed47a7e835463c3b04722972281dbb \
 
  and here's sshfs-fuse_2.8.bb:
 
SRC_URI = "git://github.com/libfuse/sshfs;tag=b2fa7593586b141298e6159f40f521d2b0f4f894 \
 
  neither of which specify SRCREV (clearly since they don't need to
given the SRC_URI options in use).
 
rday
 
p.s. bitbake's git.py 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 yocto@lists.yoctoproject.org to automatically receive all group messages.