Repository navigation
Description
Summary
Bring the cgofuse build to parity with the go-fuse build once the new operations have settled.
cgofuse currently implements fewer operations than the default build, so the Windows and
FUSE-T path is further behind than the documented gap suggests.
Background
internal/fuse/cgofuse_filesystem.go implements: Mount, Unmount, IsMounted, Getattr, Open,
Read, Write, Release, Readdir. It lacks Mkdir and Create, which the go-fuse build has had
all along, on top of everything added in this milestone.
The two implementations are selected by build tag via internal/fuse/platform.go and
platform_cgofuse.go. They share the backend, cache, and buffer, but each wires the FUSE
surface independently — which is how the drift happened and why this needs to be deliberate
work rather than a copy-paste at the end.
Deliberately sequenced last: implementing against the go-fuse semantics before they are settled
would mean porting the same decisions twice.
Implementation
Port Mkdir, Create, Unlink, Rmdir, Rename, Setattr/Truncate, Statfs, Fsync,
and the xattr operations to the cgofuse implementation.
cgofuse differs from go-fuse in ways that matter here:
- Path-based, not node-based. cgofuse handlers receive full paths where go-fuse receives
parent node plus name. Path parsing lives in the cgofuse layer. - Errno returns. cgofuse returns plain
interrno values rather thansyscall.Errno,
and uses its own constants. The error mapping is not shared. - Windows semantics. Windows has no uid/gid or POSIX modes in the Unix sense, and xattr
support is limited. Where the platform cannot honor an operation, return a clear errno rather
than pretending it succeeded.
Extract the shared logic — key derivation, attribute encoding/decoding, the annotation
capability layer, cache and buffer invalidation — into backend-level helpers both
implementations call, rather than duplicating it. Duplication is what produced the current
drift.
Acceptance Criteria
- cgofuse implements every operation the go-fuse build implements, including
MkdirandCreate - Shared logic lives in common helpers, not duplicated per implementation
- Operations Windows cannot support return a documented errno rather than silently succeeding
- Attribute and xattr encoding is byte-identical between the two builds — a mount written by
one reads correctly under the other - A parity test enumerates the expected operation set so future drift fails CI
-
go test -race -tags=cgofuse ./internal/fuse/...passes -
go build -tags=cgofuse ./...passes - The supported-operations documentation from C0-9: Correct the POSIX compliance claim in the documentation #162 is updated to reflect parity
Dependencies
Blocked on #163, #164, #165, #166, and #167. Lands last in the milestone.
Activity
scttfrdmn commentedon Aug 1, 2026
Closing as moot. The cgofuse implementation was deleted in the v0.10.1 refactor, so there is nothing left to bring to parity.
Three findings settled it, each verified by execution rather than by reading:
The
cgofusebuild tag had never compiled.filesystem.gocarried no//go:buildconstraint of its own whilecgofuse_filesystem.gohad//go:build cgofuse, so under the tagOpenFilewas declared twice. That duplicate-symbol error was masked by a missingfuse.h:So the parity gap this issue describes was never a gap between two shipping builds. It was a gap between a shipping build and code that could not be built at all.
Its stated rationale was false.
FUSE_MIGRATION.mdjustified the tag by "macOS compatibility issues" with go-fuse. go-fuse's darwin mount execs/Library/Filesystems/macfuse.fs/Contents/Resources/mount_macfuse(fuse/mount_darwin.go:99) and cgofuse needs the same macFUSE headers — identical macOS requirements. The migration solved nothing it claimed to.The drift was worse than documented. Beyond the missing
MkdirandCreatethis issue names, the 382-line subset never received theUnlink/RmdirEROFS fix (#163), so under that tagrmreported success while the object survived in S3.cgofuse's one genuine advantage is that it cross-compiles for Windows where go-fuse does not:
But nothing verified that a Windows binary could mount anything, and the
build-windowsMakefile target produced a binary with no working FUSE binding. Windows is now explicitly unsupported: every file ininternal/fusecarries//go:build linux || darwin, and a newplatform_unsupported.gofails the build for any otherGOOSwith a message naming the reason, rather than emitting a list ofundefined: fuse.PlatformFileSystemerrors frominternal/adapterthat read like a broken build.Deleted:
cgofuse_filesystem.go,cgofuse_mount.go,cgofuse_test.go,platform_cgofuse.go, thegithub.com/winfsp/cgofusedependency, the five*-cgofuseMakefile targets, andFUSE_MIGRATION.md.If a second binding is wanted later, this issue's own diagnosis is the right one and is now being acted on. It says the drift happened because "each wires the FUSE surface independently" and asks for shared logic in common helpers. That is
internal/vfs— a backend-agnostic POSIX-semantics core owning the attribute model, handle table, dirty-range tracking, and read-modify-write policy, depending on nothing FUSE and returning typed errors rather thansyscall.Errno.internal/fusebecomes a translation shim above it (#22-equivalent work, tracked against #165). A Windows or NFS binding would then be a second shim over the same tested core rather than a fork that silently diverges.Two alternatives worth their own issues if Windows or kernel-extension-free macOS is ever wanted: NFS loopback via
willscott/go-nfs(rclone's macFUSE-free macOS path — no kernel extension, no admin install, weaker POSIX semantics) and macOS FSKit (the strategic answer to macFUSE on modern macOS, but Swift/ObjC-only with no Go bindings). Neither is cgofuse.