-
Notifications
You must be signed in to change notification settings - Fork 504
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
chore: overload deprecated AccessorSignatures #943
Conversation
I am trying this out since the branch for #941 (which was working) no longer exists. I am wondering where the choice of node module version 18 comes from. I am on node 16.15.0 and trying to compile a module against electron 20 (also 16.15.0) and the version check here doesn't work for me. If I modify it to |
@alexciarlillo what errors did you get when trying out this branch? I got errors like
Which like you, I did not get with the changes from the previous PR. |
I'm not sure if I got that error but IIRC I was also still getting
Sorry I should have kept better track and posted more details. I have just been in dependency hell for like a week trying to do an electron upgrade and my brain was a bit fried. But I can confirm this fix doesn't work for me on Node 16.15.x where the previous one did. |
Same here, it reports this one as still being used: npm ERR! In file included from ../../nan/nan.h:180:
npm ERR! ../../nan/nan_callbacks.h:55:23: error: no member named 'AccessorSignature' in namespace 'v8'
npm ERR! typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR! ~~~~^
npm ERR! In file included from ../src/functions.cpp:20:
npm ERR! In file included from ../src/functions.h:4:
npm ERR! ../../nan/nan.h:2546:8: error: no matching member function for call to 'SetAccessor'
npm ERR! tpl->SetAccessor( Built on macOS for: |
Yes, something like this was what I had in mind, API-wise. |
As for the @@ -53,7 +53,9 @@ typedef void(*IndexQueryCallback)(
namespace imp {
#if (NODE_MODULE_VERSION < NODE_18_0_MODULE_VERSION)
-NAN_DEPRECATED typedef v8::Local<v8::AccessorSignature> Sig;
+typedef v8::Local<v8::AccessorSignature> Sig;
+#else
+typedef v8::Local<v8::Data> Sig;
#endif
static const int kDataIndex = 0; |
See nodejs#941 The replacement pull request, nodejs#943, does not seem to work with electron 20.
nodejs/nan#941 was closed in favor of nodejs/nan#943 Signed-off-by: Ovenoboyo <ovenoboyo@gmail.com>
Can we expedite merging this fix and releasing a new version? We cannot build our node modules using NaN for Electron 20, which has been out for over a month |
@kkoopa Done, thanks! Added the dummy sig as suggested. |
@VerteDinde this branch appears to work well for me now. :) |
- Temporarily use @frida/nan, which has nodejs/nan#943 merged. - Move away from the deprecated Nan::SetAccessor() overload. - Ensure `-std` is placed in the C++ flags, where it belongs, so it ends up *after* the `-std` flag from Electron's common.gypi.
FYI Electron 21 was released in the meantime |
Any idea when this will get merged? Trying to upgrade my app to Electron v20 and am currently blocked on this :( |
Any update? |
In case someone is looking for a temporal workaround: electron/electron#35193 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something but why replicate SetAccessor() in its entirety when the only thing that's different is the disappearance of the signature
argument?
Looks like it's faster for us to just replace the usage of NaN with pure V8 calls than to wait for the fix :( |
@bnoordhuis I think that's because of @kkoopa's review comment in the previous PR - #941 (comment). |
Sorry, completely forgot about this during vacation. I'll go through it now. |
Yes, this looks like what I had in mind and it seems to pass the tests. I need to add some more entries to the test matrix and do some maintenance before I can push a new release. Thank you all. |
New release published. Hopefully this resolves all problems. |
all hail benjamin! |
AccessorSignatures was removed in https://chromium-review.googlesource.com/c/v8/v8/+/3654096 . This PR overloads the SetAccessor method, removing the default parameters, and also includes the original method with the signature param removed. This should allow older versions of Node to use
signature
, but fixes nan for newer versions of Node and ElectronSupersedes: #941
Fixes: #942
@kkoopa This PR attempts to address the feedback left here: #941 (comment) If this doesn't encompass what you were thinking, let me know, happy to make adjustments!