h0x91b / redis-fast-driver

78 stars 13 forks source link

Failure to compile on Node 12 #24

Closed STRML closed 5 years ago

STRML commented 5 years ago

The error thrown:

error /Users/dev/git/project/node_modules/redis-fast-driver: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /Users/dev/git/project/node_modules/redis-fast-driver
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 | darwin | x64
gyp info spawn /usr/local/bin/python2
gyp info spawn args [
gyp info spawn args   '/usr/local/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   '/Users/dev/git/project/node_modules/redis-fast-driver/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/dev/.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=/Users/dev/.node-gyp/12.0.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/dev/.node-gyp/12.0.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/dev/git/project/node_modules/redis-fast-driver',
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' ]
  CC(target) Release/obj.target/hiredis/deps/hiredis/hiredis.o
  CC(target) Release/obj.target/hiredis/deps/hiredis/net.o
  CC(target) Release/obj.target/hiredis/deps/hiredis/sds.o
  CC(target) Release/obj.target/hiredis/deps/hiredis/async.o
  CC(target) Release/obj.target/hiredis/deps/hiredis/read.o
  LIBTOOL-STATIC Release/hiredis.a
  CXX(target) Release/obj.target/redis-fast-driver/src/redis-fast-driver.o
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:22:1: warning: 'ToBoolean' is deprecated: ToBoolean can never throw. Use Local version. [-Wdeprecated-declarations]
X(Boolean)
^
../../nan/nan_converters_43_inl.h:18:12: note: expanded from macro 'X'
      val->To ## TYPE(isolate->GetCurrentContext())                            \
           ^
<scratch space>:353:1: note: expanded from here
ToBoolean
^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:2523:3: note: 'ToBoolean' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("ToBoolean can never throw. Use Local version.",
  ^
/Users/dev/.node-gyp/12.0.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:40:1: warning: 'BooleanValue' is deprecated: BooleanValue can never throw. Use Isolate version. [-Wdeprecated-declarations]
X(bool, Boolean)
^
../../nan/nan_converters_43_inl.h:37:15: note: expanded from macro 'X'
  return val->NAME ## Value(isolate->GetCurrentContext());                     \
              ^
<scratch space>:360:1: note: expanded from here
BooleanValue
^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:2561:3: note: 'BooleanValue' has been explicitly marked deprecated here
  V8_DEPRECATED("BooleanValue can never throw. Use Isolate version.",
  ^
/Users/dev/.node-gyp/12.0.0/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from 'v8::Isolate *' to 'Local<v8::Context>'
  return scope.Escape(v8::Function::New( isolate
                                         ^~~~~~~
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:183:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'v8::Isolate *' to 'const v8::Local<v8::Context> &' for 1st argument
class Local {
      ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:183:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'v8::Isolate *' to 'v8::Local<v8::Context> &&' for 1st argument
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:187:13: note: candidate template ignored: could not match 'Local<type-parameter-0-0>' against 'v8::Isolate *'
  V8_INLINE Local(Local<S> that)
            ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:4126:22: note: passing argument to parameter 'context' here
      Local<Context> context, FunctionCallback callback,
                     ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:337:37: error: too few arguments to function call, expected 2, have 1
  return v8::StringObject::New(value).As<v8::StringObject>();
         ~~~~~~~~~~~~~~~~~~~~~      ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:5380:3: note: 'New' declared here
  static Local<Value> New(Isolate* isolate, Local<String> value);
  ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:337:58: error: expected '(' for function-style cast or type construction
  return v8::StringObject::New(value).As<v8::StringObject>();
                                         ~~~~~~~~~~~~~~~~^
../../nan/nan_implementation_12_inl.h:337:60: error: expected expression
  return v8::StringObject::New(value).As<v8::StringObject>();
                                                           ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
../../nan/nan.h:1034:44: error: no matching member function for call to 'ToString'
      v8::Local<v8::String> string = from->ToString();
                                     ~~~~~~^~~~~~~~
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:2528:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:2544:35: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
                    Local<String> ToString(Isolate* isolate) const);
                                  ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
../../nan/nan.h:1044:37: error: cannot initialize a parameter of type 'v8::Isolate *' with an lvalue of type 'char *'
        length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
                                    ^~~~
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:2738:26: note: passing argument to parameter 'isolate' here
  int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
                         ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
../../nan/nan.h:1818:28: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
                           ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/dev/.node-gyp/12.0.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
../../nan/nan.h:1824:28: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    New(persistentHandle)->Set(key, value);
                           ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/dev/.node-gyp/12.0.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
../../nan/nan.h:1830:28: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    New(persistentHandle)->Set(index, value);
                           ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:3367:3: note: 'Set' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/dev/.node-gyp/12.0.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
../../nan/nan.h:1836:32: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
        New(persistentHandle)->Get(New(key).ToLocalChecked()));
                               ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
  ^
/Users/dev/.node-gyp/12.0.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
../../nan/nan.h:1842:48: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
    return scope.Escape(New(persistentHandle)->Get(key));
                                               ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
  ^
/Users/dev/.node-gyp/12.0.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
../../nan/nan.h:1847:48: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
    return scope.Escape(New(persistentHandle)->Get(index));
                                               ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:3416:3: note: 'Get' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(uint32_t index));
  ^
/Users/dev/.node-gyp/12.0.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
In file included from ../../nan/nan.h:2657:
../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(persistent().IsNearDeath());
           ~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
In file included from ../../nan/nan.h:2657:
../../nan/nan_object_wrap.h:67:18: warning: 'MarkIndependent' is deprecated: Weak objects are always considered independent. Use TracedGlobal when trying to use EmbedderHeapTracer. Use a strong handle when trying to keep an object alive. [-Wdeprecated-declarations]
    persistent().MarkIndependent();
                 ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:563:3: note: 'MarkIndependent' has been explicitly marked deprecated here
  V8_DEPRECATED(
  ^
/Users/dev/.node-gyp/12.0.0/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/redis-fast-driver.cc:8:
In file included from ../src/redis-fast-driver.h:4:
In file included from ../../nan/nan.h:2657:
../../nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(wrap->handle_.IsNearDeath());
           ~~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../src/redis-fast-driver.cc:8:
../src/redis-fast-driver.h:23:23: error: no template named 'Handle' in namespace 'v8'
        static void Init(v8::Handle<v8::Object> exports);
                         ~~~~^
../src/redis-fast-driver.cc:12:6: error: variable has incomplete type 'void'
void init(Handle<Object> exports) {
     ^
../src/redis-fast-driver.cc:12:18: error: 'Object' does not refer to a value
void init(Handle<Object> exports) {
                 ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:3356:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../src/redis-fast-driver.cc:12:11: error: use of undeclared identifier 'Handle'
void init(Handle<Object> exports) {
          ^
../src/redis-fast-driver.cc:12:26: error: use of undeclared identifier 'exports'
void init(Handle<Object> exports) {
                         ^
../src/redis-fast-driver.cc:12:34: error: expected ';' after top level declarator
void init(Handle<Object> exports) {
                                 ^
                                 ;
../src/redis-fast-driver.cc:29:22: error: variable has incomplete type 'void'
void RedisConnector::Init(Handle<Object> exports) {
                     ^
../src/redis-fast-driver.cc:29:34: error: 'Object' does not refer to a value
void RedisConnector::Init(Handle<Object> exports) {
                                 ^
/Users/dev/.node-gyp/12.0.0/include/node/v8.h:3356:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../src/redis-fast-driver.cc:29:27: error: use of undeclared identifier 'Handle'
void RedisConnector::Init(Handle<Object> exports) {
                          ^
../src/redis-fast-driver.cc:29:42: error: use of undeclared identifier 'exports'
void RedisConnector::Init(Handle<Object> exports) {
                                         ^
../src/redis-fast-driver.cc:29:50: error: expected ';' after top level declarator
void RedisConnector::Init(Handle<Object> exports) {
                                                 ^
                                                 ;
9 warnings and 19 errors generated.
make: *** [Release/obj.target/redis-fast-driver/src/redis-fast-driver.o] Error 1
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: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 Darwin 18.5.0
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 /Users/dev/git/project/node_modules/redis-fast-driver
h0x91b commented 5 years ago

Hello, thanks for the information, probably Nan2 isn't ready yet to support node 12 (https://github.com/nodejs/nan/issues/849). I will track the issue.

Best Regards, Arseniy

h0x91b commented 5 years ago

Fixed in version v2.1.3

h0x91b commented 5 years ago

2 commits: b9a446ba40bb93ce366a62e5048c28c4477568a3 and 98690de787724ab4969f7e5bb6012211d37e839d