<?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>13697</bug_id>
          
          <creation_ts>2019-12-10 14:54:52 +0000</creation_ts>
          <short_desc>Regression due to &quot;fetch2: Ensure cached url data is matched to a datastore&quot; patch</short_desc>
          <delta_ts>2020-03-27 14:38: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>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.1 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Enrico Scholz">enrico.scholz</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85781</commentid>
    <comment_count>0</comment_count>
    <who name="Enrico Scholz">enrico.scholz</who>
    <bug_when>2019-12-10 14:54:52 +0000</bug_when>
    <thetext>The &quot;fetch2: Ensure cached url data is matched to a datastore&quot; patch (e.g. 4ce50bbd34eefeabfeca89a6a66c71598d3c58f6 in 1.42 branch) causes regressions in recipes which call `bb.fetch2.Fetch()` in early stages.

E.g.

------
LICENSE = &quot;CLOSED&quot;

SRC_URI = &quot;file://foo;name=bootsplash&quot;

def _find_bootsplash(d):
    fetch = bb.fetch2.Fetch([], d)
    for url in fetch.urls:
        urldata = fetch.ud[url]
        parm = urldata.parm
        if parm.get(&apos;name&apos;) == &apos;bootsplash&apos;:
            return urldata

    raise Exception(&quot;no bootsplash&quot;)

def get_bootsplash_convert(d):
    uri = _find_bootsplash(d)

    if not uri.localpath:
        # happens in early parsing stage; skip further processing
        return None

    ## construct an image magick command to rotate/scale bootsplash
    ## ...

    return &quot;true&quot;

LOGO_CONVERT_CMD = &quot;${@get_bootsplash_convert(d)}&quot;

do_unpack[postfuncs] += &quot;do_logo_preprocess do_unpack_logo&quot;

do_logo_preprocess() {
    ${LOGO_CONVERT_CMD}
    false
}
---------

fails after this patch but worked before.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86842</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-03-27 14:38:38 +0000</bug_when>
    <thetext>Sorry about the delay in getting to this. The issue is actually an API one.

The API is that for localpath to be valid, you need to call:

        urldata = fetch.ud[url]
        urldata.setup_localpath(d)

and your example doesn&apos;t.

In previous code you got a cached object that had this called already, with the patch applied, you no longer get the cached object and therefore need the call.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>