Node 9 support
ruslan-polutsygan opened this issue · 4 comments
Hi
When I run yarn install
I receive error. Output is following:
$ node install-libxl.js && node-gyp rebuild
Libxl already downloaded, nothing to do
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@9.11.1 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/home/ruslan/.nvm/versions/node/v9.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/ruslan/projects/platform/repos/node-libxl/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/ruslan/.nvm/versions/node/v9.11.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/ruslan/.node-gyp/9.11.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/ruslan/.node-gyp/9.11.1',
gyp info spawn args '-Dnode_gyp_dir=/home/ruslan/.nvm/versions/node/v9.11.1/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/ruslan/.node-gyp/9.11.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/ruslan/projects/platform/repos/node-libxl',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/home/ruslan/projects/platform/repos/node-libxl/build'
CXX(target) Release/obj.target/liblibxl/src/bindings.o
In file included from ../node_modules/nan/nan.h:190:0,
from ../src/common.h:28,
from ../src/bindings.cc:25:
../node_modules/nan/nan_maybe_43_inl.h: In function ‘Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’:
../node_modules/nan/nan_maybe_43_inl.h:88:64: warning: ‘v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’ is deprecated (declared at /home/ruslan/.node-gyp/9.11.1/include/node/v8.h:3164): Use CreateDataProperty / DefineOwnProperty [-Wdeprecated-declarations]
return obj->ForceSet(GetCurrentContext(), key, value, attribs);
^
CXX(target) Release/obj.target/liblibxl/src/book.o
In file included from ../node_modules/nan/nan.h:190:0,
from ../src/common.h:28,
from ../src/book.h:28,
from ../src/book.cc:27:
../node_modules/nan/nan_maybe_43_inl.h: In function ‘Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’:
../node_modules/nan/nan_maybe_43_inl.h:88:64: warning: ‘v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’ is deprecated (declared at /home/ruslan/.node-gyp/9.11.1/include/node/v8.h:3164): Use CreateDataProperty / DefineOwnProperty [-Wdeprecated-declarations]
return obj->ForceSet(GetCurrentContext(), key, value, attribs);
^
In file included from ../src/common.h:29:0,
from ../src/book.h:28,
from ../src/book.cc:27:
../src/book.cc: In static member function ‘static void node_libxl::Book::Initialize(v8::Handle<v8::Object>)’:
../src/csnan.h:42:39: error: no matching function for call to ‘v8::Object::ForceSet(v8::Local<v8::String>, v8::Local<v8::Boolean>, v8::PropertyAttribute)’
Object->ForceSet(Key,Value,Attribs);
^
../src/book.cc:1227:9: note: in expansion of macro ‘CSNanObjectSetWithAttributes’
CSNanObjectSetWithAttributes(exports, Nan::New<String>("apiKeyCompiledIn").ToLocalChecked(), Nan::False(),
^
../src/csnan.h:42:39: note: candidate is:
Object->ForceSet(Key,Value,Attribs);
^
../src/book.cc:1227:9: note: in expansion of macro ‘CSNanObjectSetWithAttributes’
CSNanObjectSetWithAttributes(exports, Nan::New<String>("apiKeyCompiledIn").ToLocalChecked(), Nan::False(),
^
In file included from /home/ruslan/.node-gyp/9.11.1/include/node/v8.h:26:0,
from /home/ruslan/.node-gyp/9.11.1/include/node/node.h:63,
from ../node_modules/nan/nan.h:47,
from ../src/common.h:28,
from ../src/book.h:28,
from ../src/book.cc:27:
/home/ruslan/.node-gyp/9.11.1/include/node/v8.h:3165:29: note: v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)
Maybe<bool> ForceSet(Local<Context> context, Local<Value> key,
^
/home/ruslan/.node-gyp/9.11.1/include/node/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^
/home/ruslan/.node-gyp/9.11.1/include/node/v8.h:3165:29: note: no known conversion for argument 3 from ‘v8::PropertyAttribute’ to ‘v8::Local<v8::Value>’
Maybe<bool> ForceSet(Local<Context> context, Local<Value> key,
^
/home/ruslan/.node-gyp/9.11.1/include/node/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^
make: *** [Release/obj.target/liblibxl/src/book.o] Error 1
make: Leaving directory `/home/ruslan/projects/platform/repos/node-libxl/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/ruslan/.nvm/versions/node/v9.11.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:180:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 3.13.0-135-generic
gyp ERR! command "/home/ruslan/.nvm/versions/node/v9.11.1/bin/node" "/home/ruslan/.nvm/versions/node/v9.11.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ruslan/projects/platform/repos/node-libxl
gyp ERR! node -v v9.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
error Command failed with exit code 1.
How this can be fixed? Can I help you somehow to make the library work with node v9?
Thanks.
Notifying me of the issue is a good first step, thanks :) I have updated nan, but the deprecations. and two errors remain. I'll try to fix those the next few days.
Cheers
-Christian
Thank you @DirtyHairy :)
Hi @ruslan-polutsygan !
I have fixed the build for Node 9 and published the result on NPM as version 0.3.0 (I have dropped support for everything < 4.0.0, that's the reason for the minor version bump). The warnings remain for the time being (including a lack of support for the async hooks API) --- I have opened #18 for those.
Cheers
-Christian
Thank you very much