fix(napi): support ZeroMQ libuv addon symbols#34657
Conversation
|
Does this fix #28621? |
|
Yes, this is intended to fix #28621. The ZeroMQ addon failed during native addon loading because Deno did not export libuv symbols that zeromq links against, starting with uv_unref. This PR adds the missing libuv/N-API compatibility shims used by zeromq native addon initialization and covers them with N-API tests. |
|
Intended to fix? Did you run the repro and it worked? |
|
I reran the repro after the latest fix. It now works for the reported path: import { Subscriber } from "npm:[email protected]";
const socket = new Subscriber();
console.log(socket.constructor.name);
socket.close();Command used against timeout 20s target/debug/deno run --allow-read --allow-env --allow-ffi --allow-run main.tsOutput: Before the latest commit the original |
|
Update PR desc and title to be more specific |
Co-Authored-By: Divy Srivastava <[email protected]>
Co-Authored-By: Divy Srivastava <[email protected]>
Co-Authored-By: Divy Srivastava <[email protected]>
Co-Authored-By: Divy Srivastava <[email protected]>
Co-Authored-By: Divy Srivastava <[email protected]>
Co-Authored-By: Divy Srivastava <[email protected]>
Co-Authored-By: Divy Srivastava <[email protected]>
Co-Authored-By: Divy Srivastava <[email protected]>
cfa6de5 to
65f248a
Compare
Co-Authored-By: Divy Srivastava <[email protected]>
65f248a to
8b4b328
Compare
Closes #28621
Closes denoland/divybot#391
Fixes loading
[email protected]by exporting the libuv/N-API compatibility shims its native addon links against.This adds support for the missing libuv helpers used during ZeroMQ socket initialization:
uv_check_*,uv_idle_*, anduv_poll_*uv_queue_workuv_os_getpiduv_ref/uv_unref/uv_has_refbehavior for shimmed handlesIt also allows
napi_new_instancenative constructors to call back into JavaScript, which ZeroMQ does viaObject.seal(this)while constructing its context/socket objects.Verification:
import { Subscriber } from "npm:[email protected]"now printsSubscriberand exits.