fix: support older glibc and musl NAPI builds#460
Merged
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds musl-based Linux (x86_64, aarch64) NAPI build targets across nightly and publish GitHub Actions workflows, unifying Linux cross-compilation via zig/cargo-zigbuild with GLIBC version verification. Updates the native module's package.json targets, runtime musl detection/binary selection logic in index.js, and dry-run validation script accordingly. ChangesCI musl build and publish support
Runtime musl detection and package resolution
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Workflow as build-napi (nightly/publish)
participant Zig as zig / cargo-zigbuild
participant Verify as Native dependency check
participant Artifacts as binding-packages / publish
Workflow->>Zig: build target (gnu or musl)
Zig->>Workflow: produced .so shared library
Workflow->>Verify: extract GLIBC version or symbols
Verify->>Verify: fail if GLIBC exceeds LINUX_GLIBC_VERSION (gnu) or GLIBC symbols found (musl)
Verify->>Artifacts: copy .node artifact into target_map path
Artifacts->>Artifacts: publish binding-packages including *-musl directories
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
@ox-content/binding-darwin-arm64
@ox-content/binding-darwin-x64
@ox-content/binding-linux-arm64-gnu
@ox-content/binding-linux-arm64-musl
@ox-content/binding-linux-x64-gnu
@ox-content/binding-linux-x64-musl
@ox-content/binding-win32-x64-msvc
@ox-content/napi
@ox-content/islands
@ox-content/unplugin
@ox-content/vite-plugin
@ox-content/vite-plugin-react
@ox-content/vite-plugin-svelte
@ox-content/vite-plugin-vue
commit: |
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
Root Cause
The published Linux NAPI artifacts were built as GNU-only binaries on current Linux runners, so consumers on older glibc distributions could hit runtime loader failures from newer GLIBC symbol requirements. Alpine/musl environments also had no matching binding package.
Validation
node --check crates/ox_content_napi/index.jsnode --check scripts/package-dry-run.mjscargo test -p ox_content_napi javascript_wrapper -- --nocapturenode scripts/package-dry-run.mjslibc: musl..github/workflows/publish.ymland.github/workflows/nightly.ymlas YAML.actionlint; it only reported the existing customblacksmith-32vcpu-ubuntu-2404runner label as unknown.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
Bug Fixes
Tests