mirror of
https://github.com/hanzoai/vfs.git
synced 2026-10-30 18:18:21 +00:00
bazil.org/fuse dropped macOS support (commit 65cc252+). 0.3.0
shipped Linux-only. This drop adds a parallel pkg/mount/fuse_darwin.go
using github.com/jacobsa/fuse, which still supports both macFUSE
(kext) and fuse-t (userspace, no kext, SIP-friendly).
Same Mount(*vfs.FS, mountpoint) signature; the `fuse` build tag
picks the right driver per GOOS at compile time.
What's new
----------
- pkg/mount/fuse_darwin.go (`-tags fuse && darwin`): full
fuseutil.FileSystem implementation using jacobsa/fuse. Maps every
POSIX op the kernel sends:
LookUpInode → FS.Lookup
GetInodeAttributes → FS.Lookup + inode→attrs
SetInodeAttributes(size) → File.Truncate + Sync
MkDir → FS.Mkdir
CreateFile → FS.Create + FS.Open + handle alloc
Unlink/RmDir → FS.Remove
OpenDir/ReadDir/ReleaseDirHandle → FS.ReadDir
OpenFile/ReadFile/WriteFile → FS.Open + File.{ReadAt,WriteAt}
SyncFile/FlushFile → File.Sync
ReleaseFileHandle → File.Close
StatFS → ~1 PiB pseudo-quota (backend is unlimited)
- pkg/vfs/fs.go: new FS.PathOfInode(InodeID) for the macOS driver,
which gets ops as (parent_id, name) tuples instead of bazil's
node-pointer style. O(depth) walk up the parent chain.
- pkg/mount/fuse_sqlite_test.go: build tag widened to
`fuse && (linux || darwin)`. Adds `runtime.GOOS` switch to invoke
the right unmount tool (`fusermount`/`fusermount3` on Linux,
`umount`/`diskutil unmount` on macOS).
Verified
--------
On macOS with fuse-t installed:
VFS_FUSE_E2E=1 go test -tags fuse -timeout 60s \
-run TestFUSESQLite ./pkg/mount/ -v
→ PASS: TestFUSESQLite (1.16s)
→ 100 rows survived umount+remount, integrity_check=ok
Real FUSE mount, real SQLite opening test.db directly on the
mountpoint, 100 INSERTs, unmount, remount, PRAGMA integrity_check.
Zero copy step.
2 lines
6 B
Plaintext
2 lines
6 B
Plaintext
0.3.1
|