-
Notifications
You must be signed in to change notification settings - Fork 43
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
Bun support #208
Comments
Yes, I am definitely aware that bun does not use v8, and that is exactly why lmdb-js is careful to only load V8 code if the runtime says it is V8:
(note, that "modules" is the specifically the NAN version that interfaces with V8, which Bun also does not support). This should be filed as a bug with Bun, as it is clearly lying and causing it owns failures in the process. |
I think we could remove process.versions.modules, but I'm not sure about process.versions.v8. A decent amount of code expects process.versions.v8 to be a string. |
@rizrmd v2.7.5 should have support for this latest breaking changes in Bun. Note, that this should enable the standard get/put functionality, but doesn't enable asynchronous transactions. This requires event passing between threads, via the napi_call_threadsafe_function which currently still segfaults in bun, and is reported at oven-sh/bun#158 (comment) (to be fair, I think deno segfaults with that function as well, guess it is hard to implement). I have done a fair bit of work over the last year to try get lmdb-js compatibility in Bun, but asynchronous transactions just won't work without that piece. Anyway, hopefully v2.7.5 will get you going with LMDB on Bun. @Jarred-Sumner I understand the desire to get this working. I do think we would be better off pushing the ecosystem to adopt better practices (push those that are misusing process.versions.v8 to change rather than those that are correctly using it as detection for V8) instead of just a pursuit of adoption/compatibility with node. This is kinda the same reason we have ridiculous user agent strings in browsers, because browser vendors have placed compatibility/adoption over pushing better practices. And in the examples above, it actually looks like most of the examples in the referenced search really are doing V8 specific actions (that wouldn't make sense in JSC). That being said, this is trivial fix (just using !process.isBun), so certainly not difficult to deal with. |
Ah, thank you. So I guess this means bun is supported right ? I will close this issue, and if someone needs async transaction, they should open new issue. |
I have definitely been trying to maintain support for Bun since it released NAPI support. |
Just tried installing lmdb with bun and running sample code:
And this happen:
Bun does not use v8 like deno/node, it uses JavascriptCore from Apple.
I know lmdb officially only supports node and deno. Can we add one for bun?
The text was updated successfully, but these errors were encountered: