Feat: upgrade electron to version 25 and enforce source compilation for native modules#331
Open
egalvis27 wants to merge 3 commits intofeat/go-fuse-daemonfrom
Open
Feat: upgrade electron to version 25 and enforce source compilation for native modules#331egalvis27 wants to merge 3 commits intofeat/go-fuse-daemonfrom
egalvis27 wants to merge 3 commits intofeat/go-fuse-daemonfrom
Conversation
…or native modules
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What is Changed / Added
Problem
The app was crashing with a segmentation fault immediately after loading the SQLite database. GDB traced the crash to
Statement::JS_new()insidebetter-sqlite3.node.Root cause: Electron 23 and 25 both assign module ABI 116, so version checks pass — but they ship different V8 versions:
The official
better-sqlite3prebuilt forelectron-v116was compiled against Electron 24 (V8 11.0). Running it under Electron 25 (V8 11.4) causes an internal V8 layout mismatch that segfaults inStatement::JS_new().A secondary motivation for the upgrade:
fs.statfs(used byNodeTemporalFileRepository) was added in Node 18.15.0. Electron 23 bundles Node 18.12.2, which does not have it — causing aTypeError: fs.statfs is not a functioncrash in production.Changes
package.jsonelectronfrom^23.3.13→^25.0.0(resolves to25.9.8), which bundles Node 18.15.0 and V8 11.4.beforeBuild.jsnpm_config_build_from_source = 'true'before callingelectron-rebuild, which forcesprebuild-installto skip the prebuilt download and fall back tonode-gyp rebuildusing the correct Electron headers fromhttps://electronjs.org/headers.force: trueto theelectron-rebuildcall to bypass the.forge-metacache, ensuring the binary is always recompiled for the active Electron version.Verification
better-sqlite3compiled and tested against Electron 25 V8 11.4 — no crash..debcontains the source-compiledbetter_sqlite3.node(confirmed by Build ID change).