-
Notifications
You must be signed in to change notification settings - Fork 75
add recipe to compile an arm64-musl version #189
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
base: main
Are you sure you want to change the base?
Conversation
Has someone attempted to upstream the patches in here? |
@rvagg I had some good succes last night compiling the musl toolset, so patches for supported versions are no longer needed 🥳 . I was able to compile 20, 22, 24 and 25-nightly. I'll update this pr tonight, but all should be working for supported versions, and a decision need to be made is support for 18 and 16 should be added too (for at least the final release) |
don't add 18 or 16, those are unsupported upstream so we shouldn't bother here unless someone really wants to bend over backward but I suspect it'll be more trouble than it's worth and might suggest "support" |
Agreed:) will update PR tonight! |
b33afeb
to
1985790
Compare
@rvagg I updated the PR so it only contains support for supported versions :) All issues with nodejs v24 and newer are also resolved by switching to a newer GCC version (from 11.2 to 14.2) |
OUTPUT = /opt/aarch64-linux-musl-cross | ||
EOF | ||
|
||
RUN git clone https://github.com/richfelker/musl-cross-make /musl-cross-make && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how long does this take to compile? is this going to add a lot to our rebuild process whenever we update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on the resources :)
That specific step takes around 380 seconds (with 10 cores) on my local machine.
On my test server it takes a bit longer (666 seconds)
mattias@docker-builder:~/node_compiler/unofficial-builds/recipes/arm64-musl$ time docker build -t test .
[+] Building 678.8s (12/12) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.23kB 0.0s
=> [internal] load metadata for docker.io/library/alpine:3.22 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/6] FROM docker.io/library/alpine:3.22 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 28B 0.0s
=> CACHED [internal] preparing inline document 0.0s
=> CACHED [2/6] RUN addgroup -g 1000 node && adduser -u 1000 -G node -s /bin/s 0.0s
=> [3/6] RUN apk add --no-cache libstdc++ && apk add --no-cache --virt 6.2s
=> [4/6] COPY <<-EOF /config/config.mak 0.0s
=> [5/6] RUN git clone https://github.com/richfelker/musl-cross-make /musl-cross 666.4s
=> [6/6] COPY --chown=node:node run.sh /home/node/run.sh 0.0s
=> exporting to image 6.1s
=> => exporting layers 6.1s
=> => writing image sha256:2681a96946dd126f0c762a7fd43a0fb16dcaace96ff821fe78299d8 0.0s
=> => naming to docker.io/library/test 0.0s
real 11m19.193s
user 0m1.622s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
948.5s on the machine where this needs to run, 15 minutes, that kind of sucks
not the end of the world, we only run docker build when we merge here but this is going to hold everything else up when it needs to rerun
maybe we should cache a copy of this locally and reuse it when we rebuild, we could probably mount some var directory like we do with .ccache, or even use .ccache in here to store it .. maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would mean altering the place where the docker build
is called. I can look into this if the .ccache approach would work here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unofficial-builds/bin/prepare-images.sh
Line 11 in 8fb00ef
docker build "${recipes_dir}/${recipe}/" -t "${image_tag_pfx}${recipe}" --build-arg UID=1000 --build-arg GID=1000 |
Would it make sense to split this off to a separate issue / PR? As this is is a speed optimisation, and is also usable for other recipes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm, no mounts during build
No need for a separate issue for now, let me think about this for a bit, it's not ideal but it's not the end of the world either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rvagg anything I can do to help move this PR forward?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rvagg another bump of this PR :)
This is the successor of #59, which also contains additional info and the discussion history.
This PR contains the needed changes to compile an arm64 musl version of currently supported nodejs versions.
I tested this by building multiple versions of nodejs, and running those in an Alpine container:
All of those versions build successfully using GCC 14.2.0, using the
local-build.sh
script, e.g.This is an updated comment, the initial version (and the PR) also contained info about compiling unsupported versions (v16 and v18).
I removed that part, based in the comments below.