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

Add support for electron v26 prebuilds #1042

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

m4heshd
Copy link
Contributor

@m4heshd m4heshd commented Aug 15, 2023

Stable electron v26 just released. Prebuilds were tested here.

@m4heshd m4heshd requested review from JoshuaWise and a team as code owners August 15, 2023 06:43
@felixrieseberg
Copy link
Contributor

(I just want to say thank you!)

@KillerCodeMonkey
Copy link

is it possible to automate this? grab all major versions of the electron npm package -> build for latest x versions?

Electron only supports the latest 3 major versions. so maybe for older projects support the latest 5.

@m4heshd
Copy link
Contributor Author

m4heshd commented Aug 17, 2023

is it possible to automate this?

Possible but not recommended. The whole dependency tree responsible for building is way too unreliable for automation to be stable. We always say a quick prayer before building for the latest Electron release.

Electron only supports the latest 3 major versions. so maybe for older projects support the latest 5.

The prebuild support is determined by whatever Node versions are being actively supported. That's why we still build for Electron v16, which ships with embedded Node v16 (still in active maintenance).

@KillerCodeMonkey
Copy link

@m4heshd alrighty. i just asked it for the electron part, because you are building it for very old electron versions, which are not supported by electron for a long time. but i am fine with your answer. thank you very much :)

@m4heshd
Copy link
Contributor Author

m4heshd commented Aug 17, 2023

i just asked it for the electron part

That's exactly what I explained. Even though Electron drops support for these versions pretty quickly, they still ship with actively maintained Node versions (I'm assuming here that you already know about how Electron carries its own copy of Node as a library).

If you run Electron v16 with ELECTRON_RUN_AS_NODE=1 env, it'll simply run the Node v16 runtime, just with a different ABI version tag. That's why we build for super old Electron versions.

@KillerCodeMonkey
Copy link

(I'm assuming here that you already know about how Electron carries its own copy of Node as a library).

Yes (And i got in trouble because of that (i am looking at you openssl vs boringssl ^^), but...

If you run Electron v16 with ELECTRON_RUN_AS_NODE=1 env, it'll simply run the Node v16 runtime, just with a different ABI version tag

this not. Thanks for further explanation 👍

Copy link
Member

@mceachen mceachen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mceachen mceachen merged commit 40be681 into WiseLibs:master Aug 17, 2023
14 checks passed
@ferminc
Copy link

ferminc commented Aug 18, 2023

Just tried it with electron forge (vite template, electron@26.0.0 and better-sqlite3@8.5.1) and it's not working, everything works when I downgrade to electron@25.5.0 and better-sqlite3@8.5.0, anyone else having problems?

@KillerCodeMonkey
Copy link

Do you use the correct nodes version in your project?

Electron 26 is using node 18.16.1

https://www.electronjs.org/blog/electron-26-0

@m4heshd
Copy link
Contributor Author

m4heshd commented Aug 19, 2023

@ferminc It's possible that your native modules aren't properly rebuilt for the newer version of Electron you're using. Since you're using electron-forge, you need to run electron-rebuild to trigger a rebuild of native modules against the Electron version you're using.

@KillerCodeMonkey
Copy link

i can confirm everything is working with electron-builer, electron 26 and latest better-sqlite

@linonetwo
Copy link

Did you encounter electron/electron#39600 in electron 26?

@ferminc
Copy link

ferminc commented Aug 21, 2023

This is the error I'm getting [6816:0821/172133.060:ERROR:crashpad_client_win.cc(844)] not connected with electron forge, steps to reproduce (I'm using windows 11):

  • yarn create electron-app my-new-app --template=vite

  • cd my-new-app

  • yarn add better-sqlite3

  • in src/main.js add:
    const db = require('better-sqlite3')('foobar.db'); db.pragma('journal_mode = WAL');

  • yarn start

  • remove electron and better-sqlite3, then yarn add electron@25.5.0 and yarn add better-sqlite3@8.5.0 to check that those versions still work

So, maybe there's something going on with forge, I haven't tried using electron-builder

@tianakack
Copy link

This is the error I'm getting [6816:0821/172133.060:ERROR:crashpad_client_win.cc(844)] not connected with electron forge, steps to reproduce (I'm using windows 11):

  • yarn create electron-app my-new-app --template=vite
  • cd my-new-app
  • yarn add better-sqlite3
  • in src/main.js add:
    const db = require('better-sqlite3')('foobar.db'); db.pragma('journal_mode = WAL');
  • yarn start
  • remove electron and better-sqlite3, then yarn add electron@25.5.0 and yarn add better-sqlite3@8.5.0 to check that those versions still work

So, maybe there's something going on with forge, I haven't tried using electron-builder

I've also encountered this issue. Was your issue resolved? How it resolved?

@ferminc
Copy link

ferminc commented Sep 11, 2023

This is the error I'm getting [6816:0821/172133.060:ERROR:crashpad_client_win.cc(844)] not connected with electron forge, steps to reproduce (I'm using windows 11):

  • yarn create electron-app my-new-app --template=vite
  • cd my-new-app
  • yarn add better-sqlite3
  • in src/main.js add:
    const db = require('better-sqlite3')('foobar.db'); db.pragma('journal_mode = WAL');
  • yarn start
  • remove electron and better-sqlite3, then yarn add electron@25.5.0 and yarn add better-sqlite3@8.5.0 to check that those versions still work

So, maybe there's something going on with forge, I haven't tried using electron-builder

I've also encountered this issue. Was your issue resolved? How it resolved?

They haven't release a fix yet, but you can fix it yourself rebuilding manually: #1044 (comment)

you'll need to have visual studio and python installed

@jepiqueau
Copy link

I got the same issue with @capacitor-community/sqlite which use better-sqlite3-multiple-ciphers for the Electron part of the plugin capacitor-community/sqlite-issue#474. The plugin work fine with Electron 25.8.4 and better-sqlite3-multiple-ciphers 8.4.0 but when i upgrade Electron to 26.1.0 it failed:

called ipcMain.handle: CapacitorSQLite-open
/Volumes/Development_Lacie/Development/ionic7/angular-sqlite-app-starter/electron/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron exited with signal SIGSEGV
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Electron [23496]
Path:                  /Volumes/VOLUME/*/Electron.app/Contents/MacOS/Electron
Identifier:            com.github.Electron
Version:               26.2.4 (26.2.4)
Code Type:             X86-64 (Native)
Parent Process:        node [23495]
Responsible:           Terminal [1462]
User ID:               501

Date/Time:             2023-10-01 11:50:01.7501 +0200
OS Version:            macOS 12.6.9 (21G726)
Report Version:        12
Bridge OS Version:     3.0 (14Y910)
Anonymous UUID:        F52BD279-4C53-B6B9-C38C-1439CFB5C8F0


Time Awake Since Boot: 19000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  CrBrowserMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000014078
Exception Codes:       0x0000000000000001, 0x0000000000014078
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [23496]

VM Region Info: 0x14078 is not in any region.  Bytes before following region: 4516044680
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      10d2ea000-10d2ec000    [    8K] r-x/r-x SM=COW  ...acOS/Electron

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0   better_sqlite3.node           	       0x11425bd6c Statement::JS_new(v8::FunctionCallbackInfo<v8::Value> const&) + 188
1   Electron Framework            	       0x11fae5304 v8::internal::Accessors::MakeAccessor(v8::internal::Isolate*, v8::internal

my node version is v18.17.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants