[bitbake-devel] Bitbaking recipe with patchdir in SRC_URI creates parse error

Cameron Kellough cameron at paloaltoinnovation.com
Wed Feb 6 19:13:09 UTC 2019


Hi bitbake developers,
I'm working in a Rocko based bsp.  I've used the patchdir construct in
SRC_URI to apply patches in the tree where the build is expecting them.
When I set PV="1.0+git${SRCPV}", I get the following error and traceback if
any of the patchdir directives are present in SRC_URI:

ERROR: ExpansionError during parsing
/media/ckelloug/ExtraDrive1/edm_ycoto/sources/meta-doppler/recipes-doppler/doppler/
doppler_git.bb

Traceback (most recent call last):
  File
"/media/ckelloug/ExtraDrive1/edm_ycoto/sources/poky/bitbake/lib/bb/data_smart.py",
line 412, in
DataSmart.expandWithRefs(s='${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}',
varname='WORKDIR'):
                 try:
    >                s = __expand_var_regexp__.sub(varparse.var_sub, s)
                     try:
  File
"/media/ckelloug/ExtraDrive1/edm_ycoto/sources/poky/bitbake/lib/bb/data_smart.py",
line 111, in VariableParse.var_sub(match=<_sre.SRE_Match object; span=(57,
62), match='${PV}'>):
                 else:
    >                var = self.d.getVarFlag(key, "_content")
                 self.references.add(key)
  File
"/media/ckelloug/ExtraDrive1/edm_ycoto/sources/poky/bitbake/lib/bb/data_smart.py",
line 794, in DataSmart.getVarFlag(var='PV', flag='_content', expand=True,
noweakdefault=False, parsing=False):
                     cachename = var + "[" + flag + "]"
    >            value = self.expand(value, cachename)

  File
"/media/ckelloug/ExtraDrive1/edm_ycoto/sources/poky/bitbake/lib/bb/data_smart.py",
line 436, in DataSmart.expand(s='1.0+git${SRCPV}', varname='PV'):
         def expand(self, s, varname = None):
    >        return self.expandWithRefs(s, varname).value

  File
"/media/ckelloug/ExtraDrive1/edm_ycoto/sources/poky/bitbake/lib/bb/data_smart.py",
line 426, in DataSmart.expandWithRefs(s='1.0+git${SRCPV}', varname='PV'):
                 except Exception as exc:
    >                raise ExpansionError(varname, s, exc) from exc

bb.data_smart.ExpansionError: Failure expanding variable PV, expression was
1.0+git${SRCPV} which triggered exception RecursionError: maximum recursion
depth exceeded while calling a Python object



The error can be duplicated by doing bitbake -p doppler on the following
recipe as it occurs at parse time.  I've redacted my username and password
from the recipe and verified I still get the same parse error.


SUMMARY = "doppler"
SECTION = "doppler"
LICENSE = "MIT"
LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "git://github.com/pa-innovation/doppler.git;protocol=https; \
           file://DopplerSettings.json \
           file://AlexaClientSDKConfig.json \
           file://doppler.conf \
           file://dop.sh \

file://0001-Commented-out-check-for-DopplerSettings.json.patch;patchdir=${WORKDIR}/git
\

file://0002-Added-opt-doppler-include-and-link-directories-to-CM.patch;patchdir=${WORKDIR}/git
\

file://0003-Added-opt-doppler-lib-to-all-amazon-find_library-sta.patch;patchdir=${WORKDIR}/git
\

file://0004-Set-find_library_path-path-for-ggk-lib-to-opt-dopple.patch;patchdir=${WORKDIR}/git
\

file://0005-set-path-for-PAI_LOCAL_LIB_INCLUDE_DIR.patch;patchdir=${WORKDIR}/git
\

file://0006-set-THREADS_PTHREAD_ARG-to-avoid-test-compile.patch;patchdir=${WORKDIR}/git
\

file://0007-Changed-Gobbledegook-to-not-have-embedded-relative-p.patch;patchdir=${WORKDIR}/git
\
           file://0001-Changed-sensory-path-to-6.6.0.patch; \
           "

#SRCREV = "e68d0527aa91a9bb1d43a0e38960995c3a53a54f"

SRCREV="${AUTOREV}"

#python() {
#     bb.warn("SRCPV=", d.getVar('SRCPV',True))
#}

PV = "1.0+git${SRCPV}"

#python() {
#     bb.warn("PV=", d.getVar('PV',True))
#}



S = "${WORKDIR}/git/src"
B = "${WORKDIR}/git/build"

SYSROOT_DIRS += "/opt"

DEPENDS = "glibc boost sqlite3 gcc-runtime libgcc libpai glib-2.0
gstreamer1.0 avs-device-sdk sensory alsa-lib ggk"


RDEPENDS_${PN} = " avs-device-sdk networkmanager"

inherit cmake

#EXTRA_OECMAKE = " \
#                  -DCMAKE_SKIP_BUILD_RPATH=TRUE \
#"

EXTRA_OECMAKE = " \
                  -DCMAKE_INSTALL_RPATH=/opt/doppler/lib \
                  -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE \
"

do_install() {

install -d ${D}/opt/doppler/bin
install doppler ${D}/opt/doppler/bin
install logger-conf.conf ${D}/opt/doppler/bin
install bright-logger.conf ${D}/opt/doppler/bin
install scanWifi.sh ${D}/opt/doppler/bin
install connectWifi.sh ${D}/opt/doppler/bin
install disconnectWifi.sh ${D}/opt/doppler/bin
install wifiStatus.sh ${D}/opt/doppler/bin
install spot-alexa-rpi-31000.snsr ${D}/opt/doppler/bin
install ${WORKDIR}/DopplerSettings.json ${D}/opt/doppler/bin
install ${WORKDIR}/AlexaClientSDKConfig.json ${D}/opt/doppler/bin
install ${WORKDIR}/dop.sh ${D}/opt/doppler/bin
install -d ${D}/etc/dbus-1/system.d/
install ${WORKDIR}/doppler.conf ${D}/etc/dbus-1/system.d/doppler.conf
}

FILES_${PN} =  "/opt/doppler/bin"
FILES_${PN} += " /etc/dbus-1/system.d/doppler.conf "
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20190206/c686189d/attachment.html>


More information about the bitbake-devel mailing list