Patchwork [1/1] u-boot: set SRCREV to a git revision instead of a tag reference

login
register
mail settings
Submitter Paul Eggleton
Date June 21, 2011, 5:29 p.m.
Message ID <1046625816b98aaab44b810e2376ed3689a2af5f.1308677220.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/6181/
State Accepted
Headers show

Comments

Paul Eggleton - June 21, 2011, 5:29 p.m.
If we use a tag here then bitbake has to connect to the repository to find
out the corresponding revision (so it can expand SRCPV which is part of PV,
which amongst other things is needed to determine whether or not the
package has to be rebuilt.) This occurs at parse time; on machines behind a
firewall or with no network access this can be a problem.

We wish to avoid unnecessary network accesses and network access in our
default configuration during parse time is even worse. Substituting the
git revision corresponding to the tag prevents bitbake from having to
contact the remote repository in order to expand PV.

Addresses [YOCTO #1186]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/recipes-bsp/uboot/u-boot_2011.03.bb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Joshua Lock - June 21, 2011, 5:33 p.m.
On Tue, 2011-06-21 at 18:29 +0100, Paul Eggleton wrote:
> If we use a tag here then bitbake has to connect to the repository to find
> out the corresponding revision (so it can expand SRCPV which is part of PV,
> which amongst other things is needed to determine whether or not the
> package has to be rebuilt.) This occurs at parse time; on machines behind a
> firewall or with no network access this can be a problem.
> 
> We wish to avoid unnecessary network accesses and network access in our
> default configuration during parse time is even worse. Substituting the
> git revision corresponding to the tag prevents bitbake from having to
> contact the remote repository in order to expand PV.
> 
> Addresses [YOCTO #1186]
> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>

Great work tracking this down! I wonder if it's worth mentioning in the
metadata that the revision corresponds to the tag?

Signed-off-by: Joshua Lock <josh@linux.intel.com>
> ---
>  meta/recipes-bsp/uboot/u-boot_2011.03.bb |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-bsp/uboot/u-boot_2011.03.bb b/meta/recipes-bsp/uboot/u-boot_2011.03.bb
> index 07f0609..25af69b 100644
> --- a/meta/recipes-bsp/uboot/u-boot_2011.03.bb
> +++ b/meta/recipes-bsp/uboot/u-boot_2011.03.bb
> @@ -12,9 +12,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1707d6db1d42237583f50183a5651ecb \
>  
>  FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/u-boot-git/${MACHINE}"
>  
> -SRCREV = "v2011.03"
> +SRCREV = "19b54a701811220221fc4d5089a2bb18892018ca"
>  PV = "v2011.03+git${SRCPV}"
> -PR="r4"
> +PR = "r5"
>  
>  SRC_URI = "git://git.denx.de/u-boot.git;branch=master;protocol=git"
>
Koen Kooi - June 21, 2011, 5:34 p.m.
Op 21 jun 2011, om 19:29 heeft Paul Eggleton het volgende geschreven:

> If we use a tag here then bitbake has to connect to the repository to find
> out the corresponding revision (so it can expand SRCPV which is part of PV,
> which amongst other things is needed to determine whether or not the
> package has to be rebuilt.) This occurs at parse time; on machines behind a
> firewall or with no network access this can be a problem.
> 
> We wish to avoid unnecessary network accesses and network access in our
> default configuration during parse time is even worse. Substituting the
> git revision corresponding to the tag prevents bitbake from having to
> contact the remote repository in order to expand PV.
> 
> Addresses [YOCTO #1186]
> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
> meta/recipes-bsp/uboot/u-boot_2011.03.bb |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-bsp/uboot/u-boot_2011.03.bb b/meta/recipes-bsp/uboot/u-boot_2011.03.bb
> index 07f0609..25af69b 100644
> --- a/meta/recipes-bsp/uboot/u-boot_2011.03.bb
> +++ b/meta/recipes-bsp/uboot/u-boot_2011.03.bb
> @@ -12,9 +12,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1707d6db1d42237583f50183a5651ecb \
> 
> FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/u-boot-git/${MACHINE}"
> 
> -SRCREV = "v2011.03"
> +SRCREV = "19b54a701811220221fc4d5089a2bb18892018ca"
> PV = "v2011.03+git${SRCPV}"
> -PR="r4"
> +PR = "r5"


Can you add a comment above the rev in the lines of "bitbake sucks, we need to use a rev instead of a tag, this one maps to 2011.03"?
Paul Eggleton - June 21, 2011, 5:42 p.m.
On Tuesday 21 June 2011 18:34:54 Koen Kooi wrote:
> Can you add a comment above the rev in the lines of "bitbake sucks, we need
> to use a rev instead of a tag, this one maps to 2011.03"?

I will add a comment about the revision corresponding to the tag, good idea.

However, if you do specify a tag for SRCREV and SRCPV is part of PV, then 
bitbake needs to fetch the revision from the repo in order to determine SRCPV 
so it can expand PV when it comes to figure out if a recipe needs to be rebuilt 
or not (remembering that if SRCREV isn't a full revision, bitbake can't tell 
if what you've specified is a "fixed" tag or a potentially moving branch.

If you've got a better idea on how to handle this I'd love to hear it.

Cheers,
Paul
Paul Eggleton - June 21, 2011, 5:49 p.m.
On Tuesday 21 June 2011 18:33:17 Joshua Lock wrote:
> Great work tracking this down!

Thanks, actually Dexuan gets the credit for at least pointing me in the right 
direction.

> I wonder if it's worth mentioning in the metadata that the revision
> corresponds to the tag?

Done, have updated the contrib branch:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=paule/fix-
uboot-srcrev

Cheers,
Paul
Koen Kooi - June 21, 2011, 5:54 p.m.
Op 21 jun 2011, om 19:42 heeft Paul Eggleton het volgende geschreven:

> On Tuesday 21 June 2011 18:34:54 Koen Kooi wrote:
>> Can you add a comment above the rev in the lines of "bitbake sucks, we need
>> to use a rev instead of a tag, this one maps to 2011.03"?
> 
> I will add a comment about the revision corresponding to the tag, good idea.
> 
> However, if you do specify a tag for SRCREV and SRCPV is part of PV

Since we're using the 2011.03 tag, why is SRCPV in PV at all? It should be exactly the same as the tarball.
Paul Eggleton - June 21, 2011, 5:59 p.m.
On Tuesday 21 June 2011 18:54:12 Koen Kooi wrote:
> Since we're using the 2011.03 tag, why is SRCPV in PV at all? It should be
> exactly the same as the tarball.

One might go one step further and ask why fetching from git is a good idea 
when the tarball would be much cleaner. Ultimately this is up to whoever 
maintains the u-boot recipe.

Cheers,
Paul
Tom Rini - June 21, 2011, 6:06 p.m.
On 06/21/2011 10:59 AM, Paul Eggleton wrote:
> On Tuesday 21 June 2011 18:54:12 Koen Kooi wrote:
>> Since we're using the 2011.03 tag, why is SRCPV in PV at all? It should be
>> exactly the same as the tarball.
> 
> One might go one step further and ask why fetching from git is a good idea 
> when the tarball would be much cleaner. Ultimately this is up to whoever 
> maintains the u-boot recipe.

Especially with the current git archive mirroring problem.

Patch

diff --git a/meta/recipes-bsp/uboot/u-boot_2011.03.bb b/meta/recipes-bsp/uboot/u-boot_2011.03.bb
index 07f0609..25af69b 100644
--- a/meta/recipes-bsp/uboot/u-boot_2011.03.bb
+++ b/meta/recipes-bsp/uboot/u-boot_2011.03.bb
@@ -12,9 +12,9 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=1707d6db1d42237583f50183a5651ecb \
 
 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/u-boot-git/${MACHINE}"
 
-SRCREV = "v2011.03"
+SRCREV = "19b54a701811220221fc4d5089a2bb18892018ca"
 PV = "v2011.03+git${SRCPV}"
-PR="r4"
+PR = "r5"
 
 SRC_URI = "git://git.denx.de/u-boot.git;branch=master;protocol=git"