Bug 11593 - bb.fetch2.get_srcrev ExpansionError with ;subdir=${S} SRC_URIs
Summary: bb.fetch2.get_srcrev ExpansionError with ;subdir=${S} SRC_URIs
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: 4.99
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-05-31 05:45 UTC by Mikko Ylinen
Modified: 2021-09-11 21:42 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikko Ylinen 2017-05-31 05:45:26 UTC
When adding ${SRCPV} to PV with SRC_URIs that use "subdir=${S}", bitbake errors with ExpansionError:

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception RuntimeError: maximum recursion depth exceeded
Comment 1 Richard Purdie 2017-06-09 16:58:10 UTC
Adding ;subdir=${S} to psplash_git.bb is enough to reproduce this. The issue is that:

SRC_URI = "${S}"
S = "${WORKDIR}"
WORKDIR = "xxx/${PV}"
PV = "${SRCPV}"
SRCPV = "${@bb.fetch2.get_srcrev(d)}"

and get_srcrev(d) will expand SRC_URI.

So the code is correct, recursion is occurring and there are circular references.
Comment 2 Ben Guan 2017-08-18 01:59:47 UTC
(In reply to comment #1)
> Adding ;subdir=${S} to psplash_git.bb is enough to reproduce this. The issue
> is that:
> 
> SRC_URI = "${S}"
> S = "${WORKDIR}"
> WORKDIR = "xxx/${PV}"
> PV = "${SRCPV}"
> SRCPV = "${@bb.fetch2.get_srcrev(d)}"
> 
> and get_srcrev(d) will expand SRC_URI.
> 
> So the code is correct, recursion is occurring and there are circular
> references.

It could be reproduced also when using "destsuffix".
Comment 3 Richard Purdie 2021-09-10 14:09:02 UTC
Patches sent to make recursion errors more understandable and detect the fetcher special case variable self references.