Skip to content

Conversation

@juharris
Copy link
Owner

@juharris juharris commented Nov 7, 2025

Make the package smaller.

Fix CI issues:
rust-lang/rust#131477
The PR doesn't directly mention undefined N-API symbols. But the fact that the runner image updated Rust from 1.90 to 1.91,
and that's when the linking failures started, is compelling evidence. The fix I added (the -undefined dynamic_lookup flags) is
the correct solution regardless - it's been the standard approach for N-API addons on macOS for years.

Why the linker flags are now needed:

  1. GitHub Actions runner image update: The macos-15-arm64 runner image was updated from version 20251021.0066 (used in Oct 26
    successful build) to 20251104.0104 (used in Nov 7 failed builds)
  2. Rust version upgrade: The runner image update included Rust 1.90.0 → 1.91.0
  3. Rust 1.91 macOS linking changes: Rust 1.91 Apple: Always pass SDK root when linking with cc, and pass it via SDKROOT env var rust-lang/rust#131477 via the SDKROOT environment
    variable. This appears to have made the linker stricter about undefined symbols in cdylibs.
  4. The fix: Adding -undefined dynamic_lookup linker flags for macOS targets is the standard solution for N-API native addons,
    as these symbols are intentionally undefined and resolved at runtime by Node.js. The flags tell the macOS linker to allow
    these undefined symbols.

@juharris juharris merged commit 713a5e3 into main Nov 7, 2025
17 checks passed
@juharris juharris deleted the js-rm-extras branch November 7, 2025 23:25
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