feat: add Alpine / musl libc support (linux-x64-musl, linux-arm64-musl)#25
Merged
Conversation
Add the two musl-based Linux targets so consumers running on Alpine
(`node:alpine`, slim CI containers) and other musl libc distros get
prebuilt native bindings instead of a runtime "no matching binding"
error. Both targets are common for Salesforce CLI tooling images,
slim Docker base layers, and ARM64 Graviton CI runners.
- napi.targets: append `x86_64-unknown-linux-musl` and
`aarch64-unknown-linux-musl`.
- release.yml: add two matrix entries on ubuntu-latest using
`napi build -x`, which drives cargo-zigbuild under the hood. Add
`mlugg/setup-zig` + `taiki-e/install-action` (cargo-zigbuild) steps
gated on `contains(target, 'musl')` so only musl jobs install zig.
- release.yml (publish): temporarily revert the napi prepublish step
to `NPM_TOKEN` auth because the two new
`config-disassembler-linux-{x64,arm64}-musl` package names are
net-new on npm and have no trusted publisher configured yet. Once
this release lands, trusted publishing can be configured for each
on npmjs.com and the step can revert to `NODE_AUTH_TOKEN=""`.
- README: update the supported-platforms table; note that the musl
builds cover Alpine and other slim CI containers.
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add prebuilt native bindings for Alpine / musl libc Linux:
config-disassembler-linux-x64-muslconfig-disassembler-linux-arm64-muslThese two cover the most common Salesforce-adjacent environments not yet supported in v2.x:
linux-x64-musl— Alpine-based Docker images (node:alpine,node:24-alpine, and most slim CI base images). Without this, consumers on Alpine succeed atnpm installbut hit a runtime "no matching native binding" error.linux-arm64-musl— Alpine on ARM64. AWS Graviton CI runners and GitHub Actions' ARM64 hosted runners running slim Alpine images.No other targets from napi-rs's full supported list (FreeBSD, armv7, Android, RISC-V, s390x, PowerPC, LoongArch, WASI) are meaningfully relevant for Salesforce dev workflows today.
What changed
package.json: two new entries innapi.targets..github/workflows/release.yml:ubuntu-latestusingnapi build … -x, which drivescargo-zigbuildunder the hood for musl cross-compile.mlugg/setup-zig+taiki-e/install-action(cargo-zigbuild) steps gated oncontains(matrix.settings.target, 'musl')so only the musl jobs pay the toolchain-install cost.NPM_TOKENauth. The two musl package names are net-new on npm and need a one-time bootstrap publish before trusted publishing can be configured for them (same chicken-and-egg as the original v2.0.0 bootstrap).README.md: supported-platforms table updated; note about musl covering Alpine.Test plan
feat:release PRnapi prepublishpublishes the two new musl packages with theNPM_TOKENbootstrap; main package publishes via trusted publishingAfter this lands
Quick one-time cleanup, mirroring the original v2.0.x bootstrap:
config-disassembler-linux-x64-muslandconfig-disassembler-linux-arm64-musl(publisher: this repo + this workflow).NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}back toNODE_AUTH_TOKEN="".NPM_TOKENrepo secret.Downstream
No code changes needed in
sf-decomposeronce this ships — the optional-dependency model means npm automatically installs the matching musl package for users on Alpine. A README note in sf-decomposer mentioning Alpine support is the only meaningful follow-up there.