Closed BannerBomb closed 5 months ago
Some time ago I tried to use bun
and it didn’t support binary extensions at all. Has the situation changed?
I'll look into that when I get off work. I have a package that uses a binary canvas. And it was able to install it fine. I'll test it to see if it's able to actually use it in code when I get home tonight. I'll update you then.
yeah You're right, I don't think it supports binaries. It seems to install the packages just fine but when trying to require the module. Like canvas which is written in C++ it errors with /usr/local/bin/bun: symbol lookup error: /opt/testbot/node_modules/canvas/build/Release/canvas.node: undefined symbol: node_module_register
Admittedly it is better than when I tried — bun
ignored binary modules completely. It looks like now it aims to support Node-API: https://bun.sh/docs/api/node-api
The problem is that node-re2
uses a different way to compile an extension: https://nodejs.org/api/addons.html — all other ways did not exist when that choice was made. It means we cannot support binary modules for bun
without a major reworking. The same goes for deno
— AFAIK it uses Rust for their binary modules.
Nowadays, I would consider WASM first as a portable target for binary extensions.
I'm not sure if you want to add support for bun if possible. But I thought to bring this to your attention in case. So I was looking into using bun over nodejs for package management reasons. I get the error
gyp: name 'llvm_version' is not defined while evaluating condition 'llvm_version=="0.0"' in binding.gyp while trying to load binding.gyp
when runningbun install re2
.