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

Fails to install due to a compilation error #29

Open
ipeychev opened this issue Nov 30, 2017 · 5 comments
Open

Fails to install due to a compilation error #29

ipeychev opened this issue Nov 30, 2017 · 5 comments

Comments

@ipeychev
Copy link

The module fails to install with the following error:

$ node -v
v7.10.1
$ npm install --save getdns

> [email protected] install /Users/test/projects/test-getdnsapi/node_modules/getdns
> npm run --silent rebuild

  CXX(target) Release/obj.target/getdns/src/GNContext.o
In file included from ../src/GNContext.cpp:28:
../src/GNContext.h:33:10: fatal error: 'getdns/getdns.h' file not found
#include <getdns/getdns.h>
         ^
1 error generated.
make: *** [Release/obj.target/getdns/src/GNContext.o] Error 1

I also tried with Node 6 and Node 9 and the result is the same. My machine is MacOS High Sierra, version 10.13.1 (17B1002)

@ipeychev
Copy link
Author

Oh, it actually needs getdns C library to be installed manually before? If so, isn't it possible this to be done automatically? I'm not sure if any dev will be OK to do it and how maintainable will be it.

@wtoorop
Copy link
Contributor

wtoorop commented Nov 30, 2017

It does. There is a brew formula for it too?
But maybe it is worth investigating to have the C library embedded somehow (maybe in a git submodule?) too...

@ipeychev
Copy link
Author

I think without this the module is practically unusable. I can't force all people in the team who use Mac, Linux and Windows to install the library manually before installing the Node module, neither to tell people who make Docker image to do it too.
All the dependencies has to install transparently - the developer should only do: npm install --save getdns

@wtoorop
Copy link
Contributor

wtoorop commented Nov 30, 2017

Acknowledged. I'll have a go at it (but not very soon, cause I'm very busy currently)

@joelpurra
Copy link
Collaborator

@ipeychev: simplifying the installation would indeed be great! Am too used to having getdns and dependencies installed already, didn't think much about bundling.

@wtoorop: I am generally against git submodules, especially if npm would need to invoke it during build/deployment on production servers/containers etcetera.

Perhaps the node-sqlite3 approach to bundle and unpack the library source code can be applied? Then node-gyp would need to know the (temporary) unpacked location. It might also help (a lot) to bundle external libraries used by getdns. (If bundling and building gets too messy, I would consider putting it in a separate repository.)

It also looks like node-pre-gyp might be useful.

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

No branches or pull requests

3 participants