[OE-core] How to use externalsrc with git workspace

Richard Purdie richard.purdie at linuxfoundation.org
Sat Mar 26 07:41:09 UTC 2016


On Fri, 2016-03-25 at 16:18 -0400, Cliff Brake wrote:
> Hi,
> 
> In the past (say Dora era), I've used externalsrc like:
> 
> ====================
> DESCRIPTION = "MyApp"
> LICENSE = "CLOSED"
> 
> inherit externalsrc
> 
> SRCREV = "${AUTOREV}"
> PV = "1.4+gitr${SRCPV}"
> PR = "r1"
> 
> SRC_URI = "git://${FILE_DIRNAME};protocol=file;branch=HEAD"
> S = "${FILE_DIRNAME}"
> 
> ...
> ====================
> 
> This was very nice in that it set SRCPV to to the git version of the
> HEAD of my
> local workspace.  When building from a local git workspace, this
> makes sense to
> me -- I want the Git version of the workspace, not a remote version.
> 
> Now with Jethro, I get errors like:
> 
> ERROR: ExpansionError during parsing myapp.bb: Failure expanding
> variable SRCPV,
> expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception
> FetchError:
> Fetcher failure: Unable to resolve 'HEAD' in upstream git repository
> in git
> ls-remote output for /scratch/externalsrc/MyApp
> 
> Do you have any suggestions how to use externalsrc + a local git
> workspace and
> avoid the above error.  I can set branch=master, etc and bitbake will
> then parse
> it, but the remote master version is not really what I'm building.

HEAD is a revision, not a branch and the fetcher became a bit more
picky about that difference. Your local tree must have HEAD on some
branch which would usually be master so setting branch=master is likely
correct, or don't set that parameter at all? master isn't just a remote
thing.

The piece which says "use the HEAD revision" is the SRCREV =
"${AUTOREV}" line.

Cheers,

Richard






More information about the Openembedded-core mailing list