Add rustc toolchain to alpine images#2488
Conversation
59e030f to
f4f3919
Compare
Ran `./update.sh 26 alpine3.22,alpine3.23`
|
I'm currently unable to verify end-to-end that this fixes the issue as I'm getting a segfault after ~10 minutes when I try to build anything in this repository from source. But the warnings that it cannot find rustc/cargo are gone, so it will probably work. Might just run this through CI and see what happens.I don't think that it is related to the rust issue as it also happens on the main branch. Probably just my local broken docker instance. Update: |
|
Is this necessary, given that nodejs/unofficial-builds#228 was merged? |
|
If we only consider the architectures in versions.json "alpine3.22": [
"amd64",
"arm64v8"
],
"alpine3.23": [
"amd64",
"arm64v8"
],then I guess #2476 would solve the build issue for Let's wait for the amd64 build for Node.js 26.1.0 to be published first, then take it from there. |
|
Yeah, that's also a thing to consider. But I think since the backup source build should work too, we should add rust/cargo to it as well. |
|
Alternately #2476 could address this, since then both the affected Alpine builds would be using the pre-built (that you fixed). |
Did that first but then undid the images for node < 26 because they don't need rust at this point in time as they don't ship temporal. Wouldn't hurt to have it there too, but isn't needed. #2476 needs some additional work in the unofficial-builds repo that sets up cross-compilation for rust. I tried that initially, but that is significantly more work and error-prone than just updating the way how arm is built today. Doesn't mean that this shouldn't be done on the long run. I think independent of #2476, rust has to be in the backup build for all other architectures regardless. But they don't matter that much. |
|
Added rust to the non-temporal builds in b257eed |
|
I don't think we should add rust & cargo to the toolchain here in this repo for Alpine, assuming that PR #2476 is adopted. This would build Docker images using the pre-built musl builds for amd64 and arm64 from https://unofficial-builds.nodejs.org The landscape has changed from when Alpine was originally set up here.
This means it is now possible to run build tests for the two addressed architectures (amd64 & arm64) in Node.js 26 using GitHub Actions. (Earlier versions do however have other architectures attached, including also 32-bit.) This is evolving technology, and Temporal was added at the very last minute for the release of Node.js 26.0.0, so we probably need some more discussions with each other whilst we work out the best way to address needs. |
|
I also noticed that the toolchain requirements are currently undocumented - see nodejs/node#63213 |
|
This might also cause an issue with Node.js 22 builds which still include |
Then #2487 would be invalid (it has been closed as a duplicate but the described issue still persists) and the other except arm/x86 would be broken. Honestly I don't see a point in installing gcc but no rust in a build process. We should probably just remove the entire fallback build in that case. Maybe @nschonni has a different opinion here. Merging #2486 alone wouldn't solve the issue by its own because the unofficial-builds-repo is currently missing the cross-compilation infra for arm. Of course, it could be (and should probably be) done.
Didn't include rust there at first but as requested added it in b257eed. We can revert this commit if that's an issue. |
|
Sorry for being slow to understand! I assumed without checking that |
Description
Adds rustc and cargo. Uses host-native architecture, so should fix the below-mentioned issues for every arch except x64.
Node requires at least rust 1.82, which is available in alpine 3.22/3.23 (they currently ship 1.87).
Motivation and Context
Resolves #2486
Resolves #2487
Testing Details
See below
Types of changes