Skip to contentSkip to conversation

archiver.bbclass and fetch2/npmsw.py

DISCUSSION Mike Crowe 1 participant 1 message Apr 12, 2021

lore
Share & tools
lore

Mike Crowe

author
#0 lore raw

We have a class that stores the files in ${DL_DIR} that are required for each recipe so they can be made available in ${DL_DIR} later. This is a bit like archiver.bbclass, but not quite the same.

I'm having trouble making our class work for recipes that use the post refactor[1] npm.bbclass and the npmsw fetcher in Dunfell. The individual dependency paths aren't returned by bb.fetch2.Fetch's localpaths method.

I hoped that I could see how archiver.bbclass solved this problem, so I tried running do_ar_mirror for the recipe and got:

NOTE: Using original download: [...]/package.json
NOTE: Copying source mirror
NOTE: Archiving url: npmsw:///[...]/npm-shrinkwrap.json
NOTE: Using original download: /home/mac/src/oe/build/downloads/
NOTE: Copying source mirror
DEBUG: Python function do_ar_mirror finished

and the whole of my downloads directory ends up copied to ${WORKDIR}/archiver-sources . :(

It looks like archiver.bbclass doesn't know the dependency filenames (or subdirectories) either because NpmShrinkWrap doesn't expose them via a localpath method.

It didn't look like there was an easy fix for this since everyone else expects the localpath method to return only one path. I'm hoping that I might have missed something. Does anyone have any advice?

Thanks.

Mike.

[1] oe-core:fb2252ee0777c6d26dea94c7588c323a6b97e961