<?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>13711</bug_id>
          
          <creation_ts>2019-12-16 22:47:24 +0000</creation_ts>
          <short_desc>Parsing fails on externalsrc recipe containing both git and file in SRC_URI</short_desc>
          <delta_ts>2021-09-14 13:28:48 +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>3.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>with backport</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.4 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Richardson">jon.richardson</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>akuster</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>85841</commentid>
    <comment_count>0</comment_count>
      <attachid>4603</attachid>
    <who name="Jonathan Richardson">jon.richardson</who>
    <bug_when>2019-12-16 22:47:24 +0000</bug_when>
    <thetext>Created attachment 4603
example recipe

When I devtool a recipe that has both git:// and file:// in SRC_URI, SRCREV=AUTOREV, then try to build it, I get a parse error on the recipe:

WARNING: /home/jon/work/yocto/nxs/poky/build/../meta-brcm/meta-datacenter/recipes-core/spdk/brcm-spdk.bb: Exception during build_dependencies for AUTOREV
WARNING: /home/jon/work/yocto/nxs/poky/build/../meta-brcm/meta-datacenter/recipes-core/spdk/brcm-spdk.bb: Error during finalise of /home/jon/work/yocto/nxs/poky/build/../meta-brcm/meta-datacenter/recipes-core/spdk/brcm-spdk.bb
ERROR: ExpansionError during parsing /home/jon/work/yocto/nxs/poky/build/../meta-brcm/meta-datacenter/recipes-core/spdk/brcm-spdk.bb:05:06
Traceback (most recent call last):
  File &quot;Var &lt;SRCPV&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/home/jon/work/yocto/nxs/poky/bitbake/lib/bb/fetch2/__init__.py&quot;, line 752, in get_srcrev(d=&lt;bb.data_smart.DataSmart object at 0x7fb142e91dd8&gt;, method_name=&apos;sortable_revision&apos;):
         if len(scms) == 0:
    &gt;        raise FetchError(&quot;SRCREV was used yet no valid SCM was found in SRC_URI&quot;)

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: SRCREV was used yet no valid SCM was found in SRC_URI

If I comment out the file:// then it works fine.

I bisected poky and came to:
commit d427f58977a46f2bda4b7f30cf83793373e401d3 (refs/bisect/bad)
Author: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Date:   Sat Nov 2 17:57:10 2019 +0000

    bitbake: fetch2: Ensure cached url data is matched to a datastore
    
    There was a weird error in OE-Core where &quot;devtool modify virtual/kernel&quot;
    was showing basehash mismatch errors. This was due to SRCPV sometimes being:
    AUTOINC+b867b78b50_47b80ef7bd and sometimes AUTOINC+b867b78b50_255a750d28.
    

If I revert that I no longer see the issue. An example recipe is attached. I&apos;ve simplified it as much as possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91396</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-09-14 13:28:48 +0000</bug_when>
    <thetext>I just tested this with a recipe:

SUMMARY = &quot;Storage Plane Development Kit (SPDK)&quot;
DESCRIPTION = &quot;Storage Plane Development Kit (SPDK) provides a set of tools and libraries for writing high performance, scalable, user-mode storage applications.&quot;
HOMEPAGE = &quot;http://www.spdk.io/&quot;
LICENSE = &quot;CLOSED&quot;
S = &quot;${WORKDIR}/git&quot;

SRCREV = &quot;${AUTOREV}&quot;
SRC_URI = &quot;git://git.yoctoproject.org/pseudo;protocol=git \
          file://somefile.service&quot;

do_compile() {
}

do_install() {
}

which was tweaked to use urls I could access. I tried &quot;devtool modify&quot; with this and it seems to work fine. If you have more details and it still fails with master, please reopen but for now, this seems to work for me.

Sorry about the time it took to get to this btw. What would help a lot in future would be a test case that fails (see oe-selftest -r devtool as an example of our devtool testing).</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>4603</attachid>
            <date>2019-12-16 22:47:24 +0000</date>
            <delta_ts>2019-12-16 22:47:24 +0000</delta_ts>
            <desc>example recipe</desc>
            <filename>brcm-spdk.bb</filename>
            <type>application/octet-stream</type>
            <size>564</size>
            <attacher name="Jonathan Richardson">jon.richardson</attacher>
            
              <data encoding="base64">U1VNTUFSWSA9ICJTdG9yYWdlIFBsYW5lIERldmVsb3BtZW50IEtpdCAoU1BESykiCkRFU0NSSVBU
SU9OID0gIlN0b3JhZ2UgUGxhbmUgRGV2ZWxvcG1lbnQgS2l0IChTUERLKSBwcm92aWRlcyBhIHNl
dCBvZiB0b29scyBhbmQgbGlicmFyaWVzIGZvciB3cml0aW5nIGhpZ2ggcGVyZm9ybWFuY2UsIHNj
YWxhYmxlLCB1c2VyLW1vZGUgc3RvcmFnZSBhcHBsaWNhdGlvbnMuIgpIT01FUEFHRSA9ICJodHRw
Oi8vd3d3LnNwZGsuaW8vIgpMSUNFTlNFID0gIkJTRCIKTElDX0ZJTEVTX0NIS1NVTSA9ICJmaWxl
Oi8vTElDRU5TRTttZDU9NzRjODYxNWIyNmJiMmU2Zjk4YWY0ZmY0OTE5Yzk5ZWQiClMgPSAiJHtX
T1JLRElSfS9naXQiCgpTUkNSRVYgPSAiJHtBVVRPUkVWfSIKU1JDX1VSSSA9ICJnaXQ6Ly9zdmNj
Y3hzd2dpdEBnaXQtY2N4c3cucnRwLmJyb2FkY29tLmNvbS9icmNtL3NvYy9zcGRrLmdpdDtwcm90
b2NvbD1zc2g7YnJhbmNoPWJjbS9tYXN0ZXIgXAogICAgICAgICAgZmlsZTovL3NwZGstbnZtZi10
YXJnZXQuc2VydmljZSIKCmRvX2NvbXBpbGUoKSB7Cn0KCmRvX2luc3RhbGwoKSB7Cn0K
</data>

          </attachment>
      

    </bug>

</bugzilla>