chrisa / node-dtrace-provider

Native DTrace probes for node.js apps
Other
319 stars 70 forks source link

Deprecated NewInstance function now no longer exists #119

Closed constcuriosity closed 6 years ago

constcuriosity commented 6 years ago

I recently updated to Node 10.0.0v and npm 6.0.1 I use bunyan for my server side logging, which in turn uses dtrace-provider. I nuked my node_modules folder, reinstalled all of my packages, and then used npm rebuild just to be sure. Unfortunately dtrace-provider continues to fail to compile for me. After setting the V environment variable to a value, I got the following output:

> dtrace-provider@0.8.5 install /Users/ricky/Documents/yggdrasil/server/node_modules/dtrace-provider
> node scripts/install.js

  LD_LIBRARY_PATH=/Users/ricky/Documents/yggdrasil/server/node_modules/dtrace-provider/build/Release/lib.host:/Users/ricky/Documents/yggdrasil/server/node_modules/dtrace-provider/build/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; sh libusdt-build.sh
Building libusdt for x86_64
rm -f *.gch
rm -f *.o
rm -f libusdt.a
rm -f test_usdt
rm -f test_usdt32
rm -f test_usdt64
rm -f test_mem_usage
gcc -O2 -Wall -arch x86_64   -c -o usdt.o usdt.c
gcc -O2 -Wall -arch x86_64   -c -o usdt_dof_file.o usdt_dof_file.c
gcc -arch x86_64 -o usdt_tracepoints.o -c usdt_tracepoints_x86_64.s
gcc -O2 -Wall -arch x86_64   -c -o usdt_probe.o usdt_probe.c
gcc -O2 -Wall -arch x86_64   -c -o usdt_dof.o usdt_dof.c
gcc -O2 -Wall -arch x86_64   -c -o usdt_dof_sections.o usdt_dof_sections.c
rm -f libusdt.a
ar cru libusdt.a usdt.o usdt_dof_file.o usdt_tracepoints.o usdt_probe.o usdt_dof.o usdt_dof_sections.o 
ranlib libusdt.a
  touch Release/obj.target/libusdt.stamp
  c++ '-DNODE_GYP_MODULE_NAME=DTraceProviderBindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/ricky/.node-gyp/10.0.0/include/node -I/Users/ricky/.node-gyp/10.0.0/src -I/Users/ricky/.node-gyp/10.0.0/deps/uv/include -I/Users/ricky/.node-gyp/10.0.0/deps/v8/include -I../libusdt -I../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/DTraceProviderBindings/dtrace_provider.o.d.raw   -c -o Release/obj.target/DTraceProviderBindings/dtrace_provider.o ../dtrace_provider.cc
In file included from ../dtrace_provider.cc:1:
In file included from ../dtrace_provider.h:1:
../../nan/nan.h:839:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/ricky/.node-gyp/10.0.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/ricky/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../dtrace_provider.cc:1:
In file included from ../dtrace_provider.h:1:
../../nan/nan.h:854:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/ricky/.node-gyp/10.0.0/include/node/node.h:164:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/ricky/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../dtrace_provider.cc:1:
In file included from ../dtrace_provider.h:1:
../../nan/nan.h:869:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/ricky/.node-gyp/10.0.0/include/node/node.h:157:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/ricky/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../dtrace_provider.cc:1:
In file included from ../dtrace_provider.h:1:
../../nan/nan.h:1478:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return scope.Escape(node::MakeCallback(
                              ^
/Users/ricky/.node-gyp/10.0.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/ricky/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
../dtrace_provider.cc:52:23: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
    String::Utf8Value name(info[0]->ToString());
                      ^
/Users/ricky/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value' has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/ricky/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../dtrace_provider.cc:60:25: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
      String::Utf8Value mod(info[1]->ToString());
                        ^
/Users/ricky/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value' has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/ricky/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../dtrace_provider.cc:89:35: error: no matching member function for call to 'NewInstance'
    v8::Local<Object> pd = klass->NewInstance();
                           ~~~~~~~^~~~~~~~~~~
/Users/ricky/.node-gyp/10.0.0/include/node/v8.h:3851:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
/Users/ricky/.node-gyp/10.0.0/include/node/v8.h:3848:44: note: candidate function not viable: requires 3 arguments, but 0 were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
../dtrace_provider.cc:96:10: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
    Nan::ForceSet(pd, Nan::New<String>("__prov__").ToLocalChecked(), obj,
         ^
../../nan/nan_maybe_43_inl.h:116:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../dtrace_provider.cc:102:27: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
        String::Utf8Value type(info[i + 1]->ToString());
                          ^
/Users/ricky/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value' has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/ricky/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../dtrace_provider.cc:118:23: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
    String::Utf8Value name(info[0]->ToString());
                      ^
/Users/ricky/.node-gyp/10.0.0/include/node/v8.h:2821:5: note: 'Utf8Value' has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version",
    ^
/Users/ricky/.node-gyp/10.0.0/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
9 warnings and 1 error generated.
make: *** [Release/obj.target/DTraceProviderBindings/dtrace_provider.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:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/Cellar/node/10.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ricky/Documents/yggdrasil/server/node_modules/dtrace-provider
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

The main thing that stands out to me is the build error relating to NewInstance. In other issues that I've seen it's simply listed as a deprecated function, but now it's listed as not found.

jmhnilbog commented 6 years ago

Confirming this issue is present on my system as well. One wrinkle on my particular system is that I used xcode-select --install in the distant past to install xcode's command line tools. Only later did I break down and attempt the full install through the App Store while trying to get DTrace to compile.

@constcuriosity: did you do anything similar?

constcuriosity commented 6 years ago

I don't remember doing something like that. I think I've always had the full app installed. Not promising I didn't forget though. ;)

No9 commented 6 years ago

Landed a PR for this https://github.com/chrisa/node-dtrace-provider/pull/121 @melloc / @davepacheco would you mind taking a look when you have a min TY

melloc commented 6 years ago

Fixed in 06f8a69.