Skip to content

fix(deps): disable ctor priority feature#3209

Merged
Brooooooklyn merged 1 commit intomainfrom
fix/ctor-0-9-zig-darwin
Apr 10, 2026
Merged

fix(deps): disable ctor priority feature#3209
Brooooooklyn merged 1 commit intomainfrom
fix/ctor-0-9-zig-darwin

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Apr 10, 2026

Summary

  • opt ctor into its non-priority default features explicitly in crates/napi
  • do the same in crates/macro so the workspace stays consistent on ctor 0.9
  • avoid the Apple/Zig cross-link path that ends up with unresolved section$end$__DATA$CTOR references at runtime

Why

napi-rs only uses plain #[ctor] registration today, not #[ctor(priority = ...)]. After the ctor 0.9 upgrade, the default feature set enables priority, which takes a different Apple implementation path. That path is what shows up in the failing aarch64-apple-darwin Zig job.

This keeps the ctor 0.9 upgrade, but restores the pre-priority behavior by explicitly enabling the other default features and leaving priority off.

Expected impact

  • fixes ERR_DLOPEN_FAILED with symbol not found in flat namespace 'section$end$__DATA$CTOR'
  • no intended runtime behavior change for existing napi-rs module registration

Note

Low Risk
Low risk dependency configuration change that only alters how ctor is built (feature set) to avoid Apple/Zig linker/runtime symbol issues; behavior should be unchanged unless code relied on ctor priority support.

Overview
Forces the ctor dependency to build with default-features = false and an explicit feature list in both crates/napi and crates/macro, intentionally leaving off priority support.

This keeps the workspace consistent on ctor 0.9 while avoiding the Apple/Zig cross-link path that can emit unresolved section$end$__DATA$CTOR references at runtime.

Reviewed by Cursor Bugbot for commit 5015f43. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Chores
    • Updated internal build configuration for dependency features.

Note: This release contains internal maintenance updates with no end-user-visible changes or new features.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5f52870a-e1a0-4dac-8c7f-3b179e6b89dd

📥 Commits

Reviewing files that changed from the base of the PR and between 23c72d1 and 5015f43.

📒 Files selected for processing (2)
  • crates/macro/Cargo.toml
  • crates/napi/Cargo.toml

📝 Walkthrough

Walkthrough

Two Cargo.toml files updated their ctor dependency configuration, disabling default features and explicitly enabling a consistent feature set (std, proc_macro, dtor, no_warn_on_missing_unsafe) across both the macro and napi crates. No functional code changes were made.

Changes

Cohort / File(s) Summary
ctor Dependency Configuration
crates/macro/Cargo.toml, crates/napi/Cargo.toml
Updated ctor dependency from default configuration to explicit feature specification: disabled default features and enabled std, proc_macro, dtor, and no_warn_on_missing_unsafe features.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A rabbit hops through Cargo files,
With feature flags and tweaks so mild,
Default-less, intentional, and clean,
The finest build configuration seen!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(deps): disable ctor priority feature' directly and clearly identifies the main change: disabling the ctor priority feature to fix dependency configuration issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ctor-0-9-zig-darwin

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Brooooooklyn Brooooooklyn enabled auto-merge (squash) April 10, 2026 10:06
@Brooooooklyn Brooooooklyn disabled auto-merge April 10, 2026 10:08
@Brooooooklyn Brooooooklyn merged commit 231a339 into main Apr 10, 2026
74 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/ctor-0-9-zig-darwin branch April 10, 2026 10:08
@github-actions github-actions Bot mentioned this pull request Apr 10, 2026
@mmastrac
Copy link
Copy Markdown
Contributor

@Brooooooklyn, I just noticed this issue -- I'll try to fix this upstream in ctor.

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