Bug 9351 - Issues using bitbake with externalsrc and git
Summary: Issues using bitbake with externalsrc and git
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.2 M3
Assignee: Markus Lehtonen
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-03-29 13:49 UTC by Cliff Brake
Modified: 2016-08-22 08:59 UTC (History)
3 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 Cliff Brake 2016-03-29 13:49:47 UTC
Hi,

We would like to use bitbake with externalsrc recipes such that we can:

* specify nobranch=1 in SRC_URI
* SRCREV = "${AUTOREV}"
* SRCPV = HEAD of externalsrc workspace

Currently, SRCPV = git revision of the branch (default is master) which may or may not match what is actually built in the externalsrc directory.  An additional issue is that you might change the git version to a different tag, and bitbake won't rebuild the recipe unless the git version of the branch specified changes.

See this email thread for discussion: http://thread.gmane.org/gmane.comp.handhelds.openembedded.core/78333

Thanks,
Cliff
Comment 1 Markus Lehtonen 2016-05-18 09:29:45 UTC
First, it seems that there's a slight misunderstanding regarding externalsrc. In your case, "inherit externalsrc" actually has no effect at all. The externalsrc bbclass is supposed to be used in conjunction with defining EXTERNALSRC variable which is supposed to points to source tree. Externalsrc is meant (AFAIU) for building a recipe with user-specific modified local source tree, e.g. for quicker development/hacking. It is a bit hackish, e.g. it involves disabling build tasks, mangling SRC_URI etc and I wouldn't probably use it for production. At least that's how externalsrc is currently designed to work. Thus, you could drop this inherit statement altogether.

But, then, to the actual and real problem which you see. How I see it, you should be able to just do what you tried, i.e. something like (from your example):
SRCREV = "${AUTOREV}"
PV = "1.4+gitr${SRCPV}"
PR = "r1"
SRC_URI = "git://${FILE_DIRNAME};protocol=file;branch=HEAD;nobranch=1"


I'll send a patch to make this possible. Let's see what the response will be.
Comment 2 Markus Lehtonen 2016-05-18 10:18:23 UTC
Patch sent for review:
http://lists.openembedded.org/pipermail/bitbake-devel/2016-May/007475.html
Comment 3 Markus Lehtonen 2016-08-03 14:07:48 UTC
Re-based and re-sent:
https://patchwork.openembedded.org/patch/128407/
Comment 4 Markus Lehtonen 2016-08-19 06:00:36 UTC
A different solution under review:
https://patchwork.openembedded.org/series/1763/
Comment 5 Markus Lehtonen 2016-08-22 08:59:52 UTC
Fixed in bitbake master:
http://git.openembedded.org/bitbake/commit/?id=2673fac5a9d06de937101e3fb2ddf1e60ff99abf

Use the new 'usehead=1' url parameter in order to build HEAD.