node-inspector / v8-profiler

node bindings for the v8 profiler
BSD 2-Clause "Simplified" License
1.13k stars 134 forks source link

Replace calls to v8::Object::Set/GetHiddenValue with Set/GetPrivate #96

Closed enlight closed 7 years ago

enlight commented 8 years ago

The Set/GetHiddenValue API was removed in V8 5.2, which is shipped in Electron 1.3.0. Presumably at some point NAN will get updated to handle this breaking API change, but for the time being I've sourced an alternative implementation of the removed functionality using the v8::Object::Set/GetPrivate API. Compatibility with older V8 versions has been preserved.

sometimeskind commented 7 years ago

@3y3 Is it possible to merge this PR?

bonesoul commented 7 years ago

any updates on this?

gergelyke commented 7 years ago

If anyone needs it, you can grab from here: https://github.com/RisingStack/v8-profiler or https://www.npmjs.com/package/@risingstack/v8-profiler cc @enlight @tomruttle @bonesoul

bompus commented 7 years ago

Just checking in to see if this package is going to be updated for node v7+ or taken over by somebody else?

dbo commented 7 years ago

@3y3 What needs to be done here?

szabof-JS commented 7 years ago

Is there anyone who can use v8-profiler for Electron apps these days? I've tried the solutions by @gergelyke and @jrieken and I got this error:

Error: The specified procedure could not be found.
\\?\C:\_CODE\electron-markdownify\node_modules\v8-profiler\build\Release\profiler.node
    at Error (native)
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
    at Object.Module._extensions..node (module.js:583:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\_CODE\electron-markdownify\node_modules\v8-profiler\v8-profiler.js:2:15)

Tried with Node v6.1.0, v6.3.1, and v7.4.0 on Windows 10 64 bit, Electron is v1.4.13.

megastef commented 7 years ago

@gergelyke risingstack version fails to compile on Linux x64, node 7.5

> @risingstack/v8-profiler@5.7.0 install /usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://node-inspector.s3.amazonaws.com/profiler/v5.7.0/node-v51-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for @risingstack/v8-profiler@5.7.0 and node@7.5.0 (node-v51 ABI) (falling back to source compile with node-gyp) 
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/ubuntu/.node-gyp/7.5.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler/.node-gyp"
make: Entering directory `/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler/build'
make: *** No rule to make target `../.node-gyp/7.5.0/include/node/common.gypi', needed by `Makefile'.  Stop.
make: Leaving directory `/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 3.13.0-108-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler/build/profiler/v5.7.0/node-v51-linux-x64/profiler.node" "--module_name=profiler" "--module_path=/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler/build/profiler/v5.7.0/node-v51-linux-x64"
gyp ERR! cwd /usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler/build/profiler/v5.7.0/node-v51-linux-x64/profiler.node --module_name=profiler --module_path=/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler/build/profiler/v5.7.0/node-v51-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:890:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 3.13.0-108-generic
node-pre-gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler
node-pre-gyp ERR! node -v v7.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.33
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler/build/profiler/v5.7.0/node-v51-linux-x64/profiler.node --module_name=profiler --module_path=/usr/lib/node_modules/@sematext/logagent-nodejs-monitor/node_modules/@risingstack/v8-profiler/build/profiler/v5.7.0/node-v51-linux-x64' (1)
/usr/lib
└── (empty)

npm ERR! Linux 3.13.0-108-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "i" "-g" "@sematext/logagent-nodejs-monitor"
npm ERR! node v7.5.0
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE

npm ERR! @risingstack/v8-profiler@5.7.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @risingstack/v8-profiler@5.7.0 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @risingstack/v8-profiler package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @risingstack/v8-profiler
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @risingstack/v8-profiler
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/npm-debug.log
hustxiaoc commented 7 years ago

Hi, the issue has been resolved in https://github.com/node-inspector/v8-profiler/pull/106 , is it ok to close this pr?