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

convert.js does not add node-addon-api to the dependencies in binding.gyp #98

Closed
mcollina opened this issue Aug 2, 2017 · 8 comments
Closed

Comments

@mcollina
Copy link
Member

mcollina commented Aug 2, 2017

As titled, after launching covert.js  the updated binding.gyp is not trying to build this specific module, resulting in missing symbols at runtime (in Node 6.11).

@mcollina
Copy link
Member Author

mcollina commented Aug 22, 2017

I'm trying to see how do add this. Is it fine if I parse binding.gyp? I need to add this module within the dependencies add a define for NAPI_CPP_EXCEPTIONS.

@sampsongao
Copy link

Can you post an example of the output binding.gyp?

@mcollina
Copy link
Member Author

Here it is:

{
  "targets": [
    {
      "target_name": "native-hdr-histogram",
      "cflags!": [ "-fno-exceptions" ],
      "cflags_cc!": [ "-fno-exceptions" ],
      "sources": [
        "src/hdr_encoding.h",
        "src/hdr_encoding.c",
        "src/hdr_histogram.h",
        "src/hdr_histogram.c",
        "src/hdr_histogram_log.h",
        "src/hdr_histogram_log.c",
        "hdr_histogram_wrap.cc",
        "histogram.cc"
      ],
      "dependencies": [
        "<(module_root_dir)/zlib/zlib.gyp:zlib"
      ],
      "include_dirs": [
        "<!@(node -p \"require('node-addon-api').include\")",
        "src/"
      ]
    }
  ]
}

What it's missing is the line in dependencies, like so:

{
  "targets": [
    {
      "target_name": "native-hdr-histogram",
      "cflags!": [ "-fno-exceptions" ],
      "cflags_cc!": [ "-fno-exceptions" ],
      "sources": [
        "src/hdr_encoding.h",
        "src/hdr_encoding.c",
        "src/hdr_histogram.h",
        "src/hdr_histogram.c",
        "src/hdr_histogram_log.h",
        "src/hdr_histogram_log.c",
        "hdr_histogram_wrap.cc",
        "histogram.cc"
      ],
      "dependencies": [
        "<(module_root_dir)/zlib/zlib.gyp:zlib",
        "<!(node -p \"require('node-addon-api').gyp\")"
      ],
      "include_dirs": [
        "<!@(node -p \"require('node-addon-api').include\")",
        "src/"
      ]
    }
  ]
}

@mhdawson
Copy link
Member

@sampsongao have you had a chance to look at this ?

@sampsongao
Copy link

So currently the script find a <!(node -p "require('nan')") and replace it with node -p "require('node-addon-api').include"). Maybe we can do find the "dependencies" key and insert the include for node-addon-api and remove nan's if found.

@sampsongao
Copy link

sampsongao commented Oct 22, 2017

@mcollina can you try #158 to see if it works for your case?

@mhdawson
Copy link
Member

mhdawson commented Nov 2, 2017

ping @mcollina any chance you can try this out ?

@digitalinfinity
Copy link
Contributor

@mcollina we believe this issue should have been resolved with #158- please reopen or file another issue if you still have problems here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants