m4heshd / better-sqlite3-multiple-ciphers

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

Installation error in Termux!! #53

Closed Vanillma closed 1 year ago

Vanillma commented 1 year ago

Hey Bro I encounter this error when installing in Termux!! Screenshot_20230720-213108 Screenshot_20230720-213114

Meanwhile, I have successfully installed the following packages: Screenshot_20230720-213012

clang complains about flag (-march=native).

m4heshd commented 1 year ago

Sorry that it took a long time for me to respond.

First, can I know more about your device? What arch is its CPU? Any chance it's emulated? (x86). Pre-built binaries are available for both armv7 and arm64. So it's odd that your installation didn't download them automatically. Can you also check what os.platform() returns on your device? There's a chance it might return android, which would be a problem.

Second, this made me revisit the build configuration and realized that the -march=native flag isn't necessary. The problem is, I can't remember why exactly I added this flag. I only have a faint memory of arm builds failing to compile without it. I just removed the flag in https://github.com/m4heshd/better-sqlite3-multiple-ciphers/commit/4d6416efd0267715db46f4432f496fbdf2795fff, and you can check if it works now. I'm still skeptical about using Clang though. If you can, use GCC.

Vanillma commented 1 year ago

Sorry that it took a long time for me to respond.

First, can I know more about your device? What arch is its CPU? Any chance it's emulated? (x86). Pre-built binaries are available for both armv7 and arm64. So it's odd that your installation didn't download them automatically. Can you also check what os.platform() returns on your device? There's a chance it might return android, which would be a problem.

Second, this made me revisit the build configuration and realized that the -march=native flag isn't necessary. The problem is, I can't remember why exactly I added this flag. I only have a faint memory of arm builds failing to compile without it. I just removed the flag in 4d6416e, and you can check if it works now. I'm still skeptical about using Clang though. If you can, use GCC.

hey bro Sorry for the delay...I was testing and learning more about this.

First, about the type of platform...you true guessed it, android is returned. Screenshot_20230728-051906

Second, general information about my system:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=12145
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://mirror.bardia.tech/termux/termux-main stable main
Updatable packages:
All packages up to date
termux-tools version:
1.38.3
Android version:
7.1.2
Kernel build information:
Linux localhost 3.4.0-Lineage #1 SMP PREEMPT Wed May 2 23:03:33 IST 2018 armv7l Android
Device manufacturer:
samsung
Device model:
SM-G7102
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api

And finally, the results of the solutions I tried.

I tried to install version 8.5 from npm but still got the same weird error Screenshot_20230728-053613

Then I decided to clone the GitHub files And then I tried the npm build command without any error, the build and release folder was created. Screenshot_20230728-053941

(I don't know exactly what these folders are for...but it seems to be created for uploading in the npm system...can't it be made into a local package??)

After some more research I found out that it can be tested with the npm link command...I linked it to my project and now it works fine! Screenshot_20230728-054159 Screenshot_20230728-055242 Screenshot_20230728-055304

(Another note, I encountered this error when I was trying to use prebuild arm...then I found this explanation.) Screenshot_20230728-064216

m4heshd commented 1 year ago

I tried to install version 8.5 from npm but still got the same weird error

It wouldn't work because it's still the same build. You'd be able to install the next beta or stable release properly.

After some more research I found out that it can be tested with the npm link command...I linked it to my project and now it works fine!

You don't have to do all that. You can directly install the package with the latest updates using a link to the repo.

npm install https://github.com/m4heshd/better-sqlite3-multiple-ciphers/tarball/master

This will install the package like a regular npm package.

Vanillma commented 1 year ago

I tried to install version 8.5 from npm but still got the same weird error

It wouldn't work because it's still the same build. You'd be able to install the next beta or stable release properly.

After some more research I found out that it can be tested with the npm link command...I linked it to my project and now it works fine!

You don't have to do all that. You can directly install the package with the latest updates using a link to the repo.

npm install https://github.com/m4heshd/better-sqlite3-multiple-ciphers/tarball/master

This will install the package like a regular npm package.

Yes...you are right...now it installed without any error. Oh, it was a disturbing flag...😄 Screenshot_20230728-212429