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

Upgrading nan to version ~1.2.0 in order to support Node v0.11.13 and above #26

Merged
merged 4 commits into from Aug 19, 2014

Conversation

Projects
None yet
5 participants
@chanced
Contributor

chanced commented Jun 5, 2014

The pull request isn't finished yet but it is getting close. I upgraded the nan version and i'm working on getting the codebase migrated to reflect changes (largely NanNew).

There are is at least one error left surrounding uv_async_init that I'm not 100% certain how to fix yet (I'm very rusty when it comes to C).

There are also a few warnings dangling. Some are deprecations but others are styling that I think can be fixed by removing the using v8::... statements I added and going back to explicit definitions (especially around v8::Integer & String).

Here's the current output from a rebuild:

gyp info it worked if it ends with ok
gyp info using node-gyp@0.13.1
gyp info using node@0.11.13 | darwin | x64
gyp info spawn python
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/chance/code/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/chance/.node-gyp/0.11.13/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/chance/.node-gyp/0.11.13',
gyp info spawn args   '-Dmodule_root_dir=/Users/chance/code/fsevents',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:85:
../src/async.cc:29:3: error: no matching function for call to 'uv_async_init'
  uv_async_init(uv_default_loop(), &async, &async_propagate);
  ^~~~~~~~~~~~~
