kriszyp / lmdb-js

Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Other
486 stars 39 forks source link

0.4.1 node-gyp failing to compile #4

Closed 1N50MN14 closed 3 years ago

1N50MN14 commented 3 years ago

Hi @kriszyp,

Just upgraded to 0.4.1, node-gyp is throwing the following error

/home/am/.cache/node-gyp/12.16.1/include/node/node.h:639:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE_X’
   NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)

Environment is node 12.8.3 LTS, python 2.7.1 - I guess it's time for Node 13? I was just wondering what's the minimum node version that I need to run and if need to use Python 3 as well.

I also noticed you introduced keyIsBuffer, I currently rely on ordered-binary to serialize / parse keys (to maintain order), should I set that to true or does the change mean I drop ordered-binary and leave it to lmdb-store?

Many thanks

kriszyp commented 3 years ago

Sorry for the slow response, so I just tested with the latest 12.x version (12.18.3) and it seemed to compile fine for me. I think I will try testing with 10.x and see what I get with that.

And yes, 0.4.x has a number of big upgrades/changes, including a full native implementation of ordered-binary, which I would definitely recommend using (you can just used standard JS primitives like strings and numbers directly with the API), versioning, optional compression and more. And yes, these changes would require using keyIsBuffer: true and encoding: 'binary' for backwards compatibility, but hopefully you don't need that and can use the new features.

kriszyp commented 3 years ago

@1N50MN14 I don't see any errors with node 10.22.0 either. Is there any more text associated with that compilation error message?

1N50MN14 commented 3 years ago

@kriszyp Thank you for getting back to me and looking into this, very much looking forward to trying out 0.4.x! you added support for versioning too (!) :+1:

I created a gist with the full error output: https://gist.github.com/1N50MN14/27c4ab77275a28cd085901abf670e92d

By the way, the same error happens inside my docker build...

kriszyp commented 3 years ago

Ok, I actually am able to reproduce the compilation error on my mac, will try to get it fixed soon.

kriszyp commented 3 years ago

Ok, I pushed v0.4.2 with fixes for compilation.

1N50MN14 commented 3 years ago

yay it worked!! Thanks a bunch for the quick fix! :)