mergestat / mergestat-lite

Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊
https://mergestat.com/
MIT License
3.46k stars 104 forks source link

sqlite cannot load extension: undefined symbol: sqlite3_limit #372

Open itviewer opened 1 year ago

itviewer commented 1 year ago

ubuntu 22.04.2

$ sqlite3 
SQLite version 3.37.2 2022-01-06 13:25:41
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .load ./libmergestat
Error: ./libmergestat.so: undefined symbol: sqlite3_limit
sqlite>
riyaz-ali commented 1 year ago

Thanks for reporting the issue @itviewer. I was able to reproduce it on Ubuntu 22.04.1

For future reference, one can either:

Output from nm on the generated sqlite3 binary shows that sqlite3_limit() symbol is actually defined:

image

@patrickdevivo @amenowanna let's try this out on couple more linux / ubuntu versions (MacOS builds works fine)

sabbaticas commented 1 year ago

Hi,

The mergestat binary works with no issues. However, I am having the same error message undefined symbol: sqlite3_limit

The current configuration is: Docker ubuntu image running on a x86 mac mini venture 13.3.1 (a) Within a docker shell: cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

I have compiled sqilte3 using your command above and using source from the following zip https://www.sqlite.org/2023/sqlite-amalgamation-3420000.zip

running .version provides sqlite> .version SQLite 3.42.0 2023-05-16 12:36:15 831d0fb2836b71c9bc51067c49fee4b8f18047814f2ff22d817d25195cf350b0 gcc-11.3.0

sqlite> .load ./libmergestat Error: ./libmergestat.so: undefined symbol: sqlite3_limit

Running your nm command root@617ebbf30e09:/data/sqlite# nm -C ./sqlite3 | grep sqlite3_limit 000000000002c8f2 T sqlite3_limit

Initially, I tried .load with the latest v0.6.1 version of libmergestat.so I tried previous versions until I found that v0.5.10 would load successfully.

I tested this version (v0.5.10) with both the compiled version as well as the base SQLite installed using apt and it loads.