Skip to content
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

The latest minor version update broke ffi-napi compatibility #52240

Closed
lingyuj opened this issue Mar 28, 2024 · 7 comments
Closed

The latest minor version update broke ffi-napi compatibility #52240

lingyuj opened this issue Mar 28, 2024 · 7 comments

Comments

@lingyuj
Copy link

lingyuj commented Mar 28, 2024

The widely used ffi-napi module won't build with the latest minor update across almost all version.
It can build with ~ 20.11.1, ~ 21.5.0
But failed with 20.12.0, 21.6.0 ~

The error log is :
npm ERR! /home/mark/Projects/eudiw-app/node_modules/node-addon-api/napi-inl.h:63:47: error: invalid conversion from ‘napi_finalize’ {aka ‘void ()(napi_env__, void*, void*)’} to ‘node_api_nogc_finalize’ {aka ‘void ()(const napi_env__, void*, void*)’} [-fpermissive]

@cclauss
Copy link
Contributor

cclauss commented Mar 28, 2024

Unfortunately the continuous integration tests on the node-ffi-napi repo have not been updated in three years and they run on a long expired version of Node.js. Those tests need to be brought up to date and the relevant bugs fixed.

Closing in favor of

@genaris
Copy link

genaris commented Apr 5, 2024

So basically the only explanation is that node-ffi-napi is too old and is not going to be supported anymore? Isn't there any workaround that does not involve using other FFI libraries?

@cclauss
Copy link
Contributor

cclauss commented Apr 5, 2024

There is a fork that some people have said works but your mileage may vary...

@genaris
Copy link

genaris commented Apr 5, 2024

Well, it seems that the issue started after 7a216d5, since it introduces a breaking change in napi_finalize experimental feature (it now defines node_api_nogc_finalizeand node_api_nogc_env). This breaks node-ffi-napi because it is unfortunately being built with NAPI_EXPERIMENTAL flag set (it seems it was enabled temporarily, waiting for the release of node 12.17, but probably was left by mistake or the fact that the repo is unmaintained).

I ended up updating the fork at https://github.com/2060-io/node-ffi-napi, which was created to fix other issues (with its sibling ref-napi). I'm currently testing with the npm release 4.0.8, so far so good!

@Galkon
Copy link

Galkon commented Jun 25, 2024

Well, it seems that the issue started after 7a216d5, since it introduces a breaking change in napi_finalize experimental feature (it now defines node_api_nogc_finalizeand node_api_nogc_env). This breaks node-ffi-napi because it is unfortunately being built with NAPI_EXPERIMENTAL flag set (it seems it was enabled temporarily, waiting for the release of node 12.17, but probably was left by mistake or the fact that the repo is unmaintained).

I ended up updating the fork at https://github.com/2060-io/node-ffi-napi, which was created to fix other issues (with its sibling ref-napi). I'm currently testing with the npm release 4.0.8, so far so good!

If only your fork worked in electron too :(

@btsimonh
Copy link

@genaris - you may wish to enable issues on your repo ( https://github.com/2060-io/node-ffi-napi), so I could add this comment:
pls update to "node-gyp-build": "^4.8.2",
This avoids using old node-gyp-build without shell:true for windows, which has taken me all day to find :(.

@genaris
Copy link

genaris commented Oct 23, 2024

Thanks @btsimonh! I've enabled issues in my repo.

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

No branches or pull requests

5 participants