-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node-addon-api fails to build against node 4.x #142
Comments
I tweaked the node-test-node-addon-api job a bit: https://ci.nodejs.org/job/node-test-node-addon-api/1/ (nightly - good) |
v6 is also bad: https://ci.nodejs.org/job/node-test-node-addon-api/3/ |
@gabrielschulhof can I assume you are investigating ? It is possible that its related to the async changes that were landed in master/head but I doubt have been backported to 4/6 |
Is this #144? |
@mhdawson almost certainly, since it's precisely async that is tripping things up. |
Actually, node-addon-api fails to build against nov 8.4.0 too. So AFAICT it's basically broken against any version of node other than the latest. |
I'm starting to go through the errors, and I've noticed that we've introduced a call to |
Add two checks that are there for expository reasons as much as they are sanity checks. Refs: nodejs/node-addon-api#142
Yes, see nodejs/node#15681. You could back-port nodejs/node#11652 to v4.x. |
Add two checks that are there for expository reasons as much as they are sanity checks. PR-URL: #15681 Refs: nodejs/node-addon-api#142 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Add two checks that are there for expository reasons as much as they are sanity checks. PR-URL: #15681 Refs: nodejs/node-addon-api#142 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Add two checks that are there for expository reasons as much as they are sanity checks. PR-URL: #15681 Refs: nodejs/node-addon-api#142 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Add two checks that are there for expository reasons as much as they are sanity checks. PR-URL: nodejs/node#15681 Refs: nodejs/node-addon-api#142 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Add two checks that are there for expository reasons as much as they are sanity checks. PR-URL: #15681 Refs: nodejs/node-addon-api#142 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Hmmm ... on node 8.0.0 it's building our copy of node_api.cc and it's creating node-api.a, but then the linker resolves calls to node's own version, meaning the ABI is mismatched, running into segfaults as a result. |
The problem can be solved with |
Static linker or dynamic linker? What do My first hunch is that it's a link order issue. What does |
@bnoordhuis
I think it's a library load time issue. The symbols are available both locally (via node-api.a) and from Node.js, and the dynamic linker is resolving the needed symbols using Node's symbols rather than those from node-api.a, which is statically linked into binding.node. Defining |
Wow! Another weird consequence. The Node.js async execute callback gets called, even though the async work item is created inside node-api.a. |
That is, the version of uvimpl::Work::ExecuteCallback available inside node gets called, not the one available inside node-api.a. |
I have to qualify uvimpl::Work::ExecuteCallback and uvimpl::Work::CompleteCallback with NAPI_EXTERN in order for them to get resolved correctly. |
I also left a comment on nodejs/node#16234 but if you look at the output from nm, there are a lot of symbols in there that probably have no business being weak:
|
* Implement node::MakeCallback between 8.0.0 and 8.6.0 to fix unresolved symbol * Fix error message expectation (was: "Invalid pointer", is: "Invalid argument") * Add -fvisibility=hidden to the compilation of sources of node_api.a so as to avoid conflicts with Node.js symbols Fixes: nodejs#142
* Implement node::MakeCallback between 8.0.0 and 8.6.0 to fix unresolved symbol * Fix error message expectation (was: "Invalid pointer", is: "Invalid argument") * Add -fvisibility=hidden to the compilation of sources of node_api.a so as to avoid conflicts with Node.js symbols Fixes: #142 Fixes: nodejs/abi-stable-node#282
Add two checks that are there for expository reasons as much as they are sanity checks. PR-URL: #15681 Refs: nodejs/node-addon-api#142 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Add two checks that are there for expository reasons as much as they are sanity checks. PR-URL: #15681 Refs: nodejs/node-addon-api#142 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
* Implement node::MakeCallback between 8.0.0 and 8.6.0 to fix unresolved symbol * Fix error message expectation (was: "Invalid pointer", is: "Invalid argument") * Add -fvisibility=hidden to the compilation of sources of node_api.a so as to avoid conflicts with Node.js symbols Fixes: nodejs/node-addon-api#142 Fixes: nodejs/abi-stable-node#282
* Implement node::MakeCallback between 8.0.0 and 8.6.0 to fix unresolved symbol * Fix error message expectation (was: "Invalid pointer", is: "Invalid argument") * Add -fvisibility=hidden to the compilation of sources of node_api.a so as to avoid conflicts with Node.js symbols Fixes: nodejs/node-addon-api#142 Fixes: nodejs/abi-stable-node#282
* Implement node::MakeCallback between 8.0.0 and 8.6.0 to fix unresolved symbol * Fix error message expectation (was: "Invalid pointer", is: "Invalid argument") * Add -fvisibility=hidden to the compilation of sources of node_api.a so as to avoid conflicts with Node.js symbols Fixes: nodejs/node-addon-api#142 Fixes: nodejs/abi-stable-node#282
* Implement node::MakeCallback between 8.0.0 and 8.6.0 to fix unresolved symbol * Fix error message expectation (was: "Invalid pointer", is: "Invalid argument") * Add -fvisibility=hidden to the compilation of sources of node_api.a so as to avoid conflicts with Node.js symbols Fixes: nodejs/node-addon-api#142 Fixes: nodejs/abi-stable-node#282
Observe build failure.
The text was updated successfully, but these errors were encountered: