Skip to content

Build failure with Node v6.12.1 on CentOS 7 #206

Closed

Description

@michaelfig

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

Activity

  1. michaelfig commented on Dec 28, 2017

    @michaelfig
    Author

    BTW, I used node-addon-api@1.0.0 for both compiles.

  2. NickNaso commented on Jan 3, 2018

    @NickNaso
    Member

    Hi @michaelfig,
    If I understood you had problem with version 1.1.0 of node-addon-api while with 1.0.0 all worked well for you.
    About that I'm curios so if your addon is a public addon please post the link at your code. I want try to take a look.
    Nick

  3. mhdawson commented on Jan 3, 2018

    @mhdawson
    Member

    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.

  4. michaelfig commented on Jan 4, 2018

    @michaelfig
    Author

    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!

  5. NickNaso commented on Jan 4, 2018

    @NickNaso
    Member

    @mhdawson We need to change the reference in the installation and usage documentation.
    @michaelfig Maybe I'm not really sure but I could works even if with Node.js 4.x

  6. michaelfig commented on Jan 4, 2018

    @michaelfig
    Author

    I've tested it successfully for node v4.8.7 as well.

    Thanks.

  7. added a commit that references this issue on Jan 5, 2018
  8. mhdawson commented on Jan 5, 2018

    @mhdawson
    Member

    Sounds like we can close this. If not please let me know and I'll re-open.

  9. added a commit that references this issue on Aug 24, 2022
  10. added a commit that references this issue on Aug 26, 2022
  11. added a commit that references this issue on Sep 19, 2022
  12. added a commit that references this issue on Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions