<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12986</bug_id>
          
          <creation_ts>2018-11-07 11:01:35 +0000</creation_ts>
          <short_desc>Failed to expand SRCPV on updateding SRC_URI using pn overrides and BBCLASSEXTEND</short_desc>
          <delta_ts>2021-08-04 13:26:38 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.4 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Frederik Noe-Sdun">frederik.sdun</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>kergoth</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82045</commentid>
    <comment_count>0</comment_count>
    <who name="Frederik Noe-Sdun">frederik.sdun</who>
    <bug_when>2018-11-07 11:01:35 +0000</bug_when>
    <thetext>If I try to modify SRC_URI using pn overrides for recipes using BBCLASSEXTEND modified entries are duplicated. If the recipe uses SRCPV bitbake expects  SRCREV_FORMAT to be set:


ERROR: ExpansionError during parsing /home/frederik/src/git/poky/meta/recipes-devtools/mmc/mmc-utils_git.bb
Traceback (most recent call last):
  File &quot;/home/frederik/src/git/poky/bitbake/lib/bb/data_smart.py&quot;, line 808, in DataSmart.getVarFlag(var=&apos;PV&apos;, flag=&apos;_content&apos;, expand=True, noweakdefault=False, parsing=False, retparser=False):
             if expand or retparser:
    &gt;            parser = self.expandWithRefs(value, cachename)
             if expand:
  File &quot;/home/frederik/src/git/poky/bitbake/lib/bb/data_smart.py&quot;, line 416, in DataSmart.expandWithRefs(s=&apos;0.1${SRCPV}&apos;, varname=&apos;PV&apos;):
                 try:
    &gt;                s = __expand_var_regexp__.sub(varparse.var_sub, s)
                     try:
  File &quot;/home/frederik/src/git/poky/bitbake/lib/bb/data_smart.py&quot;, line 108, in VariableParse.var_sub(match=&lt;_sre.SRE_Match object; span=(3, 11), match=&apos;${SRCPV}&apos;&gt;):
                         raise Exception(&quot;variable %s references itself!&quot; % self.varname)
    &gt;            var = self.d.getVarFlag(key, &quot;_content&quot;)
                 self.references.add(key)
  File &quot;/home/frederik/src/git/poky/bitbake/lib/bb/data_smart.py&quot;, line 808, in DataSmart.getVarFlag(var=&apos;SRCPV&apos;, flag=&apos;_content&apos;, expand=True, noweakdefault=False, parsing=False, retparser=False):
             if expand or retparser:
    &gt;            parser = self.expandWithRefs(value, cachename)
             if expand:
  File &quot;/home/frederik/src/git/poky/bitbake/lib/bb/data_smart.py&quot;, line 430, in DataSmart.expandWithRefs(s=&apos;${@bb.fetch2.get_srcrev(d)}&apos;, varname=&apos;SRCPV&apos;):
                 except Exception as exc:
    &gt;                raise ExpansionError(varname, s, exc) from exc
     
bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: The SRCREV_FORMAT variable must be set when multiple SCMs are used.


Steps to reproduce:

echo &apos;BBCLASSEXTEND += &quot;native&quot;                                                                                                                               
PV_append = &quot;${SRCPV}&quot;&apos; &gt;&gt; meta/recipes-devtools/mmc/mmc-utils_git.bb
. ./oe-init-build-env
echo &apos;SRCBRANCH_pn-mmc-utils = &quot;foobar&quot;&apos; &gt;&gt; conf/local.conf
bitbake -c fetch mmc-utils</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91101</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-08-04 13:26:38 +0000</bug_when>
    <thetext>I tried to reproduce this using the steps you detail and couldn&apos;t. You mentioned changing SRC_URI but your steps don&apos;t include that. The SRCREV_FORMAT error suggests there were two git:// urls in SRC_URI which this bug doesn&apos;t show.

I&apos;m going to close this as unable to reproduce, if you can provide reproduction steps please reopen.

For reference these issues are normally due to referencing S/WORKDIR in SRC_URI. If we need to know SRCREV to know PV to determine S/WORKDIR then that would cause a circular error.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>