Add rust+cargo to musl toolchain#228
Conversation
Node needs at least rust 1.82 [1], which is not available in alpine 3.19. [1]: https://github.com/nodejs/node/blob/dc99d18597a21a205692e7ff39e53ba55005b9e8/configure.py#L1582-L1583
74ae38b to
6fada9d
Compare
Noting that the presence of rust will likely cause the the arm builds to fail. A similar solution to nodejs/build#4316 may be all that's required but it would need someone to verify it. Perhaps @mollux would like to take a look at this? |
This PR only touches x64+musl. For arm, the docker image doesn't pull in a binary from unofficial-builds for some reason, but uses a multi-stage-build to build them from source (see: nodejs/docker-node#2488). There the docker image seems to be built on arm64 (or being emulated To arm64) because there don't seem to be any cross-compilations going on. Not sure if there would be a better solution. |
Correct but the standalone unofficial-build for Alpine/arm64 (not the one that goes into the docker image at present) will likely be affected if we put this in as it would install the x64 version of rust which I expect to fail as per the build issue I mentioned above which was a problem for cross-compiled macos builds. |
|
Maybe I'm getting this wrong, but i thought musl-arm is built solely from https://github.com/nodejs/unofficial-builds/blob/main/recipes/arm64-musl and not this one. At least that is where some cross-compilation is set up. If this PR breaks the arm build, then we'd probably do it somehow different like you mentioned. |
|
Yeah you're right - my bad (I wish that directory was explicitly |
|
I ran My local build is still running and I'll reach back when it finishes. |
|
Just a note on this - adjusting the dockerfile to Alpine 3.23 may cause problems on the Alpine 3.22 image so we'll want to verify that too. FYI @MikeMcC399 |
|
Good point. Done in 67f2cd8 |
|
Thanks. I think I'm happy to merge this now :-) |

See #227
See nodejs/docker-node#2486
This probably affects all architectures that are built here.
The only one that is used in the official docker images seems to be x64:
nodejs/docker-node@6027bae
Merging this would prevent the new docker images from being blocked. We probably can fix the cross-compilation later.