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

Proposal: support linux-x64-musl #190

Open
dvic opened this issue Jan 7, 2021 · 10 comments · Fixed by #272
Open

Proposal: support linux-x64-musl #190

dvic opened this issue Jan 7, 2021 · 10 comments · Fixed by #272
Labels
node-build Related to node-build

Comments

@dvic
Copy link

dvic commented Jan 7, 2021

It would be nice if we could support the musl build (https://github.com/nodejs/unofficial-builds#builds)

@augustobmoura
Copy link
Member

It should work on master right now, at least theoretically, as we are using node-build and it supports building from source. If that doesn't work please let me know and we re-open this issue

@phortx
Copy link

phortx commented Dec 27, 2021

Hi, I've tried but I'm not sure how to force asdf install to compile the musl version. Any hints?

@augustobmoura
Copy link
Member

augustobmoura commented Dec 27, 2021

Just installing nodejs on a distribution based on musl should work by default. Node.js already detects musl as the libc and make the correct assumptions (alpine Dockerfile for reference).

Cross-compiling from another libc on the other hand should be a bit tricky, I think the best chance is the official building docs for nodejs and the official issue tracker. You can pass building options for both configure and make by using node-build options

@augustobmoura
Copy link
Member

Actually, I see the problem, node-build is not detecting that musl dists have different binaries from glibc and is not building from source by default, is just downloading glibc binaries instead. I will try to debug it and fix it upstream

@augustobmoura
Copy link
Member

FYI: I just merged #284, which adds an option to force compilation. You can just run ASDF_NODEJS_FORCE_COMPILE=1 asdf install nodejs latest and it will force a compilation.

I tested on an alpine container, and it works. Just be sure to install all nodejs building dependencies. Aside from what is listed on the official docs, I also needed to install the packages openssl and linux-headers when using the latest alpine distribution

I still gonna work on a patch upstream for supporting pre-compiled binaries, the problem was a bit more difficult than I antecipated.

@Stratus3D
Copy link
Member

Chiming in to confirm @augustobmoura's instructions worked for me on Alpine 3.11.

@danielb2
Copy link

this ticket has been open quite awhile. is it a difficult fix?

@augustobmoura
Copy link
Member

NodeJS doesn't provide official pre-compiled binaries for alpine-musl as of yet. They do have an unofficial branch that have the binaries, but, unfortunately, it still not supported on node-build (the engine we use for installing the versions).

The only way to do it right now is by compiling from source inside the musl container/system as per #190 (comment)

@danielb2
Copy link

instead of installing broken binaries, would it not be better to refuse the install with some kind of message?

@augustobmoura
Copy link
Member

instead of installing broken binaries, would it not be better to refuse the install with some kind of message?

As a maintainer with very limited time, I am prioritizing the most recurrent issues. We will get to musl pre-compiled binaries eventually. We are also open to contributions, if you think a warning would help, we would appreciate a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node-build Related to node-build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants