-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
prebuilt: add electron 9.0, 8.3 and 7.3 #1335
Conversation
Segmentation fault for Electron v9 happens in my macOS environment. |
Here is smallest example to reproduce segmentation fault with Electron v9.0.0 and macOS 10.14.6. describe('sample of segmentation fault', function() {
var db;
it('should open the database', function(done) {
db = new sqlite3.Database(':memory:', sqlite3.OPEN_READONLY, function(err) {
assert.ok(false);
done();
});
});
}); |
In short: this project builds napi version library for electron test, not electron, even if we set DetailsCI test for electron build using scripts/build_against_electron.sh. $ ELECTRON_VERSION=9.0.0 NODE_VERSION=12 TRAVIS_OS_NAME=osx ./scripts/build_against_electron.sh
$ find . -name "*.node"
./build-tmp-napi-v3/Release/node_sqlite3.node
./node_modules/fsevents/fsevents.node
./lib/binding/napi-v3-darwin-x64/node_sqlite3.node I install node-sqlite3 outside of node-sqlite3: $ mkdir electron-9-sqlite3-sample && cd electron-9-sqlite3-sample
$ npm init -y
$ npm install sqlite3 --runtime=electron --target=9.0.0 --dist-url=https://electronjs.org/headers
$ find . -name "*.node"
./node_modules/sqlite3/lib/binding/electron-v9.0-darwin-x64/node_sqlite3.node
./node_modules/sqlite3/build/Release/node_sqlite3.node I find paths of node_sqlite3.node of each project are different. $ cp ../electron-9-sqlite3-sample/node_modules/sqlite3/lib/binding/electron-v9.0-darwin-x64/node_sqlite3.node \
lib/binding/napi-v3-darwin-x64/node_sqlite3.node Now, electron-mocha don't crash. $ cat ./test/hoge.test.js
var sqlite3 = require('..');
describe('sample', function() {
var db;
it('should open the database', function(done) {
db = new sqlite3.Database(':memory:', sqlite3.OPEN_READONLY, function(err) {
assert.ok(false);
done();
});
});
});
$ yarn run electron-mocha ./test/hoge.test.js
sample of test
1) should open the database
0 passing (56ms)
1 failing
1) sample
should open the database:
Uncaught ReferenceError: assert is not defined
at Database.<anonymous> (test/hoge.test.js:6:13) IMO, it needs to overwrite |
Thank you, once again, for your contributions @mtgto It does seem like the paths are wrong, this will require some investigation. Anyways, we have fully converted to N-API but the pathing still seems off. |
Technically, with the new N-API support we should already be able to support electron 9.0.0 without adding it to our build matrix. (Same goes for any future Electron release, even 8.3 & 7.3, etc..) |
Wow, it is nice. I found I had a mistake in my last comment:
I install node-sqlite3 v4.2.0, which is latest released version, outside of node-sqlite3 repo. I checkout sqlite3 v4.2.0 tag, build for Electron v9.0 with $ git clone [email protected]:mapbox/node-sqlite3.git node-sqlite3-v42 && cd node-sqlite3-v42
$ git checkout v4.2.0
$ npm install --runtime=electron --target=9.0.0 --dist-url=https://electronjs.org/headers --build-from-source --clang=1
$ electron --version
v9.0.0
$ cat test/hoge.test.js
var sqlite3 = require('..');
describe('sample of segmentation fault', function() {
var db;
it('should open the database', function(done) {
db = new sqlite3.Database(':memory:', sqlite3.OPEN_READONLY, function(err) {
throw new Error("THIS IS UNHANDLED");
});
});
});
$ electron-mocha -R spec test/hoge.test.js
sample of segmentation fault
1) should open the database
0 passing (10ms)
1 failing
1) sample of segmentation fault
should open the database:
Uncaught Error: THIS IS UNHANDLED
at Database.<anonymous> (test/hoge.test.js:7:19) |
@mtgto I'm not sure if this is still relevant/needed 🤔 I'm going to close it for now but please let me know if the issue persists on |
https://github.com/electron/electron/releases/tag/v9.0.0
https://github.com/electron/electron/releases/tag/v8.3.0
https://github.com/electron/electron/releases/tag/v7.3.0
I don't test with new electron version.
Do you wish to continue to support prebuilt for Electron v6?