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

build fails for node v10 #3

Closed
trollkotze opened this issue Feb 12, 2019 · 4 comments
Closed

build fails for node v10 #3

trollkotze opened this issue Feb 12, 2019 · 4 comments

Comments

@trollkotze
Copy link
Collaborator

Hello!

I am trying to use this package in a project with Nodejs version 10, which fails.
It works with Nodejs version 9. But is there any chance to get it running with Node 10?

Here is the error output:

trollkotze@schrotthaufen:~/testlibxml$ npm install node-libxml

> [email protected] install /home/trollkotze/testlibxml/node_modules/node-libxml
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/jupitex/node-libxml/releases/download/3.2.3/xml-v3.2.3-node-v64-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp) 
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
make: Verzeichnis „/home/trollkotze/testlibxml/node_modules/node-libxml/build“ wird betreten
  CXX(target) Release/obj.target/xml/libxml.o
../libxml.cpp: In static member function ‘static void Libxml::Init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’:
../libxml.cpp:57:25: warning: variable ‘instTpl’ set but not used [-Wunused-but-set-variable]
   Local<ObjectTemplate> instTpl = tpl->InstanceTemplate();
                         ^
../libxml.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Libxml::New(Nan::NAN_METHOD_ARGS_TYPE)’:
../libxml.cpp:73:59: error: no matching function for call to ‘v8::Function::NewInstance(const int&, v8::Local<v8::Value> [1])’
     info.GetReturnValue().Set(cons->NewInstance(argc, argv));
                                                           ^
In file included from /home/trollkotze/.node-gyp/10.1.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../libxml.h:4,
                 from ../libxml.cpp:4:
/home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:3848:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^
/home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:3848:44: note:   candidate expects 3 arguments, 2 provided
/home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:3851:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^
/home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:3851:44: note:   candidate expects 1 argument, 2 provided
../libxml.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Libxml::loadXml(Nan::NAN_METHOD_ARGS_TYPE)’:
../libxml.cpp:86:44: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
   String::Utf8Value val(info[0]->ToString());
                                            ^
In file included from /home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:26:0,
                 from /home/trollkotze/.node-gyp/10.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../libxml.h:4,
                 from ../libxml.cpp:4:
/home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:2822:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/trollkotze/.node-gyp/10.1.0/include/node/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../libxml.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Libxml::loadXmlFromString(Nan::NAN_METHOD_ARGS_TYPE)’:
../libxml.cpp:116:44: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
   String::Utf8Value str(info[0]->ToString());
                                            ^
In file included from /home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:26:0,
                 from /home/trollkotze/.node-gyp/10.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../libxml.h:4,
                 from ../libxml.cpp:4:
/home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:2822:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/trollkotze/.node-gyp/10.1.0/include/node/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../libxml.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Libxml::loadDtds(Nan::NAN_METHOD_ARGS_TYPE)’:
../libxml.cpp:188:49: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
       String::Utf8Value pathV8(value->ToString());
                                                 ^
In file included from /home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:26:0,
                 from /home/trollkotze/.node-gyp/10.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../libxml.h:4,
                 from ../libxml.cpp:4:
/home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:2822:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/trollkotze/.node-gyp/10.1.0/include/node/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../libxml.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Libxml::loadSchemas(Nan::NAN_METHOD_ARGS_TYPE)’:
../libxml.cpp:279:49: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
       String::Utf8Value pathV8(value->ToString());
                                                 ^
In file included from /home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:26:0,
                 from /home/trollkotze/.node-gyp/10.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../libxml.h:4,
                 from ../libxml.cpp:4:
/home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:2822:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/trollkotze/.node-gyp/10.1.0/include/node/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../libxml.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Libxml::xpathSelect(Nan::NAN_METHOD_ARGS_TYPE)’:
../libxml.cpp:436:44: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
   String::Utf8Value val(info[0]->ToString());
                                            ^
In file included from /home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:26:0,
                 from /home/trollkotze/.node-gyp/10.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../libxml.h:4,
                 from ../libxml.cpp:4:
/home/trollkotze/.node-gyp/10.1.0/include/node/v8.h:2822:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/trollkotze/.node-gyp/10.1.0/include/node/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../libxml.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Libxml::freeXml(Nan::NAN_METHOD_ARGS_TYPE)’:
../libxml.cpp:478:8: warning: unused variable ‘deleted’ [-Wunused-variable]
   bool deleted = Nan::Delete(info.Holder(), Nan::New<v8::String>("wellformedErrors").ToLocalChecked()).FromMaybe(false);
        ^
../libxml.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Libxml::freeDtds(Nan::NAN_METHOD_ARGS_TYPE)’:
../libxml.cpp:492:8: warning: unused variable ‘deletedLoaded’ [-Wunused-variable]
   bool deletedLoaded = Nan::Delete(info.Holder(), Nan::New<v8::String>("dtdsLoadedErrors").ToLocalChecked()).FromMaybe(false);
        ^
