-
Notifications
You must be signed in to change notification settings - Fork 465
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
Build failure with Node v6.12.1 on CentOS 7 #206
Comments
BTW, I used node-addon-api@1.0.0 for both compiles. |
Hi @michaelfig, |
I can see that we define some of the functions reported as missing in https://github.com/nodejs/node-addon-api/blob/master/src/node_internals.h. For example: #if NODE_MAJOR_VERSION < 8 || NODE_MAJOR_VERSION == 8 && NODE_MINOR_VERSION < 6
typedef int async_id;
typedef struct async_context {
node::async_id async_id;
node::async_id trigger_async_id;
} async_context;
NODE_EXTERN async_context EmitAsyncInit(v8::Isolate* isolate,
v8::Local<v8::Object> resource,
v8::Local<v8::String> name,
async_id trigger_async_id = -1);
NODE_EXTERN void EmitAsyncDestroy(v8::Isolate* isolate,
async_context asyncContext);
v8::MaybeLocal<v8::Value> MakeCallback(v8::Isolate* isolate,
v8::Local<v8::Object> recv,
v8::Local<v8::Function> callback,
int argc,
v8::Local<v8::Value>* argv,
async_context asyncContext);
#if NODE_MAJOR_VERSION < 8
class AsyncResource {
public:
AsyncResource(v8::Isolate* isolate,
v8::Local<v8::Object> object,
const char *name);
};
#endif // node version below 8
#endif // node version below 8.6 My guess is that possibly the issue is related to paths, with somehow the files from the node runtime being used instead of those provided as part of node-addon-api. Can you provide some more info on anything special about your build setup ? @gabrielschulhof adding you as an FYI as you did much of the work to support the older release and I wonder if you have run into some combination in the past that shows these symptoms. |
Ah, thanks! The installation and usage guide says to reference "1.0.0" in the package.json, but when I changed it to "^1.0.0" and npm update node-addon-api, I got 1.1.0 which adds the necessary support to v6. Node-gyp has problems with v0.10 due to c++ flags, but at least 6.x works! |
@mhdawson We need to change the reference in the installation and usage documentation. |
I've tested it successfully for node v4.8.7 as well. Thanks. |
Changed version of node-addon-api on the package.json example see: [issue 206](#206 (comment)) PR-URL: #208 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Sounds like we can close this. If not please let me know and I'll re-open. |
Changed version of node-addon-api on the package.json example see: [issue 206](nodejs/node-addon-api#206 (comment)) PR-URL: nodejs/node-addon-api#208 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Changed version of node-addon-api on the package.json example see: [issue 206](nodejs/node-addon-api#206 (comment)) PR-URL: nodejs/node-addon-api#208 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Changed version of node-addon-api on the package.json example see: [issue 206](nodejs/node-addon-api#206 (comment)) PR-URL: nodejs/node-addon-api#208 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Changed version of node-addon-api on the package.json example see: [issue 206](nodejs/node-addon-api#206 (comment)) PR-URL: nodejs/node-addon-api#208 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
First, thanks for node-addon-api: it allowed me to port old code to v8.9.1.
I'm trying to backport my module to v6.12.1, and I'm getting compile errors after following the steps in the Setup guide (and having it work perfectly under Node v8.9.1).
They all seem related to async_context not existing in v6.
Your help is appreciated,
Michael.
compile-errors.txt
The text was updated successfully, but these errors were encountered: