-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Initial 0.11 compatibility attempt, using new project: NAN #48
Conversation
This is impressive. Congrats. |
@rvagg windows build seems to be looking for 1.10.0 :( |
actual nan.h was missing from the original PR (it was a symlink), commited it now, upgraded to 0.1.0 |
@rvagg Wouldn't it make sense to merge this in sooner rather than later? So that all future development is based on this version rather than the old version... |
merging this in now would be totally rad, then I can use level-co! |
I've cherry-picked some commits from #50 so that we're having the latest version of nan in this PR. There's sadly a test failing from time to time, so right now that's keeping us from being able to release this. I'm looking at it right now, and I'll let you know if I'm making any progress :) |
👯 |
Alright, so some progress! I found that it's actually .get() that is failing, not .batch() - it's the .batch-test that uses .get. Pull request fixing this coming up, but @rvagg I'm counting on you keeping track on me :) |
Conflicts: src/database.cc
@rvagg Please take a look at the change that I did to get this to work, especially since it's involves a change in semantics to nan - maybe there's another way to fix this that doesn't involve the change to nan? |
Hm... When running the tests on node 0.11.4, not all tests are run... Am I the only one experiencing this? https://cloudup.com/c4tpJ1AgY0f I've tried running the tests with plain node, like |
maybe tap has problems |
except for a test that already failed in node 0.8.x, the tap testsuite passes on 0.11.4 on my mac. |
Initial 0.11 compatibility attempt, using new project: NAN
@0.7.0 in npm, let the world rejoice, I'll do a corresponding levelup & level now that'll pull them in. new abstract-leveldown is published too. |
@No9 all good for me on Windows 0.10.5, I haven't bothered testing 0.11 but would love to hear your reports if you're testing 0.11. |
Node 0.11.4 introduced V8 3.20.2 which has a crazy amount of breaking API changes, maintaining compatibility across versions is a tricky prospect but I've been hacking away at a solution for cross-version compatibility for a little while now; I need it for a few native addon projects.
So say hello to NAN ( Native Abstractions for Node.js): https://github.com/rvagg/nan, which is really just a header file that can be included in a built and provide all the necessary abstractions to get 0.8, 0.10 and 0.11/0.12 compatibility without having to do any version sniffing yourself (in theory!).
This compiles and runs for me on Linux for 0.8. 0.10 and 0.11.4, I haven't tested any other platform and I worry about Windows... Previous versions of 0.11 won't work, there are incompatibilities that can't be tested because they haven't been incrementing
NODE_MODULE_VERSION
.Note that if you get this running in 0.11 and run the LevelUP tests against this then you'll get a couple of failures:
setTimeout
problem caused by this Node bug that's impacting slow-stream but that's only for testing and that should be fixed in 0.11.5.Array
problem caused by this V8 bug (found thanks to LevelUP + Node 0.11!) in the tests that make big blobs of data using theArray.apply(null, Array(1024 * 100))
trick. Just reduce that100
to a90
and it'll run.Would appreciate anyone who wants to have a play and look over the code. I'm happy to answer any questions anyone has on what I've done and even happier if anyone can find problems in what I've done.
Also relevant:
i.e. there may be an "official" solution to this problem, but I don't have the patience to wait for it—it's not likely to appear until much later in the 0.11 cycle because it'd be no small job, and I had this in progress anyway so I just finished it off.