journeyapps / node-sqlcipher

SQLCipher bindings for Node
https://journeyapps.com
BSD 3-Clause "New" or "Revised" License
207 stars 66 forks source link

Build native modules with electron runtime #70

Closed rkistner closed 3 years ago

rkistner commented 3 years ago

Target electron runtime to build the name module with node-pre-gyp. This forces the external openssl library to be linked, instead of Node's one.

This now also runs tests using electron-mocha on Windows again.

The issue was that since version 5.0.0, we use the same native modules for both NodeJS and Electron, which is possible from using NAPI. But when building for Node, Node's internal OpenSSL symbols are used, and these are not available in Electron, causing a crash when running in Electron on Windows.

See this for details: https://www.electronjs.org/blog/electron-internals-using-node-as-a-library#shared-library-or-static-library

Fixes #67.

epieddy commented 3 years ago

Yes !! \o/ This seems very promising. My project has been stuck at Electron 9 for a very long time because of this issue. Hope this is the one.