Skip to content

npm: publish musl packages and fix exit code on spawn failure - #1371

Merged
sbdchd merged 5 commits into
sbdchd:masterfrom
TiagoGranelli:npm-musl-packages
Sep 29, 2026
Merged

sbdchd merged 5 commits into
sbdchd:masterfrom
TiagoGranelli:npm-musl-packages

Conversation

@TiagoGranelli

Copy link
Copy Markdown
Contributor

The release already builds squawk-linux-musl-x64 and squawk-linux-musl-arm64, but npm only gets the glibc linux packages. On Alpine, npm install squawk-cli installs @squawk-cli/linux-x64, which can't run there:

$ docker run --rm node:26-alpine sh -c 'npx -y squawk-cli@2.66.0 --version; echo "exit=$?"'
error: failed to invoke squawk
Error: spawn .../node_modules/@squawk-cli/linux-x64/bin/squawk ENOENT
exit=0

It also exits 0, so a lint step in CI passes without checking anything. The process.exit(1) from #1130 got lost when the wrapper moved to js/index.js in #1133.

Changes:

  • restore the exit 1 on spawn errors
  • add @squawk-cli/linux-x64-musl and @squawk-cli/linux-arm64-musl with "libc": ["musl"], and mark the existing linux packages as "libc": ["glibc"] so npm installs only one
  • the wrapper picks the -musl package when it detects musl (same checks as detect-libc)
  • stage and publish the two packages in the release job, and add them to xtask update-version

Tested by packing the packages with the v2.66.0 release binaries and installing them in node:26-alpine and node:26-slim: npm installs only the matching package, squawk runs, and a failing migration exits 1 on both. I didn't test arm64.

One thing on your side: since publishing uses trusted publishing, I think the two new package names need to exist on npm with the trusted publisher set up before the next release.

sbdchd#1130 added this exit, but it was dropped when the wrapper moved to
js/index.js in sbdchd#1133. Without it a spawn error (for example the glibc
binary on Alpine) prints the error and exits 0, so CI passes without
linting anything.
The release already builds squawk-linux-musl-x64 and
squawk-linux-musl-arm64, but they weren't published to npm, so
`npm install squawk-cli` on Alpine got the glibc binary, which can't run.

Add @squawk-cli/linux-x64-musl and @squawk-cli/linux-arm64-musl with
"libc": ["musl"], mark the existing linux packages as glibc, and pick
the musl package in the wrapper when running on musl.
@netlify

netlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

馃懛 Deploy request for squawkhq pending review.

Visit the deploys page to approve it

Name Link
馃敤 Latest commit e31fcad

@sbdchd sbdchd left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you!

@sbdchd sbdchd added the automerge automerge with kodiak label Sep 28, 2026
@sbdchd
sbdchd merged commit 4f6a617 into sbdchd:master Sep 29, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge automerge with kodiak

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants