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

sharp@0.33.2 fails to download binary in docker build #4000

Closed
5 of 11 tasks
Aareksio opened this issue Feb 20, 2024 · 4 comments
Closed
5 of 11 tasks

sharp@0.33.2 fails to download binary in docker build #4000

Aareksio opened this issue Feb 20, 2024 · 4 comments

Comments

@Aareksio
Copy link

Possible install-time or require-time problem

Are you using the latest version of sharp?

  • I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.

Are you using a supported runtime?

  • I am using Node.js with a version that satisfies ^18.17.0 || ^20.3.0 || >=21.0.0
  • I am using Deno
  • I am using Bun

Are you using a supported package manager and installing optional dependencies?

  • I am using npm >= 9.6.5 with --include=optional
  • I am using yarn >= 3.2.0
  • I am using pnpm >= 7.1.0 with --no-optional=false
  • I am using Deno
  • I am using Bun

What is the complete error message, including the full stack trace?

There is no error message with 0.33.2, however node install/check seems to run as intended

#11 1.314 .../sharp@0.33.2/node_modules/sharp install$ node install/check
#11 1.395 .../sharp@0.33.2/node_modules/sharp install: Done

See: https://github.com/Aareksio/sharp-build-reproduction/actions/runs/7977103003/job/21779222827

Expected output from 0.32.6:

#11 1.383 .../sharp@0.32.6/node_modules/sharp install$ (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
#11 1.499 .../sharp@0.32.6/node_modules/sharp install: sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-linuxmusl-x64.tar.br
#11 1.963 .../sharp@0.32.6/node_modules/sharp install: sharp: Integrity check passed for linuxmusl-x64
#11 2.290 .../sharp@0.32.6/node_modules/sharp install: Done

See: https://github.com/Aareksio/sharp-build-reproduction/actions/runs/7977101833/job/21779218608

I have considered it may not print logs, but the execution time (81ms) is too short for any meaningful action.

Reproduction repo:

@lovell
Copy link
Owner

lovell commented Feb 20, 2024

This is the expected behaviour from v0.33.0 onwards.

https://sharp.pixelplumbing.com/changelog#v0330---29th-november-2023

Prebuilt binaries distributed via npm registry and installed via package manager.

Please see #3750 for full details.

@Aareksio
Copy link
Author

Thank you!

May I ask how to properly install 0.33.0 as deep dependency, for example:

$ pnpm why sharp
@nuxt/image 1.3.0 (dependency)
└─┬ ipx 3.0.1 (optional dependency)
  └── sharp 0.33.2 (dependency)

Installing with user app with --no-optional=false does not help, when using sharp the following error pops:

Could not load the "sharp" module using the linuxmusl-x64 runtime

I understand this is not direct sharp issue and do not expect it to be touched on sharp level. Only asking for directions, on how any of the projects (user app, @nuxt/image, ipx) could be updated to fit with new registry prebuilt binaries install.

@lovell
Copy link
Owner

lovell commented Feb 20, 2024

It looks like you're using pnpm with multiple platforms (I spy a lockfile that was created outside a container being used inside a container) so please see its supportedArchitectures feature.

https://sharp.pixelplumbing.com/install#cross-platform

@Aareksio
Copy link
Author

Good smell! There were indeed no binaries installed for the container architecture. Thank you very much! The error in this particular package (@nuxt/image) is a bit more complicated, but that has nothing to do with sharp :)

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