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

Mark Hatle mark.hatle at kernel.crashing.org
Wed Oct 23 14:27:11 UTC 2019



On 10/23/19 8:08 AM, Jean-marie Lemetayer wrote:
> 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.

If you need some pointers on where and how to write the tests, please let me
know.  I've had to write a number of them for the gitsm fetcher.

Hint: https://git.openembedded.org/bitbake/tree/lib/bb/tests/fetch.py

Stuff I added is mostly found by looking for 'test_git_submodule...'

I'd expect we need a new test_npm_.... series.

--Mark

> Regards,
> Jean-Marie
> 


More information about the bitbake-devel mailing list