-
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
Allow the use of Isolated V8 methods for node-0.12 #285
Conversation
@@ -173,7 +173,7 @@ NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) { | |||
} | |||
|
|||
/* io.js 1.0 */ | |||
#if NODE_MODULE_VERSION >= IOJS_1_0_MODULE_VERSION \ | |||
#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION \ | |||
|| NODE_VERSION_AT_LEAST(0, 11, 15) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
While the patch seems to pass, I am still not entirely sure that it does not have any unintended consequences. The problem is that nw.js claims to be something it clearly is not and we have no reliable way of checking for the actual v8 version used. Even if it somehow were possible, I will still not make special case after special case and exceptions left and right. A version is a version and will be treated as such, not a free-form user agent with five levels of hacks. It is completely unmaintainable. |
Given that, I don't think it is necessary to change anything in nan, as they said in their documentation
The weird thing is that nw-gyp uses the node version of nw.js but when you ask the node version it uses |
Will hold off while waiting for the response of nw.js, once this has been sorted out, new versions of nw.js 11 will most likely start working by themselves. nw.js 8 should still be fine. Past versions of nw.js 11 will never work. |
@bnoordhuis thanks for CCing. @morellan it's required to pass |
@kkoopa NW.js integrates Chromium and Node.js (in <= NW 11) or IO.js (in NW 12 and later) and always uses the v8 version in Chromium. |
The problem is that the version of v8 cannot be detected directly, so we must rely on NODE_MODULE_VERSION and NODE_VERSION to also detect v8 version. Since nw.js may use a different v8 version, that check will fail. |
@kkoopa you're right. and v8 upgrades from 3.24.35.22 to 3.28.73 in Node.js (from 0.11.13 to 0.11.15). Currently in NW11 the Node.js is 0.11.13 and v8 is 3.28.71.2 (from Chrome). Since Nan supports Node.js 0.11.15 (with v8 3.28.73), if NW updates its Node.js to 0.11.15 in next NW 0.11.7 everything should be fine is that correct? |
Yes, that should hopefully work for now, but the problem remains if you need to change v8 versions again in the future. |
@kkoopa yes. To fix the root cause v8 should add version definition macros in their headers ... |
Yes, that would indeed be the best recourse. #226 revolves around the same problem. |
That's https://code.google.com/p/v8/issues/detail?id=3075 - I took a shot at it once but IIRC I got stumped integrating with V8's homegrown release script. |
👍 for the public version macro for v8 @bnoordhuis But in the meantime at least we need to update the documentation on nw-gyp, maybe adding another note @rogerwang
Should I open a pull request with that? |
@morellan yes please. thanks. |
@rogerwang done! |
I'm locked nan to 1.4.3, till fix release. Higher releases still not work under nw.js 0.11.6 with node 0.11.13. |
nw.js 0.11.6 will never work |
Yeah, on 0.11.5 was same issue :) But for now NW.JS won't start my app...without logs/messages... Magic... |
You have to wait for a possible 0.11.7 or switch to 0.12.0. |
Now all works fine on 0.11.6 with Nan 1.4.3 👍 |
I was trying to build the atom/node-spellchecker for nw.js with nw-gyp and keep getting the same error:
After a lot of research I found that node-0.12 uses V8 version 3.28.73 which implement the method with Isolated (https://chromium.googlesource.com/v8/v8.git/+/3.28.73/src/api.cc#6692), and in the code those are available only for
NODE_MODULE_VERSION >= IOJS_1_0_MODULE_VERSION
.After this change it worked, this is my first PR so any comments or another way to achieve the same are welcome.