Skip to content

Unable to build on node 12  #36

Description

@JohnnyCrazy

Build is currently broken with the new node 12 version.

I guess the important error is on this line:

../src/kexec.cc: At global scope:
../src/kexec.cc:19:11: error: ‘v8::Handle’ has not been declared
 using v8::Handle;
           ^~~~~~
Whole build output

Directory: /home/johnny/projects/proxy_mgmt_cli/node_modules/kexec
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@12.0.0 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args   '/home/johnny/.asdf/installs/nodejs/12.0.0/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/johnny/projects/proxy_mgmt_cli/node_modules/kexec/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/johnny/.asdf/installs/nodejs/12.0.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/johnny/.node-gyp/12.0.0/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/johnny/.node-gyp/12.0.0',
gyp info spawn args   '-Dnode_gyp_dir=/home/johnny/.asdf/installs/nodejs/12.0.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/johnny/.node-gyp/12.0.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/johnny/projects/proxy_mgmt_cli/node_modules/kexec',
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 args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/johnny/projects/proxy_mgmt_cli/node_modules/kexec/build'
  CXX(target) Release/obj.target/kexec/src/kexec.o
In file included from ../src/kexec.cc:14:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2232:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
../src/kexec.cc: At global scope:
../src/kexec.cc:19:11: error: ‘v8::Handle’ has not been declared
 using v8::Handle;
           ^~~~~~
../src/kexec.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE kexec(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/kexec.cc:68:38: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’
         String::Utf8Value str(info[0]);
                                      ^
In file included from /home/johnny/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/kexec.cc:14:
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:2995:5: note: candidate: ‘v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)’
     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
     ^~~~~~~~~
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
../src/kexec.cc:78:38: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’
         String::Utf8Value str(info[0]);
                                      ^
In file included from /home/johnny/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/kexec.cc:14:
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:2995:5: note: candidate: ‘v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)’
     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
     ^~~~~~~~~
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
../src/kexec.cc:91:72: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
             String::Utf8Value arg(argv_handle->Get(Nan::New<Integer>(i))->ToString());
                                                                        ^
In file included from /home/johnny/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/johnny/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/johnny/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/kexec.cc:14:
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:3412:55: note: declared here
   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
                                                       ^~~
/home/johnny/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/kexec.cc:91:84: error: no matching function for call to ‘v8::Value::ToString()’
             String::Utf8Value arg(argv_handle->Get(Nan::New<Integer>(i))->ToString());
                                                                                    ^
In file included from /home/johnny/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/kexec.cc:14:
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:2528:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                            ^~~~~~~~
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:2528:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/johnny/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/johnny/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/johnny/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/kexec.cc:14:
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:2544:35: note: candidate: ‘v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const’
                     Local<String> ToString(Isolate* isolate) const);
                                   ^~~~~~~~
/home/johnny/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:2544:35: note:   candidate expects 1 argument, 0 provided
                     Local<String> ToString(Isolate* isolate) const);
                                   ^~~~~~~~
/home/johnny/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/kexec.cc: At global scope:
../src/kexec.cc:115:12: error: variable or field ‘init’ declared void
 void init (Handle<Object> exports) {
            ^~~~~~
../src/kexec.cc:115:12: error: ‘Handle’ was not declared in this scope
../src/kexec.cc:115:12: note: suggested alternative: ‘rand_r’
 void init (Handle<Object> exports) {
            ^~~~~~
            rand_r
../src/kexec.cc:115:25: error: expected primary-expression before ‘>’ token
 void init (Handle<Object> exports) {
                         ^
../src/kexec.cc:115:27: error: ‘exports’ was not declared in this scope
 void init (Handle<Object> exports) {
                           ^~~~~~~
In file included from ../../nan/nan.h:53,
                 from ../src/kexec.cc:14:
../src/kexec.cc:119:20: error: ‘init’ was not declared in this scope
 NODE_MODULE(kexec, init);
                    ^~~~
/home/johnny/.node-gyp/12.0.0/include/node/node.h:556:36: note: in definition of macro ‘NODE_MODULE_X’
       (node::addon_register_func) (regfunc),                          \
                                    ^~~~~~~
../src/kexec.cc:119:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(kexec, init);
 ^~~~~~~~~~~
../src/kexec.cc:119:20: note: suggested alternative: ‘int’
 NODE_MODULE(kexec, init);
                    ^~~~
/home/johnny/.node-gyp/12.0.0/include/node/node.h:556:36: note: in definition of macro ‘NODE_MODULE_X’
       (node::addon_register_func) (regfunc),                          \
                                    ^~~~~~~
../src/kexec.cc:119:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(kexec, init);
 ^~~~~~~~~~~
In file included from /home/johnny/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/kexec.cc:14:
/home/johnny/.node-gyp/12.0.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/johnny/.node-gyp/12.0.0/include/node/node_object_wrap.h:84:78:   required from here
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:9817:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/johnny/.node-gyp/12.0.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/home/johnny/.node-gyp/12.0.0/include/node/v8.h:9817:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
make: *** [kexec.target.mk:109: Release/obj.target/kexec/src/kexec.o] Error 1
make: Leaving directory '/home/johnny/projects/proxy_mgmt_cli/node_modules/kexec/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/johnny/.asdf/installs/nodejs/12.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 5.0.4-arch1-1-ARCH
gyp ERR! command "/home/johnny/.asdf/installs/nodejs/12.0.0/bin/node" "/home/johnny/.asdf/installs/nodejs/12.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/johnny/projects/proxy_mgmt_cli/node_modules/kexec
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Do you want to tackle this @jprichardson or are you more comfortable with a PR?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions