Bug 10237

Summary: bitbake -c cleanall on npm fetched recipe will prevent fetching other versions of the same package
Product: [Build System, Metadata & Runtime] BitBake Reporter: Paul Eggleton <bluelightning>
Component: bitbakeAssignee: Jean-Marie Lemetayer <jeanmarie.lemetayer>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: poky.bs.watcher, poky.watcher, randy.macleod
Version: 2.0   
Target Milestone: Future   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 10653    

Description Paul Eggleton 2016-09-06 23:51:53 UTC
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't need to download the tarball and then fail to unpack when it finds it'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't be right.

3) Don'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.)
Comment 1 Randy MacLeod 2020-05-07 07:59:23 UTC
Jean-marie, is this fixed now?
Comment 2 Jean-Marie Lemetayer 2020-05-17 09:32:43 UTC
This is fixed in the master.

The npm:// and npmsw:// fetcher both handle correctly the deletion of downloads.