Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unconditional Download during install breaks shrinkpack #3737

Closed
tim-janik opened this issue Jul 22, 2023 · 4 comments
Closed

Unconditional Download during install breaks shrinkpack #3737

tim-janik opened this issue Jul 22, 2023 · 4 comments

Comments

@tim-janik
Copy link

Preparing projects for reproducible builds or offline builds with shrinkpack breaks during offline installation if sharp is part of the (nested) dependency list. Installation fails as follows:

$ rm -rf ~/.npm/    # purge NPM cache or run in a clean CI environment
$ npm ci --offline
npm ERR! code 1
npm ERR! path /tmp/bar/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-linux-x64.tar.br
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: getaddrinfo EAI_AGAIN github.com

The shrinkpack README.md contains further motivational details. Please consider supporting this use case.

@lovell
Copy link
Owner

lovell commented Jul 23, 2023

Did you see https://sharp.pixelplumbing.com/install#custom-prebuilt-binaries for installation from filesystem (e.g. when networking is unavailable)?

@tim-janik
Copy link
Author

Did you see https://sharp.pixelplumbing.com/install#custom-prebuilt-binaries for installation from filesystem (e.g. when networking is unavailable)?

Thank you for the pointer, I have read through it.

I am just not sure if that could be integrated in an automatic way with shrinkpack, so that users of any derived package (not knowing about sharp) do not have to special case shrinkpack handling for an arbitrary number of dependencies.
Have you taken a look at e.g. the the Target Problem description of shrinkpack and see a remote possibility of making this work with sharp?

@lovell
Copy link
Owner

lovell commented Jul 25, 2023

If you've not already seen it, you'll probably be interested in npm/rfcs#519 , which is a proposal to standardise how npm (and yarn etc. by extension) installs platform-specific binaries, similar to the concept of Python "wheels". Once this is available relatively widely then I plan that sharp will very much take full advantage.

@lovell
Copy link
Owner

lovell commented Aug 15, 2023

Please see also #3750

@lovell lovell closed this as completed Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants