Skip to content

Support Node v12.0.0#544

Open
lxe wants to merge 1 commit intonode-ffi:masterfrom
lxe:node-12
Open

Support Node v12.0.0#544
lxe wants to merge 1 commit intonode-ffi:masterfrom
lxe:node-12

Conversation

@lxe
Copy link
Copy Markdown
Contributor

@lxe lxe commented Apr 26, 2019

TODO: Properly Nan-ify. This is a bit of a frankenstein

Osmose pushed a commit to Osmose/node-ffi that referenced this pull request May 2, 2019
@sanchezpablo
Copy link
Copy Markdown

Any progress on this? I need it for electron 5 compatibility (node v12). Thanks!

@javiergarmon
Copy link
Copy Markdown

This pull request works properly at Electron 5 and Node.js v12. Please merge it!

@sanchezpablo
Copy link
Copy Markdown

I've build my application with electron 5 and the pull request and also works fine, maybe it should be merged in order to use this fantastic module in future electron releases? thanks in advance!

@Zihn
Copy link
Copy Markdown

Zihn commented May 23, 2019

For me it worked as well! It would be nice to have it as an official release.

@elonsalfati
Copy link
Copy Markdown

Is there an update on this PR?

@derberg
Copy link
Copy Markdown

derberg commented Jun 24, 2019

@TooTallNate any chance to get this merged and released?

@derberg
Copy link
Copy Markdown

derberg commented Jun 24, 2019

@lxe could you make some additional commit to the PR to trigger CI jobs again as for now, the PR looks like not working. Also, I see in package.json that you are using your forks as dependencies. Do you even consider this PR as a completed work?

@javenwang
Copy link
Copy Markdown

javenwang commented Jun 28, 2019

seems that we need to wait for TooTallNate/ref#114 which depends on TooTallNate/node-weak#98

@EternallLight
Copy link
Copy Markdown

For me, it did not work with Electron 5.0.6 and Node 12.
Will be using Electron 4 and waiting for the official fix.

@andyvanee
Copy link
Copy Markdown

Just as another data point, I have got FFI working in the node:12 docker image by using the following:

FROM node:12

ENV NODE_PATH=/usr/local/lib/node_modules

RUN npm install -g lxe/node-ffi#node-12 lxe/ref#node-12 lxe/ref-struct#node-12 --unsafe-perm

This works for now until this makes it into an official release.

@radu-iosif-moldovan
Copy link
Copy Markdown

I got it working with electron 5 and node 12.3.1 but with electron 6 this still fails. Any chance to make it Electron 6 compatible?

@bruceauyeung
Copy link
Copy Markdown

works good for me. but imho the following versions should not be changed to another github repositories :

"ref": "lxe/ref#node-12",
"ref-struct": "lxe/ref-struct#node-12"
"ref-array": "lxe/ref-array#node-12"

maybe you can push those modifications related to ref / ref-struct /ref-array to corresponding repo before this one?

really appreciated ! expect this one being merged asap.

@lxe @diegozhu

@bruceauyeung
Copy link
Copy Markdown

I got it working with electron 5 and node 12.3.1 but with electron 6 this still fails. Any chance to make it Electron 6 compatible?

works well with Electron 6.0.12 ( builtin node 12.x)

aguynamedben added a commit to getcommande/NodObjC that referenced this pull request Oct 16, 2019
Following the instructions listed here:
TooTallNate#111 (comment)

Then will use the branches listed here:
node-ffi/node-ffi#544
aguynamedben added a commit to getcommande/NodObjC that referenced this pull request Oct 16, 2019
@bluthen
Copy link
Copy Markdown

bluthen commented Oct 23, 2019

I think since built on napi ffi-napi should be more stable across node versions: https://github.com/node-ffi-napi/node-ffi-napi

@aabuhijleh
Copy link
Copy Markdown

Thanks @lxe. I'm having some trouble using this in Electron 7 (Node 12.8.1)

There are a lot of build errors when using that version.

@Venryx Venryx mentioned this pull request Dec 13, 2019
@Venryx
Copy link
Copy Markdown

Venryx commented Dec 13, 2019

I tried a local version of the install command above: npm install lxe/node-ffi#node-12 lxe/ref#node-12 lxe/ref-struct#node-12

However, this failed in my project, with many errors in the .cc files.

I was eventually able to get it to work by:

  1. Creating an empty folder somewhere else.
  2. Running npm init and using all the defaults (to create a package.json).
  3. Running the local install command above.
  4. Copying all the contents of the node_modules folder, and pasting it into the node_modules folder of my actual project. (On one of them, this worked right away. In another, it had an issue since there were other packages that needed rebuilding; I had to npm rebuild TheOtherPackage, then re-copy the temp node_modules folder -- except for this second pass I said "skip all" for the file conflicts.)

Messy workaround, but my project is compiling again, so it's good enough for now. Hopefully @TooTallNate will have some time soon to review the pull-requests...

Venryx added a commit to Venryx/vdm-window-manager that referenced this pull request Dec 13, 2019
@roy2651
Copy link
Copy Markdown

roy2651 commented Dec 16, 2019

I got it working with electron 5 and node 12.3.1 but with electron 6 this still fails. Any chance to make it Electron 6 compatible?

do you use electron5 and node 12 is ok? how to use it ? I’m working on this repo https://github.com/TooTallNate/NodObjC.git

@atestb
Copy link
Copy Markdown

atestb commented Feb 23, 2020

Hello! These packages have been the silver bullet for me for node 12 LTS:
npm install lxe/node-ffi#node-12 lxe/ref#node-12 lxe/ref-struct#node-12
Thanks for handing out those branches.

@Venryx
Copy link
Copy Markdown

Venryx commented May 1, 2020

Update: I've recently switched to using ffi-napi, and it's been working well so far. (after this slight speed-bump, due to me using an old version...)

The main reason for me switching is just that the ffi-napi library is still being maintained; this one has not been updated in over a year, and has not had a meaningful update in more than 2. (it's also broken on Node 12 and up, without the fixes above in this thread -- which for me at least, do not apply properly without installation tricks, and will likely break for node 14+ anyway)

@bruceauyeung
Copy link
Copy Markdown

Update: I've recently switched to using ffi-napi, and it's been working well so far. (after this slight speed-bump, due to me using an old version...)

The main reason for me switching is just that the ffi-napi library is still being maintained; this one has not been updated in over a year, and has not had a meaningful update in more than 2. (it's also broken on Node 12 and up, without the fixes above in this thread -- which for me at least, do not apply properly without installation tricks, and will likely break for node 14+ anyway)

agreed. IMO node-ffi-napi is the future and should be recommended.

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.