Skip to content

Add rustc toolchain to alpine images#2488

Open
nikeee wants to merge 2 commits intonodejs:mainfrom
nikeee:fix/add-rust-cargo
Open

Add rustc toolchain to alpine images#2488
nikeee wants to merge 2 commits intonodejs:mainfrom
nikeee:fix/add-rust-cargo

Conversation

@nikeee
Copy link
Copy Markdown

@nikeee nikeee commented May 6, 2026

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

  • Bug fix (non-breaking change which fixes an issue)
  • I have read the CONTRIBUTING.md document.

@nikeee nikeee force-pushed the fix/add-rust-cargo branch 6 times, most recently from 59e030f to f4f3919 Compare May 6, 2026 21:12
Ran `./update.sh 26 alpine3.22,alpine3.23`
@nikeee
Copy link
Copy Markdown
Author

nikeee commented May 6, 2026

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:
Works:

/ # node
Welcome to Node.js v26.0.0.
Type ".help" for more information.
> Temporal
Object [Temporal] {}
> 
/ # uname -a
Linux 4da0360be3ae 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 aarch64 Linux

@MikeMcC399
Copy link
Copy Markdown
Contributor

Is this necessary, given that nodejs/unofficial-builds#228 was merged?

@nikeee
Copy link
Copy Markdown
Author

nikeee commented May 7, 2026

I think so, because x64-musl is pulled from the unofficial-builds while arm (and all other architectures) is built in this Dockerfile: 6027bae
It doesn't have a checksum, so I think there shouldn't be anything to download. It uses a platform-emulated arm build instead.

@MikeMcC399
Copy link
Copy Markdown
Contributor

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 arm64v8.

Let's wait for the amd64 build for Node.js 26.1.0 to be published first, then take it from there.

@nikeee
Copy link
Copy Markdown
Author

nikeee commented May 7, 2026

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.

@nschonni
Copy link
Copy Markdown
Member

nschonni commented May 7, 2026

Alternately #2476 could address this, since then both the affected Alpine builds would be using the pre-built (that you fixed).
Otherwise, I think you need to run the full update.sh to include the changes in the other Alpine images

@nikeee
Copy link
Copy Markdown
Author

nikeee commented May 7, 2026

Otherwise, I think you need to run the full update.sh to include the changes in the other Alpine images

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.
Edit: This should also resolve #2487

@nikeee
Copy link
Copy Markdown
Author

nikeee commented May 7, 2026

Added rust to the non-temporal builds in b257eed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust missing from build tools Temporal API not available in Alpine v26 images

3 participants