Fix V8 external API usage for Electron 42#1475
Conversation
983b794 to
9050b50
Compare
Electron 42 ships V8 14.8, where v8::External::New and v8::External::Value require an ExternalPointerTypeTag. This breaks native rebuilds with Electron 42 headers. Add small compatibility macros for v8::External creation/access, following the existing V8 version-guard pattern used for prior Electron compatibility fixes such as WiseLibs#1459. Also pass nullptr to SetNativeDataProperty to avoid ambiguous overload resolution for a missing setter. Verified with npm test and an Electron 42.1.0 rebuild from source.
9050b50 to
29f2ecd
Compare
|
Related prior work: #1471 also targets newer V8 / Electron 42 build compatibility and touches the same API area. This PR differs in two details found while working through CI:
That keeps Node 25 on the old API while enabling Electron 42 / Node 26 headers, and the current CI matrix passes for Node 22/24/25/26 across Linux, macOS, and Windows. |
|
This is very much needed! |
|
Hi @JoshuaWise , when can this PR be merged and published? |
|
I hope this PR be merged soon. |
…n tests better-sqlite3 12.10.0 fails to compile against Electron 42's V8 (External::New and External::Value now require an ExternalPointerTypeTag; SetNativeDataProperty's setter arg must be nullptr). Apply the upstream version-guarded fix from WiseLibs/better-sqlite3#1475 via pnpm patchedDependencies so install-app-deps builds the native module for Electron. A pretest guard rebuilds it for Node's ABI when needed so Vitest (which runs under Node, not Electron) can load it.
|
This is an important PR. I'm looking forward to its completion. |
better-sqlite3 12.8.0 (and through the current latest 12.10.0) fails to compile against Electron 42's V8 headers. Electron 42 ships V8 13.x / 14.x where v8::External::New and v8::External::Value require an ExternalPointerTypeTag, and v8::Template::SetNativeDataProperty dropped the deprecated overload accepting `int` for the missing-setter slot. @electron/rebuild falls back to source compilation (the project's prebuilt binaries do not yet cover Electron 42's NMV 146) and the compile errors surface as: - v8::External::Value: function does not take 0 arguments - v8::External::New: function does not take 2 arguments - v8::Template::SetNativeDataProperty: ambiguous call Apply the upstream version-guarded fix from WiseLibs/better-sqlite3#1475 as a patch-package patch in both sub-packages that depend on better-sqlite3 directly: redisinsight/ (the Electron app bundle, packaged by electron-builder) and redisinsight/api/ (used at runtime and by API tests). The patch is gated on NODE_MODULE_VERSION >= 146 so pre-Electron-42 builds compile unchanged. Upstream references: - WiseLibs/better-sqlite3#1474 (build failure starting with Electron 42) - WiseLibs/better-sqlite3#1475 (the fix, approved but not yet merged) This patch can be removed once #1475 is merged and we bump better-sqlite3 to a release that includes it.
|
important pr,we need this pr to make plugin adapt to recently released vscode (version 1.123.0) |
|
Guys, you can temporarily use the prebuilds I made for the main platforms - https://github.com/DmitriiKholkin/RapiDB/releases/tag/rapidb-patched-sqlite |
|
What are we still waiting on before approving these changes? |
This PR is already approved. The original author of BS3, @JoshuaWise is the sole code owner of the specific native API source files this PR targets. He's busy with life after more than a decade of work on this library. 🤷🏻♂️ |
|
If anyone needs this urgently, you can use the approach from #1414 (comment). Just adjust repo name and commit hash. |
Summary
Verification
npx electron-rebuild -v 42.1.0 --types dev,prod,optional --force --build-from-source
Fixes #1474