Skip to content

feat: add Alpine / musl libc support (linux-x64-musl, linux-arm64-musl)#25

Merged
mcarvin8 merged 1 commit into
mainfrom
cursor/add-musl-targets
May 13, 2026
Merged

feat: add Alpine / musl libc support (linux-x64-musl, linux-arm64-musl)#25
mcarvin8 merged 1 commit into
mainfrom
cursor/add-musl-targets

Conversation

@mcarvin8
Copy link
Copy Markdown
Owner

Summary

Add prebuilt native bindings for Alpine / musl libc Linux:

  • config-disassembler-linux-x64-musl
  • config-disassembler-linux-arm64-musl

These 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 at npm install but 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 in napi.targets.
  • .github/workflows/release.yml:
    • Two new matrix entries on ubuntu-latest using napi build … -x, which drives cargo-zigbuild under the hood for musl cross-compile.
    • mlugg/setup-zig + taiki-e/install-action (cargo-zigbuild) steps gated on contains(matrix.settings.target, 'musl') so only the musl jobs pay the toolchain-install cost.
    • Publish step temporarily reverted to NPM_TOKEN auth. 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

  • CI matrix builds the two musl targets green (zig + cargo-zigbuild setup, then napi build)
  • Release-please opens a feat: release PR
  • On merge: napi prepublish publishes the two new musl packages with the NPM_TOKEN bootstrap; main package publishes via trusted publishing
  • Smoke test green

After this lands

Quick one-time cleanup, mirroring the original v2.0.x bootstrap:

  1. Configure trusted publishing on npmjs.com for config-disassembler-linux-x64-musl and config-disassembler-linux-arm64-musl (publisher: this repo + this workflow).
  2. Open a one-line follow-up PR reverting the napi prepublish step from NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} back to NODE_AUTH_TOKEN="".
  3. Delete the NPM_TOKEN repo secret.

Downstream

No code changes needed in sf-decomposer once 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.

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>
@mcarvin8 mcarvin8 merged commit 9f51662 into main May 13, 2026
3 checks passed
@mcarvin8 mcarvin8 deleted the cursor/add-musl-targets branch May 13, 2026 12:39
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.

1 participant