vlcn-io / cr-sqlite

Convergent, Replicated SQLite. Multi-writer and CRDT support for SQLite
https://vlcn.io
MIT License
2.61k stars 69 forks source link

macOS error: dlsym(0x8a21b620, sqlite3_crsqlitedarwinaarch_init): symbol not found #338

Closed simonw closed 10 months ago

simonw commented 10 months ago

I'm trying to load the https://github.com/vlcn-io/cr-sqlite/releases/download/v0.15.0-next.2/crsqlite-darwin-aarch64.dylib on macOS.

/opt/homebrew/Cellar/sqlite/3.43.0_1/bin/sqlite3
SQLite version 3.43.0 2023-08-24 12:36:59
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .load crsqlite-darwin-aarch64
Error: dlsym(0x8a62b620, sqlite3_crsqlitedarwinaarch_init): symbol not found
sqlite> 

I've tried a few different sqlite3 binaries I had lying around and got the same error in all of them. What am I doing wrong?

simonw commented 10 months ago

Aha - just spotted this: https://github.com/vlcn-io/cr-sqlite/blob/59f03c8a23cfa361ca9bf95c603fc70442419127/README.md#L156-L158

simonw commented 10 months ago

This worked:

sqlite> .load crsqlite-darwin-aarch64 sqlite3_crsqlite_init
simonw commented 10 months ago

Different problem, trying to follow this example in the README:

https://github.com/vlcn-io/cr-sqlite/blob/59f03c8a23cfa361ca9bf95c603fc70442419127/README.md?plain=1#L85-L140

I get:

sqlite> insert into crsql_changes
  ("table", pk, cid, val, col_version, db_version, site_id)
  values
  ('foo', 5, 'b', '''thing''', 5, 5, X'7096E2D505314699A59C95FABA14ABB5');
Runtime error: query aborted (4)
tantaman commented 10 months ago

Ah I haven’t kept the readme up to date with the latest version. The entire output of crsql changes should be fed into an insert into crsql changes on another node.

Not at a laptop now but the python hypothesis tests as well as sync tests would have up to date example uses.

On Tue, Sep 5, 2023 at 2:26 PM Simon Willison @.***> wrote:

Different problem, trying to follow this example in the README:

https://github.com/vlcn-io/cr-sqlite/blob/59f03c8a23cfa361ca9bf95c603fc70442419127/README.md?plain=1#L85-L140

I get:

sqlite> insert into crsql_changes ("table", pk, cid, val, col_version, db_version, site_id) values ('foo', 5, 'b', '''thing''', 5, 5, X'7096E2D505314699A59C95FABA14ABB5'); Runtime error: query aborted (4)

— Reply to this email directly, view it on GitHub https://github.com/vlcn-io/cr-sqlite/issues/338#issuecomment-1707109996, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHWK22ZPKISTV2A546SW2LXY5VGFANCNFSM6AAAAAA4MFSBOU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

simonw commented 10 months ago

Gotcha, looks like this is the test to follow: https://github.com/vlcn-io/cr-sqlite/blob/main/py/correctness/tests/test_sync.py

tantaman commented 10 months ago

Yep. That uses the latest build (what is in main and the v0.15.xxx releases)

tantaman commented 10 months ago

@simonw - I published v0.15 as the official stable release and updated all the docs on the site to match. Should be a smoother experience from here on.

simonw commented 9 months ago

Wrote up some of my notes on trying this out here: https://til.simonwillison.net/sqlite/cr-sqlite-macos