Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you verify npm is compiled against iojs #426

Closed
Raynos opened this issue Jan 14, 2015 · 4 comments
Closed

How do you verify npm is compiled against iojs #426

Raynos opened this issue Jan 14, 2015 · 4 comments

Comments

@Raynos
Copy link
Contributor

Raynos commented Jan 14, 2015

cc @rvagg @othiym23

TL:DR;

  • How do I determine which version of iojs my npm binary is compiled against
  • How do I determine whether binary modules fail because they dont support iojs or I compiled them against node instead of iojs

I compiled iojs from source. This created a iojs compatible binary at /usr/local/bin/npm version

I try to verify that my new npm is compiled against iojs with

raynos at raynos-MacBookPro  ~/projects
$ /usr/local/bin/npm version
{ npm: '2.2.0',
  ares: '1.9.0-DEV',
  http_parser: '1.0',
  modules: '11',
  node: '0.10.26',
  openssl: '1.0.1e',
  uv: '0.10.25',
  v8: '3.14.5.9',
  zlib: '1.2.3' }
raynos at raynos-MacBookPro  ~/projects
$ npm version
{ http_parser: '1.0',
  node: '0.10.26',
  v8: '3.14.5.9',
  ares: '1.9.0-DEV',
  uv: '0.10.25',
  zlib: '1.2.3',
  modules: '11',
  openssl: '1.0.1e',
  npm: '1.4.28' }

As you can see the only difference is the version of npm, I know my local npm on PATH is compiled against node 0.10

How do I know whether npm install or npm rebuild in my application will actually recompile my modules against iojs.

There is nothing in the npm rebuild output that tells me information

> [email protected] install /home/raynos/uber/demand-io/node_modules/playdoh-perf/node_modules/v8-profiler
> node-pre-gyp install --fallback-to-build

[v8-profiler] Success: "/home/raynos/uber/demand-io/node_modules/playdoh-perf/node_modules/v8-profiler/build/profiler/v5.2.2/node-v11-linux-x64/profiler.node" already installed
Pass --build-from-source to recompile

> [email protected] install /home/raynos/uber/demand-io/node_modules/ringpop-sirvice/node_modules/ringpop/node_modules/farmhash
> node-gyp rebuild

make: Entering directory `/home/raynos/uber/demand-io/node_modules/ringpop-sirvice/node_modules/ringpop/node_modules/farmhash/build'
  CXX(target) Release/obj.target/farmhash/src/upstream/farmhash.o
  CXX(target) Release/obj.target/farmhash/src/farmhash.o
  SOLINK_MODULE(target) Release/obj.target/farmhash.node
  SOLINK_MODULE(target) Release/obj.target/farmhash.node: Finished
  COPY Release/farmhash.node
make: Leaving directory `/home/raynos/uber/demand-io/node_modules/ringpop-sirvice/node_modules/ringpop/node_modules/farmhash/build'

When I run my application it fails. I presume its because v8-profiler doesnt support iojs but I cant tell from the output

$ iojs server/server.js 
module.js:324
    throw err;
          ^
Error: Cannot find module '/home/raynos/uber/demand-io/node_modules/playdoh-perf/node_modules/v8-profiler/build/profiler/v5.2.2/node-v42-linux-x64/profiler.node'
    at Function.Module._resolveFilename (module.js:322:15)
    at Function.Module._load (module.js:264:25)
    at Module.require (module.js:351:17)
    at require (module.js:370:17)
    at Object.<anonymous> (/home/raynos/uber/demand-io/node_modules/playdoh-perf/node_modules/v8-profiler/v8-profiler.js:4:15)
    at Module._compile (module.js:446:26)
    at Object.Module._extensions..js (module.js:464:10)
    at Module.load (module.js:341:32)
    at Function.Module._load (module.js:296:12)
    at Module.require (module.js:351:17)

It'd be great if we had a way of knowing what the state of my binary dependencies are. i.e. which version of v8 are they compiled against. Which version of node.h or iojs.h

@mscdex
Copy link
Contributor

mscdex commented Jan 14, 2015

Currently the process.versions.node should be updated. So it should show 1.0.0 or 1.0.1.

@Raynos
Copy link
Contributor Author

Raynos commented Jan 15, 2015

@mscdex that's only for the iojs binary. I want to figure out how to use the npm binary in some fashion to figure out whether its linked againts node 0.10 or iojs 1.0.2

@othiym23
Copy link
Contributor

There's definitely nothing specific that npm itself does. Remember that it doesn't even build the binaries, but instead hands that responsibility off to node-gyp during the package build / rebuild step. If you want to futz around with nm / ldd / otool, you can probably figure out which libraries were used to build a given binary, but a more explicit denotation would certainly be handy. Maybe open an issue on node-gyp, or see if any of the discussion on nodejs/node-gyp#564 gives you any ideas.

@Fishrock123
Copy link
Contributor

seems like a node-gyp thing? re-open if it isn't. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants