m4heshd / better-sqlite3-multiple-ciphers

better-sqlite3 with multiple-cipher encryption support 🔒
MIT License
140 stars 27 forks source link

Prebuilt Binaries for Arm? #10

Closed KnightAR closed 2 years ago

KnightAR commented 2 years ago

I'm using a Pi and it says WARN install No prebuilt binaries found (target=16.13.1 runtime=node arch=arm libc= platform=linux)

Linux raspberrypi 5.10.63-v7l+ #1496 SMP Wed Dec 1 15:58:56 GMT 2021 armv7l GNU/Linux

Is there a way to get Prebuilt binaries for this?

m4heshd commented 2 years ago

Hi @KnightAR,

I was actually planning on adding Linux arm prebuilds in the next beta release. I kept sleeping on the idea because running arm containers on CIs is quite troublesome. Especially with testing. It also heavily increases the build time. But I agree that it's a necessity. I'll track this issue as the enhancement suggestion.

m4heshd commented 2 years ago

Got an update on this. Been trying some build configurations for arm in the past few hours. I've attached a prebuilt binary on this comment and I'd appreciate it if you can try it out on your project. It's built for Node v16 and BS3MC v7.5.0.

All you have to do is extract the better_sqlite3.node file in the attached archive to <YOUR_PROJECT>/node_modules/better-sqlite3-multiple-ciphers/build/Release directory. Replace the file if it already exists. Don't run any NPM installs after this step. Then run your project and do some DB transactions to make sure that the library is fully functional.

If your project runs successfully with this binary, I can happily mention that prebuilt binaries for arm architecture will be available starting from next release which I'll be doing probably within the next day if everything goes right.

Prebuilt file - better-sqlite3-multiple-ciphers-v7.5.0-node-v93-linux-arm.tar.gz

KnightAR commented 2 years ago

Thank you I'll try it out once I'm in front of the Pi, I'll let you know It'll be later on today

KnightAR commented 2 years ago

I'm currently unable to install at all because something fails to compile. Wonder if theres something I'm missing

m4heshd commented 2 years ago

something fails to compile

It must still be trying to build the addon on install.

Start your project from the scratch and use npm install --ignore-scripts better-sqlite3-multiple-ciphers@7.5.0 to install. This will prevent the post-install scripts from running. Also make sure that you're using Node 16.

KnightAR commented 2 years ago

It looks like that worked! I installed it with --ignore-scripts and placed the file in the correct place and tested it stand alone. Everything works properly! I also tested it with my project and everything works as if I'm using it on my development box.

m4heshd commented 2 years ago

Perfect. I'll keep this issue open till I do the new release with arm assets.

BTW what model of RPi are you testing this on? I'm guessing Pi 2 Model B?

KnightAR commented 2 years ago

4 4gb

Raspberry Pi 400 All-in-One Quad-Core 64 Bit 4GB https://www.amazon.com/dp/B08XS24CMV/ref=cm_sw_r_apan_glt_i_T49WYADFVQHGCNYVMCQ3?_encoding=UTF8&psc=1

m4heshd commented 2 years ago

Huh. That's odd because the binary is compiled for armv7l. I guess it works for you because Raspbian runs in 32-bit and that makes the CPU appear to be an armv7l.

m4heshd commented 2 years ago

The latest release v7.5.1-beta.0 now contains prebuilt binaries for Linux on both arm and arm64. I suggest you try this on a clean project to test it.

npm install better-sqlite3-multiple-ciphers@beta

I'm closing this issue marking the feature as implemented. Feel free to reopen if you run into any problems.