[bitbake-devel] [RFC][PATCH 2/2] fetch2/npm.py: refactor the npm fetcher

Jean-marie Lemetayer jean-marie.lemetayer at savoirfairelinux.com
Wed Oct 23 13:08:08 UTC 2019


On Oct 22, 2019, at 7:10 PM, Mark Hatle mark.hatle at kernel.crashing.org wrote:
> On 10/22/19 4:04 AM, Jean-Marie LEMETAYER wrote:
>> This commit refactors the npm fetcher to improve some points and fix
>> others:
>> 
>>  - The big change is that the fetcher is only fetching the package
>>    source and no more the dependencies. Thus the npm fetcher act as the
>>    other fetchers e.g git, wget. The dependencies will now be fetched
>>    by the npm class.
> 
> I don't completely understand this and the associated class, but does it work
> with the existing MIRROR and BB_NO_NETWORK/BB_ALLOWED_NETWORKS settings?
> 
> My concern is for people in environments that are not allowed to download except
> from trusted machines, or on disconnected networks so they have everything on a
> local mirror of some sort.
> 
> Additionally with the mirroring, it's not unusual for the name of what is
> downloaded (as well as where it's downloaded from) to change protocol and
> format.  I.e. I'd hope something like:
> 
> .*:.*/.* file://my_local/on/disk/mirror

Thank you for pointing this out. As I was inspired by the wget fetcher, I
think this should be good but i still need to check.

However the npm.bbclass fetches the npm dependencies (currently in the
do_compile task) and this settings are not respected. I am working on a v2
to fix this point.

> I'm also not seeing any test cases for this fetcher.  Since this work isn't well
> understood by most of the regular maintainers, I think it's extremely important
> that test cases are added during any new changes to ensure that the fetcher is
> working properly.

Thank you again. The former npm support does not have any tests so I did not
think about it. I will add some basic tests in the v2.

Regards,
Jean-Marie


More information about the bitbake-devel mailing list