chrisa / node-dtrace-provider

Native DTrace probes for node.js apps
Other
321 stars 68 forks source link

`npm install dtrace-provider@0.2.0` fails on Mac #21

Closed trentm closed 12 years ago

trentm commented 12 years ago

Worked fine on v0.0.9. This is breaking ldapjs@0.5.5 installation on Mac, FWIW.

$ npm install dtrace-provider@0.2.0
npm http GET https://registry.npmjs.org/dtrace-provider/0.2.0
npm http 304 https://registry.npmjs.org/dtrace-provider/0.2.0

> dtrace-provider@0.2.0 install /Users/trentm/tmp/m/node_modules/dtrace-provider
> node-gyp rebuild

  ACTION binding_gyp_libusdt_target_build_libusdt .
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
cc  -arch x86_64   -c -o usdt.o usdt.c
cc  -arch x86_64   -c -o usdt_dof_file.o usdt_dof_file.c
as -arch x86_64 -o usdt_tracepoints.o usdt_tracepoints_x86_64.s
cc  -arch x86_64   -c -o usdt_probe.o usdt_probe.c
cc  -arch x86_64   -c -o usdt_dof.o usdt_dof.c
cc  -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.node
  CXX(target) Release/obj.target/DTraceProviderBindings/dtrace_provider.o
  CXX(target) Release/obj.target/DTraceProviderBindings/dtrace_probe.o
  SOLINK_MODULE(target) Release/DTraceProviderBindings.node
