TooTallNate / node-time

"time.h" bindings for Node.js
MIT License
381 stars 84 forks source link

Node v0.10 Support #80

Closed teburd closed 9 years ago

teburd commented 9 years ago

It appears that from time v0.11.3 -> v0.11.4 the package no longer builds against Node v0.10.x

In the meantime v0.11.3 does not build against node v4.1.0

This is a bit frustrating as we're using CentOS 7 which has node v0.10 for our production boxes. We could update node on there, but that results in a bunch of bugs from other packages (we've tried it before...)

Any chance this could be fixed so that time builds against v0.10 and v4.1.0 and everything between still?

Fyi the bugs I'm speaking of are...

https://discuss.newrelic.com/t/node-js-agent-1-22-0-unexpected-identifier-error/29005 https://github.com/nodejs/node-v0.x-archive/issues/9261 https://github.com/brianc/node-pg-copy-streams/issues/25

Everything but time v0.11.4 works perfectly fine on Node v0.10.

TooTallNate commented 9 years ago

v0.11.4 works for me with Node.js v0.10.40. What's the error that you're seeing? Also I'm not sure how any of those links are relevant to node-time...

TooTallNate commented 9 years ago

See https://travis-ci.org/TooTallNate/node-time/jobs/81075329

teburd commented 9 years ago

> time@0.11.4 install /home/tburdick/project/node_modules/time
> node-gyp rebuild

make: Entering directory `/home/tburdick/project/node_modules/time/build'
  CXX(target) Release/obj.target/time/src/time.o
In file included from ../src/time.cc:5:0:
../node_modules/nan/nan.h:316:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
   static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
                                               ^
make: *** [Release/obj.target/time/src/time.o] Error 1
make: Leaving directory `/home/tburdick/project/node_modules/time/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/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 4.1.0-x86_64-linode59
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/tburdick/project/node_modules/time
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

v0.10.36 is the latest version packaged for CentOS 7

The other links are references as to why we're using v0.10 still

TooTallNate commented 9 years ago

Does CentOS use a shared V8 package? It's likely a different version than the one required by nan. You're better off using the official binaries, or compiling node yourself to ensure the correct version of V8 is being used. See https://github.com/nodejs/nan/issues/414 for some more info.

teburd commented 9 years ago

It appears that yes, it does in fact used a shared v8 package and does some patching. Still the fact remains that it works fine with time v0.11.3 and not with v0.11.4... frustrating that minor revisions of all of these moving parts can possibly break things.

TooTallNate commented 9 years ago

Ya, that's my bad. I should have done a major version bump when I started using nan. I didn't think it would be a breaking change at the time though since vanilla node.js v0.10 still works. This was a kind of hard-to-catch edge case.

Either pin your node-time version to v0.11.3 in your app, or use a node distro that uses the matching V8 version. Hope that helps and sorry for the frustration.

teburd commented 9 years ago

I appreciate the help in figuring this out, hopefully this issue is helpful to anyone else that runs across this.