Skip to content

Fix npm musl artifact builds - #119

Merged
shps951023 merged 1 commit into
mainfrom
fix/npm-musl-artifacts
Sep 3, 2026
Merged

Fix npm musl artifact builds#119
shps951023 merged 1 commit into
mainfrom
fix/npm-musl-artifacts

Conversation

@shps951023

@shps951023 shps951023 commented Sep 3, 2026

Copy link
Copy Markdown
Member

The initial npm publication assembled only six of eight native addons because npm appended workflow target arguments to the loader postprocessor instead of napi build. Both musl jobs consequently uploaded GNU binaries that were overwritten during artifact download.

This moves loader post-processing to npm lifecycle hooks so --target and --zig reach napi while preserving normal build behavior.

Validation:

  • npm run build -- --target x86_64-pc-windows-msvc
  • npm test (8 passed)

Summary by CodeRabbit

  • Chores
    • Updated build workflows so post-build processing runs automatically after standard and debug builds.

Move loader post-processing into npm lifecycle scripts so cross-compilation target and Zig arguments reach napi instead of being appended to the postprocessor.
Copilot AI lite review requested due to automatic review settings September 3, 2026 08:52
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 46d9e55f-5fe8-43b7-9c8a-257149fd0c54

📥 Commits

Reviewing files that changed from the base of the PR and between cb57dd0 and de4b35f.

📒 Files selected for processing (1)
  • minipdf-node/package.json

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The package separates napi build commands from loader postprocessing. Matching postbuild scripts now run the postprocessing step automatically after release and debug builds.

Changes

Build script lifecycle

Layer / File(s) Summary
Separate build and postbuild scripts
minipdf-node/package.json
build and build:debug now contain only their respective napi build commands. New postbuild and postbuild:debug scripts run node scripts/postprocess-loader.js automatically after each build.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to de4b3

Native build postprocessing now runs through matching npm lifecycle hooks, allowing cross-compilation arguments to reach the build command. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing npm musl artifact builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/npm-musl-artifacts

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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.

🟢 Approval recommended

The change is localized to npm scripts and correctly prevents extra arguments from being appended to the post-processing command while keeping post-processing in place via lifecycle hooks.

Pull request overview

This PR fixes Node native addon artifact builds for musl targets by ensuring workflow CLI arguments (e.g., --target, --zig) are passed to napi build rather than being inadvertently applied to the loader post-processing step.

Changes:

  • Split loader post-processing out of the build/build:debug command chain and into npm lifecycle hooks (postbuild / postbuild:debug).
  • Preserve existing build behavior while allowing npm run build -- --target ... to correctly forward arguments to napi build.
File summaries
File Description
minipdf-node/package.json Moves loader post-processing into npm post-* lifecycle scripts so extra CLI args reach napi build correctly.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@shps951023
shps951023 merged commit af0617d into main Sep 3, 2026
8 checks passed
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.

2 participants