Skip to content

napi: build the musl addons against a dynamic C runtime and smoke them on Alpine - #9

Merged
colinhacks merged 3 commits into
mainfrom
napi-musl
Sep 24, 2026
Merged

colinhacks merged 3 commits into
mainfrom
napi-musl

Conversation

@colinhacks

Copy link
Copy Markdown
Contributor

Both musl targets failed in the first napi run: cargo cannot produce a cdylib with musl's default static C runtime. The addon is now built with -C target-feature=-crt-static on musl, as napi-rs does. The smoke script moves to napi/scripts/smoke.cjs; the musl builds run it inside node:22-alpine on the same runner.

…m on Alpine

The musl targets link the C runtime statically by default, which cannot go into
a cdylib: cargo refused both musl builds. The addon alone is built with
-crt-static, as napi-rs does. The smoke moves to napi/scripts/smoke.cjs so the
musl builds can run it inside node:22-alpine on the same runner.
Copilot AI lite review requested due to automatic review settings September 22, 2026 22:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

A musl cdylib linked on the Ubuntu runner with musl-tools did not load in a musl
Node. The same crate built in rust:1-alpine with -crt-static loads in
node:22-alpine and installs real packages (verified locally on arm64).
@colinhacks
colinhacks merged commit a68d173 into main Sep 24, 2026
21 of 99 checks passed
@colinhacks
colinhacks deleted the napi-musl branch September 24, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants