Bug 13167 - build failure when SRC_URI has usehead param in multiple git repo
Summary: build failure when SRC_URI has usehead param in multiple git repo
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: 3.4
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-02-04 13:54 UTC by jean-christophe.gillet
Modified: 2021-04-19 11:28 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
patch file for rocko-18.0.3 (1.71 KB, patch)
2019-02-04 13:54 UTC, jean-christophe.gillet
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jean-christophe.gillet 2019-02-04 13:54:27 UTC
Created attachment 4429 [details]
patch file for rocko-18.0.3

usehead works fine with a single git repo and without name parameter.
In case of multiple git repos, name option is used in SRC_URI and error is
raised. For instance when you have a recipe like that,

PV = "1.0+git${SRCPV}"

SRCREV_FORMAT = "fooa_foob"

SRCREV_fooa = "${AUTOREV}"
SRCREV_foob = "${AUTOREV}"

SRC_URI = "\
  git:///fooa_dir/;protocol=file;usehead=1;name=fooa;destsuffix=git/fooa \
  git:///foob_dir/;protocol=file;usehead=1;name=foob;destsuffix=git/foob \
"

build fail with error message

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression
was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError:
Fetcher failure: Unable to resolve 'master' in upstream git repository
in git ls-remote output for //fooa_dir/

because fetch operation is applied to wrong git reference, not 'HEAD'

It is related to dictionary ud.unresolvedrev that is always using 'default' key instead of ud.name[0] when ud.usehead==1.

I attach a patch file but I don't really know how to proceed. Do I really have to mail a patch to bitbake mailing list in this case. Only one line modified in one file. I found this bug in rocko version but it looks like it exists in later versions
Comment 1 Richard Purdie 2021-04-19 11:28:40 UTC
I believe this was fixed with http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=10c69538c0cb8708c7eff9e8dc05ca7c669cb61c