losfair / mvsqlite

Distributed, MVCC SQLite that runs on FoundationDB.
https://github.com/losfair/mvsqlite/wiki
Apache License 2.0
1.36k stars 39 forks source link

MacOS support #71

Open anacrolix opened 1 year ago

anacrolix commented 1 year ago

I had some trouble trying this on MacOS. Creating a namespace would hang (not sure if this is MacOS specific). Running sqlite3 with DYLD_INSERT_LIBRARIES didn't seem to interpose correctly, sqlite3 would still operate on the local file test. There are some tweaks to compiler and linker flags in spots that were necessary, I can contribute some of those back if it's of interest.

losfair commented 1 year ago

Thanks for trying mvsqlite on macOS!

Creating a namespace would hang

mvstore needs to be started with the --cluster /usr/local/etc/foundationdb/fdb.cluster argument. Currently the default value is hardcoded to /etc/foundationdb/fdb.cluster but it's different on macOS.

Running sqlite3 with DYLD_INSERT_LIBRARIES didn't seem to interpose correctly, sqlite3 would still operate on the local file test.

Is the sqlite3 binary compiled with dynamically linked libsqlite3?

anacrolix commented 1 year ago

mvstore needs to be started with the --cluster /usr/local/etc/foundationdb/fdb.cluster argument. Currently the default value is hardcoded to /etc/foundationdb/fdb.cluster but it's different on macOS.

I did do that, it suddenly succeeded when I gave up, possibly while shutting the server down. I'll report back but I think it's operator error for now.

Running sqlite3 with DYLD_INSERT_LIBRARIES didn't seem to interpose correctly, sqlite3 would still operate on the local file test.

Is the sqlite3 binary compiled with dynamically linked libsqlite3?

MacOS' equivalent I think:

$ otool -L sqlite3
sqlite3:
    libsqlite3.so (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)

There's probably a lot of user error here, but it may help others who are trying too.