/Users/chance/.node-gyp/0.11.13/deps/uv/include/uv.h:1355:15: note: candidate function not viable: no known conversion from 'void (*)(uv_async_t *, int)' to 'uv_async_cb' (aka 'void (*)(uv_async_t *)') for 3rd argument
UV_EXTERN int uv_async_init(uv_loop_t*,
              ^
In file included from ../fsevents.cc:87:
../src/constants.cc:12:62: warning: template argument uses unnamed type [-Wunnamed-type-template-args]
  object->Set(NanNew<String>("kFSEventStreamEventFlagNone"), NanNew<Integer>(kFSEventStreamEventFlagNone));
                                                             ^~~~~~
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FSEvents.h:290:1: note: unnamed type used in template argument was declared here
enum {
^
../fsevents.cc:92:21: warning: 'NanSymbol' is deprecated [-Wdeprecated-declarations]
  tpl->SetClassName(NanSymbol("FSEvents"));
                    ^
../node_modules/nan/nan.h:727:51: note: 'NanSymbol' declared here
  NAN_DEPRECATED NAN_INLINE v8::Local<v8::String> NanSymbol(
                                                  ^
2 warnings and 1 error generated.
make: *** [Release/obj.target/fse/fsevents.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/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1046:12)
gyp ERR! System Darwin 13.2.0
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/chance/code/fsevents
gyp ERR! node -v v0.11.13
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok 
@chanced

This comment has been minimized.

Show comment
Hide comment
@chanced

chanced Jun 5, 2014

Contributor

One test is failing surrounding rmdirSync(__dirname + '/temp');.

I muddled up the test output in order to try and get a better grasp of what's going on. To the best of my knowledge the function is working; however, there are some missed expectations around the basepath. There's also an unknown event that fires right before it which I'm not sure if it is expected or not.

> fsevents@0.2.1 test /Users/chance/code/fsevents
> export PATH=$PATH:`pwd`/node_nodules/.bin/ && tap ./test

ok test/fsevents.js ..................................... 6/6
id: 5771334
flags:  131328
name:   /Users/chance/code/fsevents/test/temp
base:   temp
event:  unknown
info:   {"path":"/Users/chance/code/fsevents/test/temp","event":"unknown","type":"directory","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":131328,"id":5771334}
===========================================================================
  writeFileSync(__dirname + '/temp/created-fsevent', 'created-fsevent');
===========================================================================
id: 5771340
flags:  69888
name:   /Users/chance/code/fsevents/test/temp/created-fsevent
base:   created-fsevent
event:  modified
info:   {"path":"/Users/chance/code/fsevents/test/temp/created-fsevent","event":"modified","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":69888,"id":5771340}
===========================================================================
  renameSync(__dirname + '/temp/created-fsevent', __dirname + '/temp/moved-fsevent');
===========================================================================
id: 5771343
flags:  71936
id: 5771344
flags:  67584
name:   /Users/chance/code/fsevents/test/temp/created-fsevent
base:   created-fsevent
event:  moved-out
info:   {"path":"/Users/chance/code/fsevents/test/temp/created-fsevent","event":"moved-out","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":71936,"id":5771343}
name:   /Users/chance/code/fsevents/test/temp/moved-fsevent
base:   moved-fsevent
event:  moved-in
info:   {"path":"/Users/chance/code/fsevents/test/temp/moved-fsevent","event":"moved-in","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":67584,"id":5771344}
===========================================================================
  unlinkSync(__dirname + '/temp/moved-fsevent');
===========================================================================
id: 5771347
flags:  68096
name:   /Users/chance/code/fsevents/test/temp/moved-fsevent
base:   moved-fsevent
event:  deleted
info:   {"path":"/Users/chance/code/fsevents/test/temp/moved-fsevent","event":"deleted","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":68096,"id":5771347}
===========================================================================
  rmdirSync(__dirname + '/temp');
===========================================================================
id: 0
flags:  32
name:   /Users/chance/code/fsevents/test/temp
base:   temp
event:  unknown
info:   {"path":"/Users/chance/code/fsevents/test/temp","event":"unknown","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":32,"id":0}
id: 5771367
flags:  131584
name:   /Users/chance/code/fsevents/test/temp
base:   temp
event:  deleted
info:   {"path":"/Users/chance/code/fsevents/test/temp","event":"deleted","type":"directory","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":131584,"id":5771367}
not ok test/function.js ................................. 0/1
    Command: "/usr/local/bin/node function.js"
    TAP version 13
    not ok 1 test/function.js
      ---
        exit:     ~
        timedOut: true
        signal:   SIGTERM
        stderr:   |
          id:   5771334
          flags:    131328
          name: /Users/chance/code/fsevents/test/temp
          base: temp
          event:    unknown
          info: {"path":"/Users/chance/code/fsevents/test/temp","event":"unknown","type":"directory","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":131328,"id":5771334}
          ===========================================================================
            writeFileSync(__dirname + '/temp/created-fsevent', 'created-fsevent');
          ===========================================================================
          id:   5771340
          flags:    69888
          name: /Users/chance/code/fsevents/test/temp/created-fsevent
          base: created-fsevent
          event:    modified
          info: {"path":"/Users/chance/code/fsevents/test/temp/created-fsevent","event":"modified","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":69888,"id":5771340}
          ===========================================================================
            renameSync(__dirname + '/temp/created-fsevent', __dirname + '/temp/moved-fsevent');
          ===========================================================================
          id:   5771343
          flags:    71936
          id:   5771344
          flags:    67584
          name: /Users/chance/code/fsevents/test/temp/created-fsevent
          base: created-fsevent
          event:    moved-out
          info: {"path":"/Users/chance/code/fsevents/test/temp/created-fsevent","event":"moved-out","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":71936,"id":5771343}
          name: /Users/chance/code/fsevents/test/temp/moved-fsevent
          base: moved-fsevent
          event:    moved-in
          info: {"path":"/Users/chance/code/fsevents/test/temp/moved-fsevent","event":"moved-in","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":67584,"id":5771344}
          ===========================================================================
            unlinkSync(__dirname + '/temp/moved-fsevent');
          ===========================================================================
          id:   5771347
          flags:    68096
          name: /Users/chance/code/fsevents/test/temp/moved-fsevent
          base: moved-fsevent
          event:    deleted
          info: {"path":"/Users/chance/code/fsevents/test/temp/moved-fsevent","event":"deleted","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":68096,"id":5771347}
          ===========================================================================
            rmdirSync(__dirname + '/temp');
          ===========================================================================
          id:   0
          flags:    32
          name: /Users/chance/code/fsevents/test/temp
          base: temp
          event:    unknown
          info: {"path":"/Users/chance/code/fsevents/test/temp","event":"unknown","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":32,"id":0}
          id:   5771367
          flags:    131584
          name: /Users/chance/code/fsevents/test/temp
          base: temp
          event:    deleted
          info: {"path":"/Users/chance/code/fsevents/test/temp","event":"deleted","type":"directory","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":131584,"id":5771367}
        command:  "/usr/local/bin/node function.js"
      ...

    1..1
    # tests 1
    # fail  1

total ................................................... 6/7

not ok
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

There's still one warning (below) but I'm not refreshed enough on c++ to try and resolve the issue.

gyp info it worked if it ends with ok
gyp info using node-gyp@0.13.1
gyp info using node@0.11.13 | darwin | x64
gyp info spawn python
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/chance/code/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/chance/.node-gyp/0.11.13/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/chance/.node-gyp/0.11.13',
gyp info spawn args   '-Dmodule_root_dir=/Users/chance/code/fsevents',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:86:
../src/constants.cc:10:66: warning: template argument uses unnamed type [-Wunnamed-type-template-args]
  object->Set(NanNew<v8::String>("kFSEventStreamEventFlagNone"), NanNew<v8::Integer>(kFSEventStreamEventFlagNone));
                                                                 ^~~~~~
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FSEvents.h:290:1: note: unnamed type used in template argument was declared here
enum {
^
1 warning generated.
  SOLINK_MODULE(target) Release/fse.node
  SOLINK_MODULE(target) Release/fse.node: Finished
gyp info ok 
Contributor

chanced commented Jun 5, 2014

One test is failing surrounding rmdirSync(__dirname + '/temp');.

I muddled up the test output in order to try and get a better grasp of what's going on. To the best of my knowledge the function is working; however, there are some missed expectations around the basepath. There's also an unknown event that fires right before it which I'm not sure if it is expected or not.

> fsevents@0.2.1 test /Users/chance/code/fsevents
> export PATH=$PATH:`pwd`/node_nodules/.bin/ && tap ./test

ok test/fsevents.js ..................................... 6/6
id: 5771334
flags:  131328
name:   /Users/chance/code/fsevents/test/temp
base:   temp
event:  unknown
info:   {"path":"/Users/chance/code/fsevents/test/temp","event":"unknown","type":"directory","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":131328,"id":5771334}
===========================================================================
  writeFileSync(__dirname + '/temp/created-fsevent', 'created-fsevent');
===========================================================================
id: 5771340
flags:  69888
name:   /Users/chance/code/fsevents/test/temp/created-fsevent
base:   created-fsevent
event:  modified
info:   {"path":"/Users/chance/code/fsevents/test/temp/created-fsevent","event":"modified","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":69888,"id":5771340}
===========================================================================
  renameSync(__dirname + '/temp/created-fsevent', __dirname + '/temp/moved-fsevent');
===========================================================================
id: 5771343
flags:  71936
id: 5771344
flags:  67584
name:   /Users/chance/code/fsevents/test/temp/created-fsevent
base:   created-fsevent
event:  moved-out
info:   {"path":"/Users/chance/code/fsevents/test/temp/created-fsevent","event":"moved-out","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":71936,"id":5771343}
name:   /Users/chance/code/fsevents/test/temp/moved-fsevent
base:   moved-fsevent
event:  moved-in
info:   {"path":"/Users/chance/code/fsevents/test/temp/moved-fsevent","event":"moved-in","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":67584,"id":5771344}
===========================================================================
  unlinkSync(__dirname + '/temp/moved-fsevent');
===========================================================================
id: 5771347
flags:  68096
name:   /Users/chance/code/fsevents/test/temp/moved-fsevent
base:   moved-fsevent
event:  deleted
info:   {"path":"/Users/chance/code/fsevents/test/temp/moved-fsevent","event":"deleted","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":68096,"id":5771347}
===========================================================================
  rmdirSync(__dirname + '/temp');
===========================================================================
id: 0
flags:  32
name:   /Users/chance/code/fsevents/test/temp
base:   temp
event:  unknown
info:   {"path":"/Users/chance/code/fsevents/test/temp","event":"unknown","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":32,"id":0}
id: 5771367
flags:  131584
name:   /Users/chance/code/fsevents/test/temp
base:   temp
event:  deleted
info:   {"path":"/Users/chance/code/fsevents/test/temp","event":"deleted","type":"directory","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":131584,"id":5771367}
not ok test/function.js ................................. 0/1
    Command: "/usr/local/bin/node function.js"
    TAP version 13
    not ok 1 test/function.js
      ---
        exit:     ~
        timedOut: true
        signal:   SIGTERM
        stderr:   |
          id:   5771334
          flags:    131328
          name: /Users/chance/code/fsevents/test/temp
          base: temp
          event:    unknown
          info: {"path":"/Users/chance/code/fsevents/test/temp","event":"unknown","type":"directory","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":131328,"id":5771334}
          ===========================================================================
            writeFileSync(__dirname + '/temp/created-fsevent', 'created-fsevent');
          ===========================================================================
          id:   5771340
          flags:    69888
          name: /Users/chance/code/fsevents/test/temp/created-fsevent
          base: created-fsevent
          event:    modified
          info: {"path":"/Users/chance/code/fsevents/test/temp/created-fsevent","event":"modified","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":69888,"id":5771340}
          ===========================================================================
            renameSync(__dirname + '/temp/created-fsevent', __dirname + '/temp/moved-fsevent');
          ===========================================================================
          id:   5771343
          flags:    71936
          id:   5771344
          flags:    67584
          name: /Users/chance/code/fsevents/test/temp/created-fsevent
          base: created-fsevent
          event:    moved-out
          info: {"path":"/Users/chance/code/fsevents/test/temp/created-fsevent","event":"moved-out","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":71936,"id":5771343}
          name: /Users/chance/code/fsevents/test/temp/moved-fsevent
          base: moved-fsevent
          event:    moved-in
          info: {"path":"/Users/chance/code/fsevents/test/temp/moved-fsevent","event":"moved-in","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":67584,"id":5771344}
          ===========================================================================
            unlinkSync(__dirname + '/temp/moved-fsevent');
          ===========================================================================
          id:   5771347
          flags:    68096
          name: /Users/chance/code/fsevents/test/temp/moved-fsevent
          base: moved-fsevent
          event:    deleted
          info: {"path":"/Users/chance/code/fsevents/test/temp/moved-fsevent","event":"deleted","type":"file","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":68096,"id":5771347}
          ===========================================================================
            rmdirSync(__dirname + '/temp');
          ===========================================================================
          id:   0
          flags:    32
          name: /Users/chance/code/fsevents/test/temp
          base: temp
          event:    unknown
          info: {"path":"/Users/chance/code/fsevents/test/temp","event":"unknown","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":32,"id":0}
          id:   5771367
          flags:    131584
          name: /Users/chance/code/fsevents/test/temp
          base: temp
          event:    deleted
          info: {"path":"/Users/chance/code/fsevents/test/temp","event":"deleted","type":"directory","changes":{"inode":false,"finder":false,"access":false,"xattrs":false},"flags":131584,"id":5771367}
        command:  "/usr/local/bin/node function.js"
      ...

    1..1
    # tests 1
    # fail  1

total ................................................... 6/7

not ok
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

There's still one warning (below) but I'm not refreshed enough on c++ to try and resolve the issue.

gyp info it worked if it ends with ok
gyp info using node-gyp@0.13.1
gyp info using node@0.11.13 | darwin | x64
gyp info spawn python
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/chance/code/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/chance/.node-gyp/0.11.13/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/chance/.node-gyp/0.11.13',
gyp info spawn args   '-Dmodule_root_dir=/Users/chance/code/fsevents',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:86:
../src/constants.cc:10:66: warning: template argument uses unnamed type [-Wunnamed-type-template-args]
  object->Set(NanNew<v8::String>("kFSEventStreamEventFlagNone"), NanNew<v8::Integer>(kFSEventStreamEventFlagNone));
                                                                 ^~~~~~
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FSEvents.h:290:1: note: unnamed type used in template argument was declared here
enum {
^
1 warning generated.
  SOLINK_MODULE(target) Release/fse.node
  SOLINK_MODULE(target) Release/fse.node: Finished
gyp info ok 
@chanced

This comment has been minimized.

Show comment
Hide comment
@chanced

chanced Jun 6, 2014

Contributor

I really don't understand why a root changed event is being triggered. @pipobscure any ideas?

Contributor

chanced commented Jun 6, 2014

I really don't understand why a root changed event is being triggered. @pipobscure any ideas?

@iliakan

This comment has been minimized.

Show comment
Hide comment
@iliakan

iliakan Jun 27, 2014

fsevents and dependant utils fail to compile on Node 0.11.13.
looking forward to see that fixed.

iliakan commented Jun 27, 2014

fsevents and dependant utils fail to compile on Node 0.11.13.
looking forward to see that fixed.

@JannesMeyer

This comment has been minimized.

Show comment
Hide comment
@JannesMeyer

JannesMeyer Jun 27, 2014

I can confirm that. It's not compiling for me on node v0.11.14-pre neither.

Unfortunately I don't know what's needed to move this issue forward. Could anyone try to explain the situation, so outsiders can help?

JannesMeyer commented Jun 27, 2014

I can confirm that. It's not compiling for me on node v0.11.14-pre neither.

Unfortunately I don't know what's needed to move this issue forward. Could anyone try to explain the situation, so outsiders can help?

@iliakan iliakan referenced this pull request Jul 13, 2014

Closed

0.11.13 compatible? #857

pipobscure added a commit that referenced this pull request Aug 19, 2014

Merge pull request #26 from chanced/master
Upgrading nan to version ~1.2.0 in order to support Node v0.11.13 and above

@pipobscure pipobscure merged commit 3b7baaf into strongloop:master Aug 19, 2014

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Aug 19, 2014

\o/

Can't wait for the next release then!

mgol commented Aug 19, 2014

\o/

Can't wait for the next release then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment