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

module load failure with Node v0.10.* #115

Closed
pizthewiz opened this issue Mar 21, 2013 · 7 comments
Closed

module load failure with Node v0.10.* #115

pizthewiz opened this issue Mar 21, 2013 · 7 comments

Comments

@pizthewiz
Copy link

i have a Jakefile does some auto-build versioning through the use of @TooTallNate's NodObjC which pulls in node-ffi and unfortunately it appears to be blowing up after upgrading to Node v0.10.0, no issues with v0.8.22.

% jake --trace
jake aborted.
Error: Module version mismatch. Expected 11, got 1.
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at bindings (/usr/local/lib/node_modules/NodObjC/node_modules/node-ffi/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/usr/local/lib/node_modules/NodObjC/node_modules/node-ffi/lib/ffi.js:3:35)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
@TooTallNate
Copy link
Member

You just need to recompile node-ffi

On Wednesday, March 20, 2013, pizthewiz wrote:

i have a Jakefile does some auto-build versioning through the use of
@TooTallNate https://github.com/TooTallNate's NodObjChttps://github.com/TooTallNate/NodObjCwhich pulls in
node-ffi https://github.com/rbranson/node-ffi and unfortunately it
appears to be blowing up after upgrading to Node v0.10.0, no issues with
v0.8.22.

% jake --trace
jake aborted.
Error: Module version mismatch. Expected 11, got 1.
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/usr/local/lib/node_modules/NodObjC/node_modules/node-ffi/node_modules/bindings/bindings.js:76:44)
at Object. (/usr/local/lib/node_modules/NodObjC/node_modules/node-ffi/lib/ffi.js:3:35)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)


Reply to this email directly or view it on GitHubhttps://github.com//issues/115
.

@pizthewiz
Copy link
Author

rebuilding node-ffi on node v0.10.0 then hits a snag in libuv, a function signature may have changed:

  CXX(target) Release/obj.target/ffi_bindings/src/foreign_caller.o
../src/foreign_caller.cc:81:5: error: no matching function for call to 'uv_queue_work'
    uv_queue_work(uv_default_loop(), req, ForeignCaller::AsyncFFICall,...
    ^~~~~~~~~~~~~
/Users/jpm/.node-gyp/0.10.0/deps/uv/include/uv.h:1397:15: note: candidate function not viable: no
      known conversion from 'void (uv_work_t *)' to 'uv_after_work_cb' (aka
      'void (*)(uv_work_t *, int)') for 4th argument
UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
              ^
1 error generated.
make: *** [Release/obj.target/ffi_bindings/src/foreign_caller.o] Error 1
gyp ERR! build error 

and a full gist with more details.

@TooTallNate
Copy link
Member

Oh crap, basically you're running into the fact that NodObjC still uses the older version of node-ffi. The current version of node-ffi works fine on v0.10.0. I have. A WIP ffi-1.0 branch in the NodObjC repo, but it's not quite ready yet. Hopefully I'll find time to fix it soon!

@TooTallNate
Copy link
Member

Closing since this is a NodObjC issue, not node-ffi

@pizthewiz
Copy link
Author

sorry about the confusion, i'll keep an eye on the NodObjC repo for updates.

@carter-thaxton
Copy link

Running into this, too. NodObjC is indeed the issue, but it's not a straightforward fix there. It requires a major refactor. @TooTallNate, until your refactor is complete, could you simply push a new version of your node-ffi 0.x API onto npm, from the 0.5 branch of this node-ffi project? As long as node-ffi is on npm with its own alias, I think it should remain a maintained project.

I'll attach a pull request if that helps, but it's just the straightforward (uv_after_work_cb) cast. That should fix every project that uses the old node-ffi API, not just NodObjC.

@carter-thaxton
Copy link

See #119.

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

3 participants