Skip to content

fix: build native addons for every napi target and link Linux glibc addons against glibc 2.17 - #450

Merged
jxom merged 3 commits into
mainfrom
claude/native-addon-targets
Oct 14, 2026
Merged

jxom merged 3 commits into
mainfrom
claude/native-addon-targets

Conversation

@jxom

@jxom jxom commented Oct 14, 2026

Copy link
Copy Markdown
Member

Fixes #449.

Releases shipped only zyzz.linux-x64-gnu.node, built against the runner's glibc 2.39. It failed to load below glibc 2.35 (Vercel, Amazon Linux 2023, Debian 11), and macOS, Windows, and Linux arm64 fell back to WASI.

  • scripts/build-binding.ts takes --target <triple> and links -linux-gnu targets with --use-napi-cross (glibc 2.17 sysroot), keeping PGO.
  • The new Binding workflow builds all 8 native targets on matching runners, with musl inside Alpine since training runs the addon. Each job loads its addon and compiles a module, and glibc addons also load on Debian 11.
  • main.yml runs the matrix only for a version npm lacks, downloads every addon into binding/, and pnpm check:binding fails the publish when one is missing.
$ objdump -T binding/zyzz.linux-x64-gnu.node | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1
GLIBC_2.14

All addons ship in the zyzz tarball (about 12.6 MB raw, 5.2 MB gzip each). Per-platform @zyzz/binding-* packages stay in .agents/plan.md.

Validation: the x64 glibc PGO build loads on the host and in node:22-bullseye-slim, the x64 musl PGO build loads in node:24-alpine, and pnpm check:types and pnpm check pass. This PR's Binding run covers the macOS, Windows, and arm64 targets.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PcBWWdnfcnphvx9aMkiGuH


Generated by Claude Code

…ddons against glibc 2.17

Releases published only the linux-x64-gnu addon, built against the runner's glibc 2.39, so it
failed to load below glibc 2.35 and every other platform fell back to WASI. The Binding workflow
now builds each native target on a matching runner (musl inside Alpine), loads each addon, and
loads the glibc addons on Debian 11. The release job downloads every addon into `binding/`, and
`check:binding` fails the publish when one is missing. `scripts/build-binding.ts` takes
`--target` and links `-linux-gnu` targets with the `@napi-rs/cross-toolchain` glibc 2.17 sysroot.

Fixes #449

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PcBWWdnfcnphvx9aMkiGuH
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T20:07:27.434735Z 057e440 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

napi-rs sets `aarch64-linux-musl-gcc` as the aarch64-unknown-linux-musl linker even on an
aarch64 musl host, where Alpine provides only `cc`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PcBWWdnfcnphvx9aMkiGuH

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad3880b47c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/build-binding.ts Resolved
`scripts/train-binding.ts` loaded the first `.node` file in `binding/`, which could be another
platform's addon. The build now passes the instrumented addon's path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PcBWWdnfcnphvx9aMkiGuH
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage report too large to inline, see the workflow summary.

@pkg-pr-new

pkg-pr-new Bot commented Oct 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/zyzz@450

commit: 057e440

@jxom
jxom merged commit c59662b into main Oct 14, 2026
43 of 64 checks passed
@jxom
jxom deleted the claude/native-addon-targets branch October 14, 2026 20:15
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.

Native addon: linux-x64-gnu needs glibc 2.35 (fails on Vercel); macOS and arm64 have none

2 participants