../libxml.cpp:493:8: warning: unused variable ‘deleted’ [-Wunused-variable]
   bool deleted = Nan::Delete(info.Holder(), Nan::New<v8::String>("validationDtdErrors").ToLocalChecked()).FromMaybe(false);
        ^
../libxml.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Libxml::freeSchemas(Nan::NAN_METHOD_ARGS_TYPE)’:
../libxml.cpp:513:8: warning: unused variable ‘deletedLoaded’ [-Wunused-variable]
   bool deletedLoaded = Nan::Delete(info.Holder(), Nan::New<v8::String>("schemasLoadedErrors").ToLocalChecked()).FromMaybe(false);
        ^
../libxml.cpp:514:8: warning: unused variable ‘deleted’ [-Wunused-variable]
   bool deleted = Nan::Delete(info.Holder(), Nan::New<v8::String>("validationSchemasErrors").ToLocalChecked()).FromMaybe(false);
        ^
../libxml.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Libxml::clearAll(Nan::NAN_METHOD_ARGS_TYPE)’:
../libxml.cpp:532:11: warning: unused variable ‘libxml’ [-Wunused-variable]
   Libxml* libxml = Nan::ObjectWrap::Unwrap<Libxml>(info.Holder());
           ^
xml.target.mk:139: die Regel für Ziel „Release/obj.target/xml/libxml.o“ scheiterte
make: *** [Release/obj.target/xml/libxml.o] Fehler 1
make: Verzeichnis „/home/trollkotze/testlibxml/node_modules/node-libxml/build“ wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/trollkotze/.nvm/versions/node/v10.1.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:235:12)
gyp ERR! System Linux 4.4.0-142-generic
gyp ERR! command "/home/trollkotze/.nvm/versions/node/v10.1.0/bin/node" "/home/trollkotze/.nvm/versions/node/v10.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/trollkotze/testlibxml/node_modules/node-libxml/build/Release/xml.node" "--module_name=xml" "--module_path=/home/trollkotze/testlibxml/node_modules/node-libxml/build/Release"
gyp ERR! cwd /home/trollkotze/testlibxml/node_modules/node-libxml
gyp ERR! node -v v10.1.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/home/trollkotze/.nvm/versions/node/v10.1.0/bin/node /home/trollkotze/.nvm/versions/node/v10.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/trollkotze/testlibxml/node_modules/node-libxml/build/Release/xml.node --module_name=xml --module_path=/home/trollkotze/testlibxml/node_modules/node-libxml/build/Release' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/trollkotze/testlibxml/node_modules/node-libxml/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:957:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:246:5)
node-pre-gyp ERR! System Linux 4.4.0-142-generic
node-pre-gyp ERR! command "/home/trollkotze/.nvm/versions/node/v10.1.0/bin/node" "/home/trollkotze/testlibxml/node_modules/node-libxml/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/trollkotze/testlibxml/node_modules/node-libxml
node-pre-gyp ERR! node -v v10.1.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok 
Failed to execute '/home/trollkotze/.nvm/versions/node/v10.1.0/bin/node /home/trollkotze/.nvm/versions/node/v10.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/trollkotze/testlibxml/node_modules/node-libxml/build/Release/xml.node --module_name=xml --module_path=/home/trollkotze/testlibxml/node_modules/node-libxml/build/Release' (1)
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/trollkotze/.npm/_logs/2019-02-12T05_55_17_330Z-debug.log
@trollkotze
Copy link
Collaborator Author

trollkotze commented Feb 12, 2019

I've made a PR to fix this: #4

I had just found a similar issue in another package (noble/node-bluetooth-hci-socket#84) with a fix for the same problem, which I just copied and it works, to make it build with Node v10. Should not break anything with earlier versions, as long as they update the NaN dependency to ^2.10.

CI tests have failed, but that seems to be caused by a faulty test environment config (missing GitHub token for some NPM packaging preparation script).

Actually only the first three commits here (up until ae9ea9b) should be included. The other stuff was just me trying to make it npm/yarn-installable from that git repo (needing node-pre-gyp as a bundled dependency). Should not have gone into the PR. My bad. But I think one can pick commits to merge? If not, I can separate that out.

@MatthD
Copy link
Owner

MatthD commented Feb 13, 2019

Thanks I saw the error on appveyor, I merge your PR to be able to use with node v10

@MatthD
Copy link
Owner

MatthD commented Feb 13, 2019

I merged your request but you can fix some thing like the node modules folder, the package.json,

Sorry I do not have the time to work on it . I Add you to contribute

@trollkotze
Copy link
Collaborator Author

Thanks. I'll see what I can do. Also quite busy at the moment and not really well-versed in this stuff.

I had included the node_modules directory with the pre-gyp bundled dependency stuff into git because that was missing when I simply tried to yarn install it from my forked repo.
But I guess this pre-bundling for npm-publish is supposed to happen automatically after successful test run in AppVeyor?
In that case I think simply reverting my last three commits (952d6bc, e0d8acc, and 1bae44c) should clean things up again. So I just did that.

package.json was updated to include nan ^2.10. Not sure how the CI stuff works.

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

3 participants