macOS support
Hi there,
The project only releases a binary for Linux currently, I wonder if macOS will be supported in the future. This is a Go project and sqlite can be run on macOS as well, and there are projects like macFUSE, so I assume this is technically possible. It will be great if macOS can be used for development and experiment purpose. Thanks.
@niyue I got things to work with https://github.com/superfly/litefs/pull/118.
Thanks for submitting the PR, @anacrolix. I originally had it working on macOS with hanwen/go-fuse but I had quite a few issues. I'm not sure if it was macFUSE or the go-fuse library. They were fairly serious issues like locking up my entire laptop and forcing a hard shutdown.
I'd like to support macOS but I may do it as a SQLite VFS instead of dealing with the intricacies of macFUSE. I'd be curious what @tv42's thoughts are on it as well since he knows the FUSE code so well.
@anacrolix thanks for the #118
I can now set up a two-node litefs env on macOS, and I did some minimum test and it works as expected. I create a sample project to demonstrate this setup: https://github.com/niyue/litefs_testbed
@benbjohnson do you want to consider using the alternative FUSE library in the meanwhile, so as not to leave Mac users in the dark? As mentioned in #118 it works on both Linux and Mac, so is a good middle ground until there's an alternative.
A SQLite VFS would be fantastic, I already ran into performance issues I think arising out of having FUSE in the middle.
@anacrolix I’d need to look at any alternative implementation and do a lot of testing first. I don’t want to leave macOS users in the dark but it’s also not a typical OS for server deployment.
As for perf, the rollback journal does a lot of small file system calls and has a lot of lock contention so I’m not worrying too much about the performance side until I get WAL support implemented.
I have read plenty of the OSXFUSE kext source code, back when it was still open source and there was a hope of fixing it. Please trust me when I say that macOS does not have FUSE -- it's internal design is incompatible with the concept -- and it won't get such support until Apple deems to do something about that.
bazil.org/fuse removed 25% of its source code by deleting bug workarounds, after dropping macOS. And even with that extra burden to work around the differences and oddities, I could make OSXFUSE mounts hang, or crash the whole kernel, just by doing a lot of file system operations. And then OSXFUSE went non-opensource, and Apple started preventing people from running kexts not signed by blessed few. I am not going back, that well is poisoned and the software in question is inherently unfixable now.
Your best hopes are either pleading for Apple to provide a userspace mechanism for implementing filesystems (and the end result won't look like FUSE, just because it'll be a from scratch design for their microkernel world), or using something like NFS to localhost (and the end result won't look like FUSE, because it's a network protocol).
I couldn't find any mention of MacOS fixes, or VFS use in the release notes, have I missed something?
@anacrolix Sorry, I was doing some cleanup and closed this one since we're not going to support FUSE on macOS. I added a separate ticket to track the VFS implementation: https://github.com/superfly/litefs/issues/165