bnoordhuis / node-buffertools

working with node.js buffers made easy
ISC License
205 stars 35 forks source link

'node-gyp build' error on Mac, 'buffertools.cc error no member named 'Handle' in namespace 'v8'' #96

Closed eyison closed 5 years ago

eyison commented 5 years ago

my MacOS Mojave version is 10.14.5 , my operation as follows:

$ node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.3
gyp info using node@12.6.0 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp info spawn /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/usr/local/lib/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   '/work/tools/node-buffertools/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/eyison/Library/Caches/node-gyp/12.6.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/eyison/Library/Caches/node-gyp/12.6.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/eyison/Library/Caches/node-gyp/12.6.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/work/tools/node-buffertools',
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 ok 
$ node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.3
gyp info using node@12.6.0 | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/buffertools/buffertools.o
../buffertools.cc:32:11: error: no member named 'Handle' in namespace 'v8'
using v8::Handle;
      ~~~~^
../buffertools.cc:141:25: error: no matching member function for call to 'ToObject'
      target = args[0]->ToObject();
               ~~~~~~~~~^~~~~~~~
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2532:44: note: candidate function not viable: requires single argument 'context', but
      no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                           ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2546:31: note: candidate function not viable: requires single argument 'isolate', but
      no arguments were provided
                Local<Object> ToObject(Isolate* isolate) const);
                              ^
../buffertools.cc:143:7: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
      UNI_THROW_EXCEPTION(Exception::TypeError,
      ^
../buffertools.cc:77:26: note: expanded from macro 'UNI_THROW_EXCEPTION'
        type(v8::String::NewFromUtf8(args.GetIsolate(), message)));
                         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../buffertools.cc:169:25: error: no matching member function for call to 'ToObject'
      target = args[0]->ToObject();
               ~~~~~~~~~^~~~~~~~
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2532:44: note: candidate function not viable: requires single argument 'context', but
      no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                           ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2546:31: note: candidate function not viable: requires single argument 'isolate', but
      no arguments were provided
                Local<Object> ToObject(Isolate* isolate) const);
                              ^
../buffertools.cc:171:7: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
      UNI_THROW_EXCEPTION(Exception::TypeError,
      ^
../buffertools.cc:77:26: note: expanded from macro 'UNI_THROW_EXCEPTION'
        type(v8::String::NewFromUtf8(args.GetIsolate(), message)));
                         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../buffertools.cc:177:25: error: no matching constructor for initialization of 'String::Utf8Value'
      String::Utf8Value s(args[args_start]);
                        ^ ~~~~~~~~~~~~~~~~
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:3002:5: note: candidate constructor not viable: no known conversion from
      'Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
    Utf8Value(const Utf8Value&) = delete;
    ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2995:5: note: candidate constructor not viable: requires 2 arguments, but 1 was
      provided
    Utf8Value(Isolate* isolate, Local<v8::Value> obj);
    ^
../buffertools.cc:187:47: error: no matching member function for call to 'ToObject'
      Local<Object> other = args[args_start]->ToObject();
                            ~~~~~~~~~~~~~~~~~~^~~~~~~~
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2532:44: note: candidate function not viable: requires single argument 'context', but
      no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                           ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2546:31: note: candidate function not viable: requires single argument 'isolate', but
      no arguments were provided
                Local<Object> ToObject(Isolate* isolate) const);
                              ^
../buffertools.cc:196:5: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    UNI_THROW_EXCEPTION(Exception::TypeError,
    ^
../buffertools.cc:77:26: note: expanded from macro 'UNI_THROW_EXCEPTION'
        type(v8::String::NewFromUtf8(args.GetIsolate(), message)));
                         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../buffertools.cc:256:44: error: too few arguments to function call, single argument 'context' was not specified
      int c = args[args_start]->Int32Value();
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2569:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:351:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../buffertools.cc:261:25: error: no matching constructor for initialization of 'String::Utf8Value'
      String::Utf8Value s(args[args_start]);
                        ^ ~~~~~~~~~~~~~~~~
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:3002:5: note: candidate constructor not viable: no known conversion from
      'Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
    Utf8Value(const Utf8Value&) = delete;
    ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2995:5: note: candidate constructor not viable: requires 2 arguments, but 1 was
      provided
    Utf8Value(Isolate* isolate, Local<v8::Value> obj);
    ^
../buffertools.cc:266:47: error: no matching member function for call to 'ToObject'
      Local<Object> other = args[args_start]->ToObject();
                            ~~~~~~~~~~~~~~~~~~^~~~~~~~
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2532:44: note: candidate function not viable: requires single argument 'context', but
      no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                           ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2546:31: note: candidate function not viable: requires single argument 'isolate', but
      no arguments were provided
                Local<Object> ToObject(Isolate* isolate) const);
                              ^