ld: -L must be immediately followed by a directory path (no space)
collect2: ld returned 1 exit status
make: *** [Release/DTraceProviderBindings.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/trentm/opt/node-0.8.9/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:219:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Darwin 10.8.0
gyp ERR! command "node" "/Users/trentm/opt/node-0.8.9/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/trentm/tmp/m/node_modules/dtrace-provider
gyp ERR! node -v v0.8.9
gyp ERR! node-gyp -v v0.6.8
gyp ERR! not ok 
npm ERR! dtrace-provider@0.2.0 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the dtrace-provider@0.2.0 install script.
npm ERR! This is most likely a problem with the dtrace-provider package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls dtrace-provider
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 10.8.0
npm ERR! command "/Users/trentm/opt/node-0.8.9/bin/node" "/Users/trentm/opt/node-0.8/bin/npm" "install" "dtrace-provider@0.2.0"
npm ERR! cwd /Users/trentm/tmp/m
npm ERR! node -v v0.8.9
npm ERR! npm -v 1.1.61
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/trentm/tmp/m/npm-debug.log
npm ERR! not ok code 0
trentm commented 12 years ago

With V=1 that is:

$ V=1 npm install
...
ranlib libusdt.a
  touch Release/obj.target/libusdt.stamp.node
  g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_DARWIN_USE_64_BIT_INODE=1' -I/Users/trentm/.node-gyp/0.8.9/src -I/Users/trentm/.node-gyp/0.8.9/deps/uv/include -I/Users/trentm/.node-gyp/0.8.9/deps/v8/include -I../libusdt  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -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
  g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_DARWIN_USE_64_BIT_INODE=1' -I/Users/trentm/.node-gyp/0.8.9/src -I/Users/trentm/.node-gyp/0.8.9/deps/uv/include -I/Users/trentm/.node-gyp/0.8.9/deps/v8/include -I../libusdt  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/DTraceProviderBindings/dtrace_probe.o.d.raw  -c -o Release/obj.target/DTraceProviderBindings/dtrace_probe.o ../dtrace_probe.cc
  ./gyp-mac-tool flock ./Release/linker.lock g++ -shared -Wl,-search_paths_first -mmacosx-version-min=10.5 -arch x86_64 -L./Release -install_name /usr/local/lib/DTraceProviderBindings.node  -o Release/DTraceProviderBindings.node Release/obj.target/DTraceProviderBindings/dtrace_provider.o Release/obj.target/DTraceProviderBindings/dtrace_probe.o -undefined dynamic_lookup -L /Users/trentm/src/node-dtrace-provider/libusdt -l usdt
ld: -L must be immediately followed by a directory path (no space)
collect2: ld returned 1 exit status
make: *** [Release/DTraceProviderBindings.node] Error 1
...
chrisa commented 12 years ago

I haven't seen this before - are you running 10.8 / Mountain Lion, by any chance?

trentm commented 12 years ago

No. I'm currently on snOw leopard (10.6).

chrisa commented 12 years ago

It looks like the linker on Snow Leopard is more picky than on some other platforms. I've adjusted the binding.gyp to remove the space and pushed version 0.2.1. I don't have access to a Snow Leopard box to test, but that seems to be the issue here.

Thanks for the report!

trentm commented 12 years ago

Thanks! HEAD works for me now on Snow Leopard (10.6).

yangtao309 commented 9 years ago

dtrace-provider@0.2.8 has error?

in my mac book pro 10.10

$ node -v
v0.12.4
$ npm -v
2.10.1

throws error info:

$ npm install ldapjs

> dtrace-provider@0.2.8 install /Users/yangtao/node_modules/ldapjs/node_modules/dtrace-provider
> node-gyp rebuild

  ACTION binding_gyp_libusdt_target_build_libusdt .
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 -arch x86_64   -c -o usdt.o usdt.c
usdt.c:212:9: warning: implicit declaration of function 'usdt_dof_section_free' is invalid in C99
      [-Wimplicit-function-declaration]
        usdt_dof_section_free(&strtab);
        ^
usdt.c:238:9: warning: implicit declaration of function 'usdt_dof_file_free' is invalid in C99 [-Wimplicit-function-declaration]
        usdt_dof_file_free(provider->file);
        ^
2 warnings generated.
gcc -O2 -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 -arch x86_64   -c -o usdt_probe.o usdt_probe.c
gcc -O2 -arch x86_64   -c -o usdt_dof.o usdt_dof.c
gcc -O2 -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
  CXX(target) Release/obj.target/DTraceProviderBindings/dtrace_provider.o
In file included from ../dtrace_provider.cc:1:
../dtrace_provider.h:69:44: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
    static v8::Handle<v8::Value> New(const v8::Arguments& args);
                                           ^~~~~~~~~~~~~
                                           v8::internal::Arguments
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../dtrace_provider.cc:1:
../dtrace_provider.h:70:45: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
    static v8::Handle<v8::Value> Fire(const v8::Arguments& args);
                                            ^~~~~~~~~~~~~
                                            v8::internal::Arguments
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../dtrace_provider.cc:1:
../dtrace_provider.h:87:44: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
    static v8::Handle<v8::Value> New(const v8::Arguments& args);
                                           ^~~~~~~~~~~~~
                                           v8::internal::Arguments
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../dtrace_provider.cc:1:
../dtrace_provider.h:88:49: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
    static v8::Handle<v8::Value> AddProbe(const v8::Arguments& args);
                                                ^~~~~~~~~~~~~
                                                v8::internal::Arguments
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../dtrace_provider.cc:1:
../dtrace_provider.h:89:52: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
    static v8::Handle<v8::Value> RemoveProbe(const v8::Arguments& args);
                                                   ^~~~~~~~~~~~~
                                                   v8::internal::Arguments
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../dtrace_provider.cc:1:
../dtrace_provider.h:90:47: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
    static v8::Handle<v8::Value> Enable(const v8::Arguments& args);
                                              ^~~~~~~~~~~~~
                                              v8::internal::Arguments
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../dtrace_provider.cc:1:
../dtrace_provider.h:91:48: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
    static v8::Handle<v8::Value> Disable(const v8::Arguments& args);
                                               ^~~~~~~~~~~~~
                                               v8::internal::Arguments
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../dtrace_provider.cc:1:
../dtrace_provider.h:92:45: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
    static v8::Handle<v8::Value> Fire(const v8::Arguments& args);
                                            ^~~~~~~~~~~~~
                                            v8::internal::Arguments
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../dtrace_provider.cc:23:17: error: calling a protected constructor of class 'v8::HandleScope'
    HandleScope scope;
                ^
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: note: declared protected here
  V8_INLINE HandleScope() {}
            ^
../dtrace_provider.cc:25:55: error: cannot initialize a parameter of type 'v8::Isolate *' with an lvalue of type
      'v8::Handle<v8::Value> (const v8::internal::Arguments &)'
    Local<FunctionTemplate> t = FunctionTemplate::New(DTraceProvider::New);
                                                      ^~~~~~~~~~~~~~~~~~~
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:3456:16: note: passing argument to parameter 'isolate' here
      Isolate* isolate,
               ^
../dtrace_provider.cc:26:58: error: 'New' is a private member of 'v8::PersistentBase<v8::FunctionTemplate>'
    constructor_template = Persistent<FunctionTemplate>::New(t);
                                                         ^
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:572:23: note: declared private here
  V8_INLINE static T* New(Isolate* isolate, T* that);
                      ^
../dtrace_provider.cc:26:28: error: too few arguments to function call, expected 2, have 1; did you mean 'DTraceProbe::New'?
    constructor_template = Persistent<FunctionTemplate>::New(t);
                           ^~~~~~~~~~
                           DTraceProbe::New
../dtrace_provider.h:69:34: note: 'DTraceProbe::New' declared here
    static v8::Handle<v8::Value> New(const v8::Arguments& args);
                                 ^
../dtrace_provider.cc:27:25: error: member reference type 'Persistent<v8::FunctionTemplate>' is not a pointer; maybe you meant to
      use '.'?
    constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
    ~~~~~~~~~~~~~~~~~~~~^~
                        .
../dtrace_provider.cc:27:27: error: no member named 'InstanceTemplate' in 'v8::Persistent<v8::FunctionTemplate,
      v8::NonCopyablePersistentTraits<v8::FunctionTemplate> >'
    constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
    ~~~~~~~~~~~~~~~~~~~~  ^
../dtrace_provider.cc:28:25: error: member reference type 'Persistent<v8::FunctionTemplate>' is not a pointer; maybe you meant to
      use '.'?
    constructor_template->SetClassName(String::NewSymbol("DTraceProvider"));
    ~~~~~~~~~~~~~~~~~~~~^~
                        .
../dtrace_provider.cc:28:27: error: no member named 'SetClassName' in 'v8::Persistent<v8::FunctionTemplate,
      v8::NonCopyablePersistentTraits<v8::FunctionTemplate> >'
    constructor_template->SetClassName(String::NewSymbol("DTraceProvider"));
    ~~~~~~~~~~~~~~~~~~~~  ^
../dtrace_provider.cc:28:48: error: no member named 'NewSymbol' in 'v8::String'
    constructor_template->SetClassName(String::NewSymbol("DTraceProvider"));
                                       ~~~~~~~~^
../dtrace_provider.cc:30:31: error: no viable conversion from 'Persistent<v8::FunctionTemplate>' to
      'v8::Handle<v8::FunctionTemplate>'
    NODE_SET_PROTOTYPE_METHOD(constructor_template, "addProbe", DTraceProvider::AddProbe);
                              ^~~~~~~~~~~~~~~~~~~~
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:196:26: note: candidate constructor (the implicit copy constructor) not
      viable: no known conversion from 'Persistent<v8::FunctionTemplate>' to 'const v8::Handle<v8::FunctionTemplate> &' for 1st
      argument
template <class T> class Handle {
                         ^
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:213:32: note: candidate template ignored: could not match 'Handle' against
      'Persistent'
  template <class S> V8_INLINE Handle(Handle<S> that)
                               ^
/Users/yangtao/.node-gyp/0.12.4/src/node.h:244:72: note: passing argument to parameter 'recv' here
inline void NODE_SET_PROTOTYPE_METHOD(v8::Handle<v8::FunctionTemplate> recv,
                                                                       ^
../dtrace_provider.cc:31:31: error: no viable conversion from 'Persistent<v8::FunctionTemplate>' to
      'v8::Handle<v8::FunctionTemplate>'
    NODE_SET_PROTOTYPE_METHOD(constructor_template, "removeProbe", DTraceProvider::RemoveProbe);
                              ^~~~~~~~~~~~~~~~~~~~
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:196:26: note: candidate constructor (the implicit copy constructor) not
      viable: no known conversion from 'Persistent<v8::FunctionTemplate>' to 'const v8::Handle<v8::FunctionTemplate> &' for 1st
      argument
template <class T> class Handle {
                         ^
/Users/yangtao/.node-gyp/0.12.4/deps/v8/include/v8.h:213:32: note: candidate template ignored: could not match 'Handle' against
      'Persistent'
  template <class S> V8_INLINE Handle(Handle<S> that)
                               ^
/Users/yangtao/.node-gyp/0.12.4/src/node.h:244:72: note: passing argument to parameter 'recv' here
inline void NODE_SET_PROTOTYPE_METHOD(v8::Handle<v8::FunctionTemplate> recv,
                                                                       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors 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:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/yangtao/node_modules/ldapjs/node_modules/dtrace-provider
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm WARN optional dep failed, continuing dtrace-provider@0.2.8
ldapjs@0.7.1 node_modules/ldapjs
├── assert-plus@0.1.5
├── asn1@0.2.1
├── nopt@2.1.1 (abbrev@1.0.6)
├── bunyan@0.22.1 (mv@0.0.5)
└── pooling@0.4.6 (once@1.3.0, vasync@1.4.0)

what's resolve this error? help me

davepacheco commented 9 years ago

Node 0.12 support was added in later versions of dtrace-provider. ldap.js probably needs to update its dtrace-provider dependency.