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

Cross-platform Linux installation, target uses glibc but host uses musl #3159

Closed
2 of 3 tasks
arovetto opened this issue Mar 28, 2022 · 2 comments · Fixed by #3160
Closed
2 of 3 tasks

Cross-platform Linux installation, target uses glibc but host uses musl #3159

arovetto opened this issue Mar 28, 2022 · 2 comments · Fixed by #3160

Comments

@arovetto
Copy link

Possible install-time or require-time problem

  • I have read the documentation relating to installation.
  • I have ensured that the architecture and platform of Node.js used for npm install is the same as the architecture and platform of Node.js used at runtime.

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.

If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.

If you are using another package which depends on a version of sharp that is not the latest, please open an issue against that package instead.

Is this a problem with filesystem permissions?

If you are using npm v6 or earlier and installing as a root or sudo user, have you tried with the npm install --unsafe-perm flag?

If you are using npm v7 or later, does the user running npm install own the directory it is run in?

If you are using the ignore-scripts feature of npm, have you tried with the npm install --ignore-scripts=false flag?

What is the complete output of running npm install --verbose sharp?

I'm trying to cross-platfrom install from an alpine image targeting both win32-x64 and linux-x64 platform, but both are failing because during the installation procedure musl is detected as libc, and the binary installed are for musl.

Instead, when I cross-platform install when using windows targeting linux, it works fine.

Am I doing something wrong here, or is using an alpine image not supported for cross-compiling to linux (glibc)?

When I run:
npm install --arch=x64 --platform=linux sharp
Installation seems ok, but I found the following path revealing something not expected:

"/node_modules/sharp/vendor/8.12.2/linuxmusl-x64"

@lovell
Copy link
Owner

lovell commented Mar 28, 2022

This is dependent on prebuild/prebuild-install#176

@lovell lovell changed the title Cross-platform installation Cross-platform Linux installation, target uses glibc but host uses musl Mar 28, 2022
@lovell lovell reopened this Apr 28, 2022
@lovell lovell added this to the v0.30.5 milestone Apr 28, 2022
@lovell
Copy link
Owner

lovell commented May 23, 2022

Cross-libc installation on Linux now available in v0.30.5

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

Successfully merging a pull request may close this issue.

2 participants