Saturday, May 01, 2021

Re: Emscripten and fetching NPM dependencies listed by extracted distfiles

On 2021/05/01 12:27, Karsten Pedersen wrote:
> Hello all,
>
> I am cleaning up my initial port of Emscripten. I have a recent
> project to port something to the MS Hololens and I aim to avoid the
> disposable WinStore / UWP stuff. Because of this, WebXR seems the
> better approach if I can leverage my existing C++ codebase.
>
> https://github.com/osen/openbsd_emscripten/blob/master/Makefile
>
> Emscripten is mostly just Clang targeted for the WebAssembly
> platform and so far everything is working quite well.
>
> However the supporting scripts themselves follow a very "web
> development" kind of structure and as such they not only rely on
> many different random scripting languages (Python, Node, JDK) but
> they also drag in a whole heap of (annoyingly trivial) dependencies.
>
> The one giving the most issue is the Javascript dependencies from
> NPM. These are listed inside the Emscripten distfile but this needs
> to be extracted before I can get this large NPM list (package.json).
> What is the recommended way to do this? I have looked through a

Simplest is usually to fetch via npm out-of-band, tar it up and provide
a tar containing the files.

> number of similar ports but as far as I can tell they simply fetch
> them in during the build (which is what I currently do). Surely we

No committed port does this, it is not permitted to fetch during the
build stage.

> want to grab this list during the fetch stage rather than the build
> stage?

In the fetch stage, only ports infrastructure does the fetching;
i.e. simple http/https/ftp download of files listed in the port
Makefile and distinfo. You can't use npm to fetch as part of the
port.

No comments:

Post a Comment