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

Update bindings to compile under multiple node versions #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

davidcroda
Copy link

v8 0.12 has a number of breaking changes, and this module can no longer be installed on many systems which default to node 0.12+

I updated it to the current API. It compiles on Node v0.12.5. All tests pass.

Fixes #2

@davidcroda
Copy link
Author

Hmm. Since this completely breaks the build on Node < 0.12 (which I should have probably anticipated) I am going to close this for now. Going to take a crack at updating it to use nan instead which I believe should handle the differences between versions.

@davidcroda davidcroda closed this Jun 28, 2015
@davidcroda davidcroda reopened this Jun 28, 2015
@davidcroda
Copy link
Author

Ok, redid this using nan. All tests are green on my build, hoping this fares better on Node < 0.12

@davidcroda davidcroda changed the title Update bindings to compile under v8 0.12 Update bindings to compile under multiple node versions Jun 28, 2015
@ismell
Copy link

ismell commented Nov 3, 2015

+1 merge this in!

@ismell
Copy link

ismell commented Nov 3, 2015

I actually just got an error

In file included from ../src/binding.cc:5:
    ../node_modules/nan/nan.h:779:26: error: no member named 'Use' in namespace 'node::Buffer'
        return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ~~~~~~~~~~~~~~^
    In file included from ../src/binding.cc:1:
    In file included from /Users/me/.node-gyp/5.0.0/include/node/node.h:42:
    /Users/me/.node-gyp/5.0.0/include/node/v8.h:221:5: error: assigning to 'v8::Primitive *volatile' from incompatible type 'v8::Value *'
        TYPE_CHECK(T, S);
        ^~~~~~~~~~~~~~~~
    /Users/me/.node-gyp/5.0.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
        *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                        ^ ~~~~~~~~~~~~~~~~~~
    ../node_modules/nan/nan.h:501:12: note: in instantiation of function template specialization
        'v8::Local<v8::Primitive>::Local<v8::Value>' requested here
        return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));
            ^
    ../node_modules/nan/nan.h:483:30: note: expanded from macro 'NanEscapeScope'
    # define NanEscapeScope(val) scope.Escape(Nan::imp::NanEnsureLocal(val))
                                ^
    In file included from ../src/binding.cc:1:
    In file included from /Users/me/.node-gyp/5.0.0/include/node/node.h:42:
    /Users/me/.node-gyp/5.0.0/include/node/v8.h:221:5: error: assigning to 'v8::Boolean *volatile' from incompatible type 'v8::Value *'
        TYPE_CHECK(T, S);
        ^~~~~~~~~~~~~~~~
    /Users/me/.node-gyp/5.0.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
        *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                        ^ ~~~~~~~~~~~~~~~~~~
    ../node_modules/nan/nan.h:511:12: note: in instantiation of function template specialization
        'v8::Local<v8::Boolean>::Local<v8::Value>' requested here
        return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));
            ^
    ../node_modules/nan/nan.h:483:30: note: expanded from macro 'NanEscapeScope'
    # define NanEscapeScope(val) scope.Escape(Nan::imp::NanEnsureLocal(val))
                                ^
    In file included from ../src/binding.cc:1:
    In file included from /Users/me/.node-gyp/5.0.0/include/node/node.h:42:
    /Users/me/.node-gyp/5.0.0/include/node/v8.h:221:5: error: assigning to 'v8::Function *volatile' from incompatible type 'v8::Value *'
        TYPE_CHECK(T, S);
        ^~~~~~~~~~~~~~~~
    /Users/me/.node-gyp/5.0.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
        *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                        ^ ~~~~~~~~~~~~~~~~~~
    ../node_modules/nan/nan.h:1645:12: note: in instantiation of function template specialization
        'v8::Local<v8::Function>::Local<v8::Value>' requested here
        return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)
            ^
    ../node_modules/nan/nan.h:483:30: note: expanded from macro 'NanEscapeScope'
    # define NanEscapeScope(val) scope.Escape(Nan::imp::NanEnsureLocal(val))
                                ^
    In file included from ../src/binding.cc:1:
    In file included from /Users/me/.node-gyp/5.0.0/include/node/node.h:42:
    /Users/me/.node-gyp/5.0.0/include/node/v8.h:221:5: error: assigning to 'v8::Object *volatile' from incompatible type 'v8::Value *'
        TYPE_CHECK(T, S);
        ^~~~~~~~~~~~~~~~
    /Users/me/.node-gyp/5.0.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
        *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                        ^ ~~~~~~~~~~~~~~~~~~
    ../node_modules/nan/nan.h:1776:12: note: in instantiation of function template specialization
        'v8::Local<v8::Object>::Local<v8::Value>' requested here
        return NanEscapeScope(
            ^
    ../node_modules/nan/nan.h:483:30: note: expanded from macro 'NanEscapeScope'
    # define NanEscapeScope(val) scope.Escape(Nan::imp::NanEnsureLocal(val))
                                ^
    10 errors generated.
    make: *** [Release/obj.target/unrar/src/binding.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/npm/node_modules/node-gyp/lib/build.js:270:23)
    gyp ERR! stack     at emitTwo (events.js:87:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
    gyp ERR! System Darwin 15.0.0
    gyp ERR! command "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /Users/me/Projects/altBinariesNab/node_modules/node-rar-updated
    gyp ERR! node -v v5.0.0
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! not ok
    npm ERR! Darwin 15.0.0
    npm ERR! argv "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/bin/npm" "install" "node-rar-updated"
    npm ERR! node v5.0.0
    npm ERR! npm  v3.3.9
    npm ERR! code ELIFECYCLE

    npm ERR! [email protected] install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
    npm ERR! This is most likely a problem with the node-rar-updated package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     node-gyp rebuild
    npm ERR! You can get their info via:
    npm ERR!     npm owner ls node-rar-updated
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR!     /Users/me/Projects/altBinariesNab/npm-debug.log

@davidcroda
Copy link
Author

This PR is to support Node v0.12 . You are building on Node v5.0.0

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

Successfully merging this pull request may close these issues.

2 participants