../buffertools.cc:272:5: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    UNI_THROW_EXCEPTION(Exception::TypeError,
    ^
../buffertools.cc:77:26: note: expanded from macro 'UNI_THROW_EXCEPTION'
        type(v8::String::NewFromUtf8(args.GetIsolate(), message)));
                         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../buffertools.cc:329:54: error: too few arguments to function call, single argument 'context' was not specified
    int32_t start = args[args_start + 1]->Int32Value();
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2569:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:351:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../buffertools.cc:363:5: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    UNI_THROW_EXCEPTION(Exception::Error,
    ^
../buffertools.cc:77:26: note: expanded from macro 'UNI_THROW_EXCEPTION'
        type(v8::String::NewFromUtf8(args.GetIsolate(), message)));
                         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../buffertools.cc:381:7: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
      UNI_THROW_EXCEPTION(Exception::Error, "This is not hexadecimal data.");
      ^
../buffertools.cc:77:26: note: expanded from macro 'UNI_THROW_EXCEPTION'
        type(v8::String::NewFromUtf8(args.GetIsolate(), message)));
                         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../buffertools.cc:419:12: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    return UNI_STRING_NEW(s.c_str(), s.size());
           ^
../buffertools.cc:65:17: note: expanded from macro 'UNI_STRING_NEW'
    v8::String::NewFromUtf8(args.GetIsolate(),                                \
                ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../buffertools.cc:449:20: error: no matching member function for call to 'ToString'
      size += arg->ToString()->Utf8Length();
              ~~~~~^~~~~~~~
/Users/eyison/Library/Caches/node-gyp/12.6.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/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2544:31: note: candidate function not viable: requires single argument 'isolate', but
      no arguments were provided
                Local<String> ToString(Isolate* isolate) const);
                              ^
../buffertools.cc:452:41: error: no matching member function for call to 'ToObject'
      size += node::Buffer::Length(arg->ToObject());
                                   ~~~~~^~~~~~~~
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2532:44: note: candidate function not viable: requires single argument 'context', but
      no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                           ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2546:31: note: candidate function not viable: requires single argument 'isolate', but
      no arguments were provided
                Local<Object> ToObject(Isolate* isolate) const);
                              ^
../buffertools.cc:460:7: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
      UNI_THROW_AND_RETURN(Exception::TypeError, errmsg);
      ^
../buffertools.cc:72:28: note: expanded from macro 'UNI_THROW_AND_RETURN'
          type(v8::String::NewFromUtf8(args.GetIsolate(), message)));         \
                           ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../buffertools.cc:470:25: error: no matching constructor for initialization of 'String::Utf8Value'
      String::Utf8Value v(arg);
                        ^ ~~~
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:3002:5: note: candidate constructor not viable: no known conversion from
      'Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
    Utf8Value(const Utf8Value&) = delete;
    ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2995:5: note: candidate constructor not viable: requires 2 arguments, but 1 was
      provided
    Utf8Value(Isolate* isolate, Local<v8::Value> obj);
    ^
../buffertools.cc:475:30: error: no matching member function for call to 'ToObject'
      Local<Object> b = arg->ToObject();
                        ~~~~~^~~~~~~~
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2532:44: note: candidate function not viable: requires single argument 'context', but
      no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                           ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2546:31: note: candidate function not viable: requires single argument 'isolate', but
      no arguments were provided
                Local<Object> ToObject(Isolate* isolate) const);
                              ^
../buffertools.cc:482:7: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
      UNI_THROW_AND_RETURN(Exception::Error,
      ^
../buffertools.cc:72:28: note: expanded from macro 'UNI_THROW_AND_RETURN'
          type(v8::String::NewFromUtf8(args.GetIsolate(), message)));         \
                           ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../buffertools.cc:492:6: error: variable has incomplete type 'void'
void RegisterModule(Handle<Object> target) {
     ^
../buffertools.cc:492:21: error: use of undeclared identifier 'Handle'
void RegisterModule(Handle<Object> target) {
                    ^
../buffertools.cc:492:28: error: 'Object' does not refer to a value
void RegisterModule(Handle<Object> target) {
                           ^
/Users/eyison/Library/Caches/node-gyp/12.6.0/include/node/v8.h:3356:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../buffertools.cc:492:36: error: use of undeclared identifier 'target'
void RegisterModule(Handle<Object> target) {
                                   ^
../buffertools.cc:492:43: error: expected ';' after top level declarator
void RegisterModule(Handle<Object> target) {
                                          ^
                                          ;
9 warnings and 18 errors generated.
make: *** [Release/obj.target/buffertools/buffertools.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/node-gyp/lib/build.js:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:203:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/Cellar/node/12.6.0/bin/node" "/usr/local/bin/node-gyp" "build"
gyp ERR! cwd /work/tools/node-buffertools
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok 

my V8 version is

$ which d8
/usr/local/bin/d8
$ /usr/local/bin/d8 -v
V8 version 7.5.288.22
$ d8 -v
V8 version 7.5.288.22
bnoordhuis commented 5 years ago

To be honest, I haven't updated buffertools in years because its functionality has mostly been subsumed by Buffer itself, so I suppose it's no surprise it no longer builds.

Maybe I should put it out to pasture. Are you using it for anything critical?

eyison commented 5 years ago

I used mjpeg-consumer which depend on buffertools , it also haven't updated 3 years ,I guess I'll have to replace it with a new one.

bnoordhuis commented 5 years ago

I added a deprecation notice to the README. Maybe you can update mjpeg-consumer to switch to native Buffer methods?