jhs67 / usocket

node unix domain sockets
ISC License
12 stars 7 forks source link

Broken on node 12 #4

Closed daguej closed 4 years ago

daguej commented 4 years ago

usocket does not build with node v12.

$ npm i usocket

> usocket@0.1.0 install /home/josh/ustest/node_modules/usocket
> node-gyp rebuild

make: Entering directory '/home/josh/ustest/node_modules/usocket/build'
  CXX(target) Release/obj.target/uwrap/src/uwrap.o
../src/uwrap.cc:80:7: error: ‘Handle’ in namespace ‘v8’ does not name a template type
   v8::Handle<v8::Value> makeError() {
       ^~~~~~
../src/uwrap.cc:124:24: error: ‘v8::Handle’ has not been declared
   static void init(v8::Handle<v8::Object> target) {
                        ^~~~~~
../src/uwrap.cc:124:30: error: expected ‘,’ or ‘...’ before ‘<’ token
   static void init(v8::Handle<v8::Object> target) {
                              ^
../src/uwrap.cc: In static member function ‘static void uwrap::UWrap<SubClass>::init(int)’:
../src/uwrap.cc:138:13: error: ‘target’ was not declared in this scope
    Nan::Set(target, className, Nan::GetFunction(tpl).ToLocalChecked());
             ^~~~~~
../src/uwrap.cc:138:13: note: suggested alternative: ‘tzset’
    Nan::Set(target, className, Nan::GetFunction(tpl).ToLocalChecked());
             ^~~~~~
             tzset
../src/uwrap.cc: At global scope:
../src/uwrap.cc:271:26: error: ‘v8::Handle’ has not been declared
   static void v8Init(v8::Handle<v8::FunctionTemplate> tpl) {
                          ^~~~~~
../src/uwrap.cc:271:32: error: expected ‘,’ or ‘...’ before ‘<’ token
   static void v8Init(v8::Handle<v8::FunctionTemplate> tpl) {
                                ^
../src/uwrap.cc: In static member function ‘static void uwrap::UServerWrap::v8Init(int)’:
../src/uwrap.cc:272:23: error: ‘tpl’ was not declared in this scope
    SetPrototypeMethod(tpl, "listen", listen);
                       ^~~
../src/uwrap.cc: In lambda function:
../src/uwrap.cc:334:31: error: ‘struct uwrap::SocketResult’ has no member named ‘makeError’; did you mean ‘isError’?
      callback("error", result.makeError());
                               ^~~~~~~~~
                               isError
../src/uwrap.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE uwrap::UServerWrap::listen(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/uwrap.cc:351:65: error: no matching function for call to ‘v8::Value::Int32Value()’
    wrap->_listen(*Nan::Utf8String(info[0]), info[1]->Int32Value());
                                                                 ^
In file included from ../src/uwrap.cc:11:0:
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:2613:40: note: candidate: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^~~~~~~~~~
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
../src/uwrap.cc: At global scope:
../src/uwrap.cc:365:26: error: ‘v8::Handle’ has not been declared
   static void v8Init(v8::Handle<v8::FunctionTemplate> tpl) {
                          ^~~~~~
../src/uwrap.cc:365:32: error: expected ‘,’ or ‘...’ before ‘<’ token
   static void v8Init(v8::Handle<v8::FunctionTemplate> tpl) {
                                ^
../src/uwrap.cc: In static member function ‘static void uwrap::USocketWrap::v8Init(int)’:
../src/uwrap.cc:366:23: error: ‘tpl’ was not declared in this scope
    SetPrototypeMethod(tpl, "connect", connect);
                       ^~~
../src/uwrap.cc: In member function ‘bool uwrap::USocketWrap::readLoop()’:
../src/uwrap.cc:425:33: warning: ‘bool v8::Object::Set(uint32_t, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
       t->Set(0, Nan::New(fds[i]));
                                 ^
In file included from /home/josh/.cache/node-gyp/12.14.0/include/node/v8-internal.h:14:0,
                 from /home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:25,
                 from ../src/uwrap.cc:11:
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:3412:22: note: declared here
                 bool Set(uint32_t index, Local<Value> value));
                      ^
/home/josh/.cache/node-gyp/12.14.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/uwrap.cc: In lambda function:
../src/uwrap.cc:482:31: error: ‘struct uwrap::SocketResult’ has no member named ‘makeError’; did you mean ‘isError’?
      callback("error", result.makeError());
                               ^~~~~~~~~
                               isError
../src/uwrap.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE uwrap::USocketWrap::adopt(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/uwrap.cc:516:37: error: no matching function for call to ‘v8::Value::Int32Value()’
    wrap->_adopt(info[0]->Int32Value());
                                     ^
In file included from ../src/uwrap.cc:11:0:
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:2613:40: note: candidate: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^~~~~~~~~~
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
../src/uwrap.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE uwrap::USocketWrap::write(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/uwrap.cc:570:55: error: no matching function for call to ‘v8::Value::ToObject()’
     v8::Local<v8::Object> databuf = info[0]->ToObject();
                                                       ^
In file included from ../src/uwrap.cc:11:0:
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:2576:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:2576:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/josh/.cache/node-gyp/12.14.0/include/node/v8-internal.h:14:0,
                 from /home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:25,
                 from ../src/uwrap.cc:11:
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:2590:31: note: candidate: v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
                 Local<Object> ToObject(Isolate* isolate) const);
                               ^
/home/josh/.cache/node-gyp/12.14.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:2590:31: note:   candidate expects 1 argument, 0 provided
                 Local<Object> ToObject(Isolate* isolate) const);
                               ^
/home/josh/.cache/node-gyp/12.14.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/uwrap.cc:579:36: warning: ‘v8::Local<v8::Value> v8::Object::Get(uint32_t)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
      fds[i] = jsfds->Get(int32_t(i))->Int32Value();
                                    ^
In file included from /home/josh/.cache/node-gyp/12.14.0/include/node/v8-internal.h:14:0,
                 from /home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:25,
                 from ../src/uwrap.cc:11:
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:3461:51: note: declared here
   V8_DEPRECATED("Use maybe version", Local<Value> Get(uint32_t index));
                                                   ^
/home/josh/.cache/node-gyp/12.14.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/uwrap.cc:579:50: error: no matching function for call to ‘v8::Value::Int32Value()’
      fds[i] = jsfds->Get(int32_t(i))->Int32Value();
                                                  ^
In file included from ../src/uwrap.cc:11:0:
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:2613:40: note: candidate: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^~~~~~~~~~
/home/josh/.cache/node-gyp/12.14.0/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
../src/uwrap.cc:585:17: error: ‘struct uwrap::BoolResult’ has no member named ‘makeError’; did you mean ‘isError’?
     jsret = ret.makeError();
                 ^~~~~~~~~
                 isError
../src/uwrap.cc: In function ‘void uwrap::init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’:
../src/uwrap.cc:608:27: error: no matching function for call to ‘uwrap::UServerWrap::init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE&)’
   UServerWrap::init(target);
                           ^
../src/uwrap.cc:124:15: note: candidate: static void uwrap::UWrap<SubClass>::init(int) [with SubClass = uwrap::UServerWrap]
   static void init(v8::Handle<v8::Object> target) {
               ^~~~
../src/uwrap.cc:124:15: note:   no known conversion for argument 1 from ‘Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE {aka v8::Local<v8::Object>}’ to ‘int’
../src/uwrap.cc:609:27: error: no matching function for call to ‘uwrap::USocketWrap::init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE&)’
   USocketWrap::init(target);
                           ^
../src/uwrap.cc:124:15: note: candidate: static void uwrap::UWrap<SubClass>::init(int) [with SubClass = uwrap::USocketWrap]
   static void init(v8::Handle<v8::Object> target) {
               ^~~~
../src/uwrap.cc:124:15: note:   no known conversion for argument 1 from ‘Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE {aka v8::Local<v8::Object>}’ to ‘int’
../src/uwrap.cc: In instantiation of ‘static void uwrap::UWrap<SubClass>::init(int) [with SubClass = uwrap::UServerWrap]’:
../src/uwrap.cc:608:16:   required from here
../src/uwrap.cc:130:20: error: no matching function for call to ‘uwrap::UServerWrap::v8Init(v8::Local<v8::FunctionTemplate>&)’
    SubClass::v8Init(tpl);
    ~~~~~~~~~~~~~~~~^~~~~
../src/uwrap.cc:271:15: note: candidate: static void uwrap::UServerWrap::v8Init(int)
   static void v8Init(v8::Handle<v8::FunctionTemplate> tpl) {
               ^~~~~~
../src/uwrap.cc:271:15: note:   no known conversion for argument 1 from ‘v8::Local<v8::FunctionTemplate>’ to ‘int’
../src/uwrap.cc: In instantiation of ‘static void uwrap::UWrap<SubClass>::init(int) [with SubClass = uwrap::USocketWrap]’:
../src/uwrap.cc:609:16:   required from here
../src/uwrap.cc:130:20: error: no matching function for call to ‘uwrap::USocketWrap::v8Init(v8::Local<v8::FunctionTemplate>&)’
    SubClass::v8Init(tpl);
    ~~~~~~~~~~~~~~~~^~~~~
../src/uwrap.cc:365:15: note: candidate: static void uwrap::USocketWrap::v8Init(int)
   static void v8Init(v8::Handle<v8::FunctionTemplate> tpl) {
               ^~~~~~
../src/uwrap.cc:365:15: note:   no known conversion for argument 1 from ‘v8::Local<v8::FunctionTemplate>’ to ‘int’
uwrap.target.mk:111: recipe for target 'Release/obj.target/uwrap/src/uwrap.o' failed
make: *** [Release/obj.target/uwrap/src/uwrap.o] Error 1
make: Leaving directory '/home/josh/ustest/node_modules/usocket/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 5.0.0-37-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/josh/ustest/node_modules/usocket
gyp ERR! node -v v12.14.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/home/josh/ustest/package.json'
npm WARN ustest No description
npm WARN ustest No repository field.
npm WARN ustest No README data
npm WARN ustest No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! usocket@0.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the usocket@0.1.0 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/josh/.npm/_logs/2020-03-12T22_40_10_764Z-debug.log
jhs67 commented 4 years ago

I think I have resolved this issue (and another I found along the way). I've published 0.2.0 with the changes.