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

[Bug]: 20-x-y nan native modules won't compile on x64 without newest electron-rebulld #34885

Closed
3 tasks done
VerteDinde opened this issue Jul 11, 2022 · 3 comments
Closed
3 tasks done
Assignees
Labels
bug 🪲 platform/windows status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@VerteDinde
Copy link
Member

VerteDinde commented Jul 11, 2022

Preflight Checklist

Electron Version

20.0.0-alpha.1

What operating system are you using?

Windows

Operating System Version

Windows 10

What arch are you using?

x64

Last Known Working Electron version

19.0.7

Expected Behavior

Native modules using the nan API should build correctly on x64

Actual Behavior

Native modules using the nan API crash on x64 with a missing include for pointer compression

Testcase Gist URL

https://gist.github.com/VerteDinde/90c7f4555c0f7ba5fd374fed3f20cbb0

Additional Information

More information in these two PRs:

  1. fix: ensure v8 pointer compression + sandbox is enabled on 64bit native modules #34844
  2. fix: ensure force-process-config is not passed to prerelease v20+ rebuild#1023

Two tasks for us to complete before we release v20 as a stable release:

  1. Include an explanation for the failure in the 20.0.0 blog post, asking people to use at least electron-rebuild verison 3.2.8
  2. Make native modules fail to build if they don't have the right version of node-gyp and/or electron-rebuild
@VerteDinde VerteDinde added platform/windows bug 🪲 status/confirmed A maintainer reproduced the bug or agreed with the feature labels Jul 11, 2022
@VerteDinde VerteDinde self-assigned this Jul 11, 2022
@nikitakot
Copy link
Contributor

nikitakot commented Aug 18, 2022

@VerteDinde Having problems rebuilding package which uses nan for Electron 20. Could it be related? Thank you.

nan_callbacks.h(55,23): error C2039: 'AccessorSignature': is not a member of 'v8'
"electron": "20.0.2" (V8 10.4, Node.js 16.15.0, Chromium 104)
"nan": "2.16.0
"electron-rebuild": "3.2.9"

nodejs/nan#942

@RaisinTen
Copy link
Member

@nikitakot it's being fixed in nodejs/nan#941

@Christian1984
Copy link

Christian1984 commented Sep 15, 2022

Edit Nr. 2

Fixed the bug in winctl and filed a pull request at davenonymous/winctl#8 👍 All good!

Edit

Checking out weedz/nan@a679b69 seems to get the job done! (It's not yet merged into nan, though)

Now I get "CreationContext" is not a member of "v8::Object", which seems to be an unrelated issue to electron v20 and newer according to this comment: WiseLibs/better-sqlite3#858 (comment)

Original Post

I am running into that same issue. Trying to build an electron app created with electron-forge 6.0.0-beta.65 and a native module. Consider this example:

  • run npm i https://github.com/thraaawn/winctl
  • run npm start
  • get
Preparing native dependencies: 0 / 1
C:\Users\user\.electron-gyp\20.1.4\include\node\v8-isolate.h(292,5): warning C4996: 'v8::LegacyOOMErrorCallback': Use
OOMErrorCallback (https://crbug.com/1323177) [C:\[...]\node_modules\winctl\build\w
inctl.vcxproj]
C:\[...]\node_modules\nan\nan_callbacks.h(55,23): error C2039: "AccessorSignature"
 is not a member of "v8". [C:\[...]\node_modules\winctl\build\winctl.vcxproj]`

I tried to manually upgrade electron-rebuild to v3.2.9 and nan to v2.16.0.

Cloning the repo of winctl to a separate directory and starting it without electron works perfectly fine. Local node version is v16.17.0.

Can anyone point me to how I can get this fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 platform/windows status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
No open projects
Status: Fixed for Next Release
Development

No branches or pull requests

4 participants