[oe] SRCREV error

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Fri Oct 22 11:14:28 UTC 2010


2010/10/22 Frans Meulenbroeks <fransmeulenbroeks at gmail.com>:
> Not sure if this is an OE or bitbake error, so sending to both.
>
> Triggered by the empty string discussion, I played a little bit with -e.

As asked by Martin on irc: this was with -e and -b

Also he told me SRCREV = "1" comes from conf/bitbake.conf
We might add a check for this value and not generate the ERROR.

Frans
>
> Target recipe was aircrack/aircrack_2.1.bb which reads:
>
> SECTION = "console/network"
> DESCRIPTION = "Aircrack is a set of tools for wep key statistical cracking"
> HOMEPAGE = "http://www.cr0.net:8040/code/network/aircrack/"
> LICENSE = "GPLv2"
> DEPENDS = ""
> PV="2.1"
> PR ="r0"
>
> SRC_URI = "http://archive.aircrack-ng.org/aircrack-old/${P}.tgz \
> file://silent_patch.diff;striplevel=0"
>
> SRC_URI[md5sum] = "694c6180f620b0534e5925a71b960bd1"
> SRC_URI[sha256sum] =
> "9b749d98278450b80153c1f82b7e253548a3f03603062dc98cc1320803d791da"
>
> inherit autotools
>
> do_install() {
>        install -d ${D}/${sbindir}
>        install -d ${D}/${libdir}/${PN}
>        install -m 0755 802ether          ${D}/${sbindir}
>        install -m 0755 airodump          ${D}/${sbindir}
>        install -m 0755 aircrack          ${D}/${sbindir}
>        install -m 0755 aireplay          ${D}/${sbindir}
>        install -m 0755 hopper.sh          ${D}/${sbindir}
> }
>
> if I run bitbake -e on this recipe I get:
>
> ERROR: SRCREV was used yet no valid SCM was found in SRC_URI
> ERROR: SRCREV was used yet no valid SCM was found in SRC_URI
> ERROR: SRCREV was used yet no valid SCM was found in SRC_URI
> NOTE: <class 'bb.fetch.ParameterError'>: while evaluating:
> ${@bb.fetch.get_srcrev(d)}
> ERROR: SRCREV was used yet no valid SCM was found in SRC_URI
> NOTE: <class 'bb.fetch.ParameterError'>: while evaluating:
> ${@bb.fetch.get_srcrev(d)}
> NOTE: <class 'bb.fetch.ParameterError'>: while evaluating:
> ${SRCPV}
> # =/home/frans/workspace/bitbake-1.10.0/bin/bitbake
> ="/home/frans/workspace/bitbake-1.10.0/bin/bitbake"
> ...
> # SRCREV=1
> SRCREV="1"
> ...
>                if "minrev" in parm:
>                        srcrev = bb.data.getVar('SRCREV', d, 1)
>                        if srcrev and srcrev < parm["minrev"]:
>                                bb.note("Patch '%s' applies to later
> revisions" % pname)
>                                continue
>
>                if "maxrev" in parm:
>                        srcrev = bb.data.getVar('SRCREV', d, 1)
>                        if srcrev and srcrev > parm["maxrev"]:
>                                bb.note("Patch '%s' applies to earlier
> revisions" % pname)
>                                continue
> ...
>
> I feel the ERROR message is not too appropriate, and I am not sure
> where it comes from.
>
> No one is defining it:
>
> frans at frans-desktop:~/workspace/openembedded/recipes$ grep aircrack ../conf -r
> ../conf/distro/include/insane-srcrevs.inc:SRCREV_pn-aircrack-ng ?= "${AUTOREV}"
>
> (note that that definition is for aircrack-ng, not aircrack_2.1 which
> I am building)
>
> And classes do not generate the code either as far as I can see:
>
> frans at frans-desktop:~/workspace/openembedded/recipes$ grep aircrack
> ../classes -r
> frans at frans-desktop:~/workspace/openembedded/recipes$ grep SRCREV ../classes -r
> ../classes/patch.bbclass:                       srcrev = bb.data.getVar('SRCREV', d, 1)
> ../classes/patch.bbclass:                       srcrev = bb.data.getVar('SRCREV', d, 1)
> ../classes/gitpkgv.bbclass:# NN equals the total number of revs up to SRCREV
> ../classes/gitpkgv.bbclass:# GITHASH is SRCREV's (full) hash
> ../classes/gitpkgv.bbclass:# SRCREV. So ${GITPKGV} should never be
> used in PV, only in PKGV.
> ../classes/gitpkgv.bbclass:# It can handle SRCREV = ${AUTOREV}, as
> well as SRCREV = "<some fixed git hash>"
> ../classes/opie.bbclass:OPIE_SRCREV ?=
> "8c3beef263bc9c34443eacfc821e99813e17554f"
> ../classes/opie.bbclass:OPIE_GIT_PV ?= "1.2.4+gitr${OPIE_SRCREV}"
> ../classes/lockdown.bbclass:    if "SRCREV" in bb.data.getVar("PV", d, False):
> ../classes/lockdown.bbclass:            print >> src_revs, 'SRCREV_pn-%(pn)s ?=
> "%(rev)s"' % { 'pn' : pn, 'rev' : bb.data.getVar("SRCREV", d, True) }
>
> The assingment is not from lib but I cannot find it in the bitbake dir
> either (but maybe I am overlooking things there, I'm by no means a
> python wiz).
>
> frans at frans-desktop:~/workspace/openembedded/recipes$ grep SRCREV ../lib -r
> frans at frans-desktop:~/workspace/openembedded/recipes$ grep SRCREV
> ../../bitbake -r
> Binary file ../../bitbake/.git/objects/pack/pack-5ce6751d5a9a9ce8cd2fa963c5316fccd15eab89.pack
> matches
> ../../bitbake/ChangeLog:        - Add SRCREV support for svn fetcher
> ../../bitbake/ChangeLog:        - Add BB_SRCREV_POLICY variable (clear or
> cache) to control SRCREV cache
> ../../bitbake/ChangeLog:        - Add SRCREV_FORMAT support
> ../../bitbake/ChangeLog:        - SRCREV handling updates, improvements and
> fixes from Poky
> ../../bitbake/ChangeLog:        - Raise an exception if SRCREV == 'INVALID'
> ../../bitbake/ChangeLog:        - When SRCREV autorevisioning for a recipe is
> in use, don't cache the recipe
> Binary file ../../bitbake/lib/bb/fetch/__init__.pyc matches
> ../../bitbake/lib/bb/fetch/svn.py:            # Should warn people to
> switch to SRCREV here
> ../../bitbake/lib/bb/fetch/git.py:        if
> bb.data.getVar("BB_GIT_CLONE_FOR_SRCREV", d, True):
> Binary file ../../bitbake/lib/bb/fetch/git.pyc matches
> ../../bitbake/lib/bb/fetch/__init__.py:class InvalidSRCREV(Exception):
> ../../bitbake/lib/bb/fetch/__init__.py:    """Exception raised when an
> invalid SRCREV is encountered"""
> ../../bitbake/lib/bb/fetch/__init__.py:    srcrev_policy =
> bb.data.getVar('BB_SRCREV_POLICY', d, 1) or "clear"
> ../../bitbake/lib/bb/fetch/__init__.py:        logger.debug(1,
> "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy)
> ../../bitbake/lib/bb/fetch/__init__.py:        logger.debug(1,
> "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy)
> ../../bitbake/lib/bb/fetch/__init__.py:        raise
> FetchError("Invalid SRCREV cache policy of: %s" % srcrev_policy)
> ../../bitbake/lib/bb/fetch/__init__.py:    In the multi SCM case, we
> build a value based on SRCREV_FORMAT which must
> ../../bitbake/lib/bb/fetch/__init__.py:    # Ugly code alert.
> localpath in the fetchers will try to evaluate SRCREV which
> ../../bitbake/lib/bb/fetch/__init__.py:    # "SRCREVINACTION" return value.
> ../../bitbake/lib/bb/fetch/__init__.py:        return "SRCREVINACTION"
> ../../bitbake/lib/bb/fetch/__init__.py:        logger.error("SRCREV
> was used yet no valid SCM was found in SRC_URI")
> ../../bitbake/lib/bb/fetch/__init__.py:    if
> bb.data.getVar('BB_SRCREV_POLICY', d, True) != "cache":
> ../../bitbake/lib/bb/fetch/__init__.py:    # Mutiple SCMs are in
> SRC_URI so we resort to SRCREV_FORMAT
> ../../bitbake/lib/bb/fetch/__init__.py:    format =
> bb.data.getVar('SRCREV_FORMAT', d, 1)
> ../../bitbake/lib/bb/fetch/__init__.py:        logger.error("The
> SRCREV_FORMAT variable must be set when multiple SCMs are used.")
> ../../bitbake/lib/bb/fetch/__init__.py:                # We have to
> clear data's internal caches since the cached value of SRCREV is now
> wrong.
> ../../bitbake/lib/bb/fetch/__init__.py:        The fetcher supports
> auto source revisions (SRCREV)
> ../../bitbake/lib/bb/fetch/__init__.py:            rev =
> data.getVar("SRCREV_pn-" + pn + "_" + ud.parm['name'], d, 1)
> ../../bitbake/lib/bb/fetch/__init__.py:            rev =
> data.getVar("SRCREV", d, 1)
> ../../bitbake/lib/bb/fetch/__init__.py:            raise
> InvalidSRCREV("Please set SRCREV to a valid value")
> ../../bitbake/lib/bb/fetch/__init__.py:        if rev is "SRCREVINACTION":
> Binary file ../../bitbake/lib/bb/cache.pyc matches
> ../../bitbake/lib/bb/cache.py:            elif 'PV' in
> self.depends_cache[fn] and 'SRCREVINACTION' in
> self.depends_cache[fn]['PV']:
> ../../bitbake/lib/bb/cache.py:                logger.error("Not
> caching %s as it had SRCREVINACTION in PV. Please report this bug",
> fn)
> ../../bitbake/lib/bb/cache.py:        if 'SRCREVINACTION' in pv:
> ../../bitbake/lib/bb/cache.py:            logger.info("Found
> SRCREVINACTION in PV (%s) or %s. Please report this bug.", pv,
> file_name)
>
>
> Kinda lost here, but I would expect bitbake not to generate the SRCREV
> = "1" if there is no SCM in the url (or not barf on it when it has
> generated the SRCREV assignment).
>
> Hope someone with better knowledge than me can solve or explain things
> (or, even better, both! )
>
> Frans
>




More information about the Openembedded-devel mailing list