How to build NodeJS support without an Internet connection?
m16+nginx at monksofcool.net
Sun Dec 9 13:41:56 UTC 2018
Hello developer team.
I am the maintainer of the NGINX Unit ebuild for Gentoo Linux, and
currently I am struggling with colliding requirements of Unit's and
Gentoo's build strategies.
As you may know, the Gentoo way is to build everything from the source
code, with only very few exceptions. If, for example, the user desires
Python support in Unit, my ebuild ensures that this requirement is met
before Unit's release tarball is even unpacked.
NodeJS support is a different beast, because the existing Unit build
method relies on node-gyp and npm to download and install dependencies
during the build process. This fails, because Gentoo builds are executed
in a sandbox environment that prohibits both network access and files
being written outside the sandbox. Hence, "npm install --global ..."
Is there a way I can modify the existing Unit build to comply with these
restrictions? Everything required for the build must either already
exist, or it must be downloaded by Gentoo before Unit's compile phase.
Also, all required artefacts are recorded with a checksum when an ebuild
is added to the Gentoo tree, so no "download whatever is the most recent
version of XYZ".
Your help is appreciated.
More information about the nginx