Bug 6881 - git fetcher does not support lightweight tags
Summary: git fetcher does not support lightweight tags
Status: VERIFIED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 1.6.1
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 1.8 M2
Assignee: Richard Purdie
QA Contact: Costin
URL:
Whiteboard: TC needed
Depends on:
Blocks:
 
Reported: 2014-10-23 22:31 UTC by Jesse Gilles
Modified: 2015-03-12 10:57 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Gilles 2014-10-23 22:31:29 UTC
Bitbake 1.22 (daisy) does not support using lightweight git tags for SRCREV or in SRC_URI.  Bitbake 1.20 (dora) handled lightweight tags just fine, so this seems to be a regression.

Example below writing a recipe for a ruby-serialport repo on github.com.

Specifying the tag in the SRC_URI used to work, but no longer does:
SRC_URI = "git://github.com/hparra/ruby-serialport.git;protocol=git;tag=v1.1.0"
(SRCREV unset)

Setting it in SRCREV instead also fails:
SRCREV = "v1.1.0"
SRC_URI = "git://github.com/hparra/ruby-serialport.git;protocol=git"

The workaround is to get the SHA hash for the commit the tag references and use that, but it would be nice if this worked again.

# tag v1.1.0
SRCREV = "709e385f6d20aaadc7f3252af59250336d27e607"

Error when using tag name in SRCREV or SRC_URI
----------------------------------------------
ERROR: Function failed: Fetcher failure for URL: 'git://github.com/hparra/ruby-serialport.git;protocol=git;tag=v1.1.0'. The command git ls-remote git://github.com/hparra/ruby-serialport.git refs/heads/v1.1.0 refs/tags/v1.1.0^{} gave empty output unexpectedly
Comment 1 Andrei Gherzan 2014-11-12 13:24:39 UTC
Confirm issue on dizzy branch.
Comment 2 Richard Purdie 2015-01-08 21:03:51 UTC
Patch on the bitbake list.
Comment 4 Jesse Gilles 2015-01-15 15:51:12 UTC
Thanks for the fix -- any chance this could be backported to daisy?
Comment 5 Costin 2015-03-12 10:48:03 UTC
Hello,

Tested on master and it works (poky hash: 0aff27522d467ee5d02289594207ddef4add7081):

Build Configuration:
BB_VERSION        = "1.25.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.10"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.7+snapshot-20150312"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "master:0aff27522d467ee5d02289594207ddef4add7081"

...

cosscat@ubnt:/media/yp_builds/poky$ cat meta/recipes-tests/ruby-serialport/ruby-serialport_1.2.3.bb
DESCRIPTION="just a recipe test"

LICENSE="GPLv3"
SRC_URI = "git://github.com/hparra/ruby-serialport.git;protocol=git;rev=v1.2.3"
#SRCREV = "v1.2.3"
#Tested both ways: with SRCREV variable and without

S = "${WORKDIR}/git"


Marking as verified.

Costin