<?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>10237</bug_id>
          
          <creation_ts>2016-09-06 23:51:53 +0000</creation_ts>
          <short_desc>bitbake -c cleanall on npm fetched recipe will prevent fetching other versions of the same package</short_desc>
          <delta_ts>2020-05-17 09:32:43 +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>2.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          <blocked>10653</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Jean-Marie Lemetayer">jeanmarie.lemetayer</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</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>65853</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-09-06 23:51:53 +0000</bug_when>
    <thetext>ud.localpath for the npm fetcher is the deps.json file rather than the tarball. When you do bitbake -c cleanall on a recipe fetching from npm://... it will delete the subdirectory containing *all* of the version tarballs for that particular package but not the corresponding deps.json files (only the one for the version the recipe is actually fetching), which means if you try to fetch a different version that was previously fetched, it will think it doesn&apos;t need to download the tarball and then fail to unpack when it finds it&apos;s not there.

To fix this we could do any one of the following:

1) Stop deleting all of the tarballs, just remove the specific one that matches the version being cleaned

2) Delete all of the deps.json files. Given that npm recipes tend to package the entire dependency tree with the resulting potential overlap in fetched files, I would assume this still runs the risk of stamps for do_fetch tasks for other recipes existing but the tarballs being missing, which wouldn&apos;t be right.

3) Don&apos;t consider the deps.json file alone when checking if the local file exists, look for the tarball as well. (May still suffer from the issue in #2.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87169</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2020-05-07 07:59:23 +0000</bug_when>
    <thetext>Jean-marie, is this fixed now?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87228</commentid>
    <comment_count>2</comment_count>
    <who name="Jean-Marie Lemetayer">jeanmarie.lemetayer</who>
    <bug_when>2020-05-17 09:32:43 +0000</bug_when>
    <thetext>This is fixed in the master.

The npm:// and npmsw:// fetcher both handle correctly the deletion of downloads.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>