Bug 10237 - bitbake -c cleanall on npm fetched recipe will prevent fetching other versions of the same package
Summary: bitbake -c cleanall on npm fetched recipe will prevent fetching other version...
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 2.0
Hardware: All Multiple
: Medium normal
Target Milestone: Future
Assignee: Jean-Marie Lemetayer
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks: 10653
  Show dependency tree
 
Reported: 2016-09-06 23:51 UTC by Paul Eggleton
Modified: 2020-05-17 09:32 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.