google / pprof-nodejs

pprof support for Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't compile on windows

kungfutse opened this issue · comments

Node-gyp fails with the following error when compiling on windows using visual studio 2017 build tools:

> pprof@1.1.0 install C:\Path\to\project\node_modules\pprof
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://storage.googleapis.com/cloud-profiler/pprof-nodejs/release/v1.1.0/node-v72-win32-x64-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not found for pprof@1.1.0 and node@12.10.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  profiler.cc
  win_delay_load_hook.cc
C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(140): error C2131: expression did not evaluate to a constant  [C:\Path\to\project\node_modules\pprof\build\pprof.vcxproj]
  C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(140): note: failure was caused by a read of a variable out
  side its lifetime
  C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(140): note: see usage of 'hitLineCount'
C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(148): error C2065: 'entry': undeclared identifier [C:\Users\ tonis\Repositories\verkkokauppa\richrelevance-api\node_modules\pprof\build\pprof.vcxproj]
C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(149): error C2065: 'entry': undeclared identifier [C:\Users\ tonis\Repositories\verkkokauppa\richrelevance-api\node_modules\pprof\build\pprof.vcxproj]
C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(145): error C2660: 'CreateTimeNode': function does not take
5 arguments [C:\Path\to\project\node_modules\pprof\build\pprof.vcxproj]
  C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(108): note: see declaration of 'CreateTimeNode'
C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(144): error C2661: 'Nan::Set': no overloaded function takes
2 arguments [C:\Path\to\project\node_modules\pprof\build\pprof.vcxproj]
C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(189): error C2131: expression did not evaluate to a constant  [C:\Path\to\project\node_modules\pprof\build\pprof.vcxproj]
  C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(189): note: failure was caused by a read of a variable out
  side its lifetime
  C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(189): note: see usage of 'count'
C:\Path\to\project\node_modules\pprof\bindings\profiler.cc(194): error C3863: array type 'v8::Local<v8::Array> [count]'  is not assignable [C:\Path\to\project\node_modules\pprof\build\pprof.vcxproj]
gyp ERR! build error

@kungfutse -- Thanks for reporting this.

I wanted to check before investigating further: have you followed node-gyp's installation instructions -- pprof uses the node-gyp module for its compilation, and node-gyp does require some additional dependencies to be installed.

yes, node-gyp itself works and successfully compiles e.g. bufferutil and sqlite3 packages.

Any updates on this? I'm also observing the same error. Other packages get properly build using the node-gyp module.

With the release of v1.3.0, it should be possible to compile the native portion of this module on Windows with Node 12. Please re-open if there are any issues.