All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier-oss@weidmueller.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: Improve npm support to run build scripts
Date: Tue, 5 Oct 2021 14:48:35 +0200	[thread overview]
Message-ID: <50d4d79f-a7cd-fd0a-0c6d-597b6dc4ca6a@weidmueller.com> (raw)
In-Reply-To: <6318d76222b819d3a165d405fc48dbcbadf29085.camel@linuxfoundation.org>

Hi Richard,

Am 05.10.2021 um 13:09 schrieb Richard Purdie:
> Thanks for bring this up, I've been wondering on the status of our npm support.

Do you know any npm users?

> On Tue, 2021-10-05 at 12:04 +0200, Stefan Herbrechtsmeier wrote:
>> I must improve the npm support for our use cases but need some
>> fundamental decisions to proceed. I need to build express and angular
>> applications from git repositories.
>>
>> I have the following changes in my pipeline until now:
>> - Support npm packages with missing execute mode for directories
>> - Reduce command calls in npm run
>> - Add support for local tarball and local link sources
>> - Rework crunch license to recognize more variants
>> - Move known license checksums to CSV file
>> - Pass README as fallback to guess license if a license is missing
>> - Add support to pass build arguments to npm install
>> - Add support to run build scripts with native packages
>> - Parallelize the populate of the npm cache
>>
>> The build (install) of npm packages leads to problems because of old
>> versions in the dependency tree. For example, older versions of packages
>> are incompatible with the Node.js version and older versions of node-gyp
>> require Python 2.
> 
> Hopefully over time the python2 issue should reduce and fade at least. The
> node.js version is trickier.

The current implementation works like an project with embedded external 
dependencies. I both cases I have to patch the embedded dependencies or 
replace them with external DEPENDS.

>> I see three solutions to integrate npm packages:
>> - Build npm packages from the npm project outside of OE and only fetch
>> the data.
>> - Fork the npm project repository and fix everything inside the fork.
>> Use the fork direct or create patches from the fork to build inside OE.
>> - Create recipes per project and incompatible version to fix everything
>> in OE and reduce redundancy.
>>
>> The last solution keeps everything in OE and benefit from the existing
>> OE functions like download proxy as well as license, CVE and version
>> check. But it increases the initial costs and makes only sense if there
>> is an interest in an meta-nodejs layer.
> 
> The latter solution sounds like the only really viable option from an OE
> perspective since we do need the proxy/CVE/license handling, it is a huge part
> of our value and without it, it isn't really OE.

The problem are the many different packages. An Angular project could 
have more than 1000 different project. Thereby some dependencies only 
differ in the version or needed only for development like a development 
server or a unit test framework.

> Creating a meta-nodejs layer isn't an issue if there are people willing to look
> after it.

Is a layer with more more than 1000 recipes thinkable?

Regards
   Stefan


  reply	other threads:[~2021-10-05 12:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05 10:04 Improve npm support to run build scripts Stefan Herbrechtsmeier
2021-10-05 11:09 ` Richard Purdie
2021-10-05 12:48   ` Stefan Herbrechtsmeier [this message]
2021-10-05 13:10     ` [OE-core] " Alexander Kanavin
2021-10-05 17:44       ` Stefan Herbrechtsmeier
2021-10-05 19:17         ` Alexander Kanavin
2021-10-05 19:29           ` Konrad Weihmann
2021-10-06  4:32             ` Chuck Wolber
2021-10-06  9:18             ` Stefan Herbrechtsmeier
2021-10-06  9:43               ` Konrad Weihmann
2021-10-06  9:47                 ` Alexander Kanavin
2021-10-08  5:27                   ` Tim Orling
2021-10-08  6:41                     ` Stefan Herbrechtsmeier
2021-10-19 12:51                   ` Stefan Herbrechtsmeier
2021-10-19 14:19                     ` Alexander Kanavin
2021-10-06  9:17           ` Stefan Herbrechtsmeier
     [not found]     ` <16AB247E1F8222C3.20282@lists.openembedded.org>
2021-10-05 13:14       ` Alexander Kanavin
2021-10-05 18:18     ` Robert Berger
2021-10-06  9:17       ` Stefan Herbrechtsmeier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50d4d79f-a7cd-fd0a-0c6d-597b6dc4ca6a@weidmueller.com \
    --to=stefan.herbrechtsmeier-oss@weidmueller.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.