Fix npm musl artifact builds - #119
Conversation
Move loader post-processing into npm lifecycle scripts so cross-compilation target and Zig arguments reach napi instead of being appended to the postprocessor.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe package separates ChangesBuild script lifecycle
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to 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)
Full details: Docstring CoverageExplanation 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)
Comment |
There was a problem hiding this comment.
🟢 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:debugcommand chain and into npm lifecycle hooks (postbuild/postbuild:debug). - Preserve existing build behavior while allowing
npm run build -- --target ...to correctly forward arguments tonapi 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.
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
--targetand--zigreach napi while preserving normal build behavior.Validation:
npm run build -- --target x86_64-pc-windows-msvcnpm test(8 passed)Summary by CodeRabbit