signalapp / Signal-FTS5-Extension

A FTS5 extension for signal_tokenizer.
GNU Affero General Public License v3.0
38 stars 9 forks source link

Problems following example usage #2

Open karlb opened 10 months ago

karlb commented 10 months ago

The given compilation command did not create a dynamic library for me. Using the following command created one at the expected place (removed -- and added release, since the example used a release build):

cargo rustc --features extension --release --crate-type=cdylib

The suggested .load command will only work on MacOS, since other systems use a different suffix for dynamic libraries. A simple way to avoid that problem is to omit the suffix, since sqlite will look up files with the correct suffix for the used OS:

.load ./target/release/libsignal_tokenizer

When changing these two things, sqlite3 find the library, but still fails to load it correctly due to

Error: ./target/release/libsignal_tokenizer.so: undefined symbol: sqlite3_signaltokenizer_init

I haven't looked into that problem yet. Any obvious explanation? Did I break something by changing the rustc call?

trucnguyenlam commented 9 months ago

@karlb I also run into the same issue.

mpr1255 commented 8 months ago

I have the same issue. Came here after several hours of debugging. What is the point of releasing a library like this if we can't even use it?? My gosh.

AlexErrant commented 7 months ago

From the blog:

Note that default sqlite3 shell doesn't support extensions so you'd have to build your own or use Signal's fork of better-sqlite3 which automatically loads signal_tokenizer.

Maybe that'll help you? I haven't tried it myself since the code is AGPL.

mpr1255 commented 7 months ago

From the blog:

Note that default sqlite3 shell doesn't support extensions so you'd have to build your own or use Signal's fork of better-sqlite3 which automatically loads signal_tokenizer.

Maybe that'll help you? I haven't tried it myself since the code is AGPL.

I just gave up and use https://github.com/wangfenjin/simple

geakstr commented 3 months ago

I've prepared pull request (https://github.com/signalapp/Signal-FTS5-Extension/pull/3) to fix the issue. I wasn't be able to figure out root cause and how it was supposed to work at first place, but fixed with just trials and errors