nodejs / unofficial-builds

Unofficial binaries for Node.js
https://unofficial-builds.nodejs.org
227 stars 47 forks source link

add recipe to compile arm64-musl version #59

Closed mollux closed 1 year ago

mollux commented 2 years ago

Configuration to allow compiling a arm64 musl version (on amd64 hardware)

I tested this by building the last version of node 8, 10, 12, 14 and 16 on amd64 hardware, and doing the basic steps in a frontend theme project (npm install, grunt watch, ...), and it works without issues.

This addresses #50

I updated the readme.md best effort, but feel free to update if needed

nschonni commented 2 years ago

It looks like the docker official images already builds this out for us https://hub.docker.com/layers/node/library/node/current-alpine3.15/images/sha256-b023d2de41e78d9665ab51fd378250fa2901e7ad321871a54ab60ed347389f0e?context=explore

rvagg commented 2 years ago

Would @nodejs/docker images consume these binaries if we produced them here?

And, is there much of an audience for this? I already probed at this question in #50. It seems reasonable to me that there might be a growing audience for this kind of thing. Maybe we have Docker image numbers to suggest audience size?

@mollux I assume you're one of those people, can you talk about your use-case a bit?

nschonni commented 2 years ago

Currently, only the x64 builds from here are special cased https://github.com/nodejs/docker-node/blob/1b70b5dfb424d67c8e0b0badb985aedf43a2227a/Dockerfile-alpine.template#L11-L26 but it's possible it could be done for arm64. Not sure if it would need to be arm64v8 vs arm64 or if that's implied

nschonni commented 2 years ago

I'm guessing it's OK from https://github.com/nodejs/docker-node/blob/1b70b5dfb424d67c8e0b0badb985aedf43a2227a/Dockerfile-debian.template#L13

mollux commented 2 years ago

@rvagg

our use case

Our use case is that we have a custom image (based on php:cli-alpine) where we install the theia editor to have an in-browser IDE to develop / compile / without a local IDE.

One of the tasks to perform is to compile frontend themes, where we require nodejs. We use nvm to install multiple versions (for some old projects we are updating we still need nodejs 10).

On amd64 we use the pre-build version from unofficial builds, hence the PR to be able to do the same for arm64. We have this use case as we are switching more and more of our laptops to Macbook M1.

I currently use a self-managed location where we host the compiled versions and the index.tab, but ideally they are all hosted on an official unofficial location :)

use the binaries in the nodejs-docker images

It looks like there is not much change needed to use the arm64 binaries if they are available.

mollux commented 2 years ago

hi @rvagg

is there anything I can do on my side to move this PR forward?

acifani commented 1 year ago

hey @rvagg, any news on this? anything we can do to help?

in our company, we use docker with a custom alpine base image. having prebuilt binaries would help us have multiarch images rather sooner & quicker than building from source

nschonni commented 1 year ago

@acifani there are already prebuilt Alpine images on dockerhub through the official node image

acifani commented 1 year ago

@acifani there are already prebuilt Alpine images on dockerhub through the official node image

Hey @nschonni, thanks for the heads up! Unfortunately that doesn't work for us because we need to use our own Alpine base image, so we can't depend on the node alpine image directly 😞

PeterBurner commented 1 year ago

I am facing a similar scenario as @acifani. I am required to use a specific alpine base image and need to install node 18 with musl support. @rvagg can you make some time to merge this?

aral commented 1 year ago

This would enable Node.js to run on mobile devices like the PinePhone and PinePhone Pro running Alpine-based PostmarketOS and open up new possibilities for the use of such devices in education and elsewhere.

Is there anything we can do to help get this merged @rvagg? :)

mcollina commented 1 year ago

@rvagg @nodejs/build @nodejs/docker could you take a look?

wenerme commented 1 year ago

@rvagg need this for cloud provided arm64 server

rvagg commented 1 year ago

let's just deploy and see what happens eh? will report back if there are errors and this needs to be backed out, disabled or whatever and has to be fixed

rvagg commented 1 year ago

Nope:

I think I can leave this in place for now while it gets fixed as it shouldn't disrupt other builds, but it'll need to get fixed or reverted soon please. @mollux are you able to take a look at this and figure out how to address it?

richardlau commented 1 year ago

Maybe https://github.com/nodejs/node/pull/45756?

rvagg commented 1 year ago

reverting in https://github.com/nodejs/unofficial-builds/pull/70

nikolaik commented 7 months ago

I believe this can be reopened after https://github.com/nodejs/node/pull/51256 got merged. Probably have to wait for the fix to land in the release branches first though. Do you want me to create a separate issue?

mcollina commented 7 months ago

It would be best if you would open a fresh PR