mvsqlite icon indicating copy to clipboard operation
mvsqlite copied to clipboard

MacOS support

Open anacrolix opened this issue 3 years ago • 2 comments

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.

anacrolix avatar Sep 25 '22 23:09 anacrolix

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?

losfair avatar Sep 26 '22 12:09 losfair

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.

anacrolix avatar Sep 27 '22 02:09 anacrolix