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

pre-gyp looks for the wrong ABI in electron childProcess.forks #278

Closed
bcomnes opened this issue Mar 28, 2017 · 6 comments
Closed

pre-gyp looks for the wrong ABI in electron childProcess.forks #278

bcomnes opened this issue Mar 28, 2017 · 6 comments

Comments

@bcomnes
Copy link

bcomnes commented Mar 28, 2017

It appears node-pre-gyp modules are trying to use the wrong ABI when run inside of a childProcess.fork from an electron process, even if you have rebuilt the correct ABI using something like electron-rebuild. It looks like this problem has been around a while, and even a few hacks came and went.

Here is an example of the issue with sqlite3: https://github.com/ballpit/electron-sqlite3-fork-bug/blob/master/main.js

It looks like node-gyp-build had a similar issue a while back, and they ended up implementing a check for the process.env.ELECTRON_RUN_AS_NODE and returning electron bindings when thats found, and it looks like maybe we need to port that over to node-pre-gyp as well to fix this problem.

It looks like the ABI selection is happening in https://github.com/mapbox/node-pre-gyp/blob/master/lib/util/versioning.js. Any idea where such a check might live in that file?

@bcomnes bcomnes changed the title pre-gyp looks for the wrong ABI in electron childProcess.fork's pre-gyp looks for the wrong ABI in electron childProcess.forks Mar 28, 2017
bcomnes added a commit to bcomnes/node-pre-gyp that referenced this issue Mar 29, 2017
bcomnes added a commit to bcomnes/node-pre-gyp that referenced this issue Apr 12, 2017
bcomnes added a commit to bcomnes/node-pre-gyp that referenced this issue May 4, 2017
bcomnes added a commit to bcomnes/node-pre-gyp that referenced this issue May 5, 2017
@Tomyail
Copy link

Tomyail commented Jan 12, 2018

any update for this issue? I need this pull request

@Tomyail
Copy link

Tomyail commented Jan 12, 2018

I create a pull request for this issue

@bcomnes
Copy link
Author

bcomnes commented Sep 11, 2018

This is my original PR to close this: #279

Open to either solution, but I think we should aim to make this work without user provided env vars.

@bcomnes
Copy link
Author

bcomnes commented Apr 30, 2019

This should be resolved, however I haven't personally tested.

@bcomnes bcomnes closed this as completed Apr 30, 2019
@awohletz
Copy link

Confirmed that updating to Electron v6 (currently in beta) fixed the issue for me. E.g. I am able to use node-sqlite3 from an Electron-forked process.

@bcomnes
Copy link
Author

bcomnes commented Jun 25, 2019

@awohletz that's great news thank you for the info!

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 a pull request may close this issue.

3 participants