Repository navigation
Support FreeBSD - #387
Merged
Merged
Support FreeBSD#387
Conversation
go-fuse v2.2.0 only builds on Linux and macOS, so the FreeBSD build was broken despite the README listing BSD as expected to work. Upgrade it to v2.11.0, which supports FreeBSD. No source changes were needed for the upgrade itself, the fs and fuse APIs desync uses are unchanged. That uncovered a second problem: createDeviceNode for non-Linux passed the device number to unix.Mknod as an int, but FreeBSD takes a uint64. FreeBSD has mknodat(2), so rather than widening the fallback, give it its own implementation using the same Root-relative creation as Linux, which also confines it better than the darwin path that resolves the parent and then creates on the real path. FreeBSD is now built by goreleaser and validated in CI: a cross-compile in the main matrix for a fast signal, and the full test suite in a FreeBSD VM. NetBSD, OpenBSD and DragonFly remain unsupported since go-fuse does not build there, so the README now says so instead of lumping all BSDs together as untested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
go-fusev2.2.0 only builds on Linux and macOS, so the FreeBSD build was broken despite the README listing BSD as "Untested — expected to work". This upgrades it to v2.11.0, which supports FreeBSD. No source changes were needed for the upgrade itself — thefsandfuseAPIs desync uses are unchanged across those versions.That uncovered a second problem:
createDeviceNodefor non-Linux passed the device number tounix.Mknodas anint, but FreeBSD takes auint64. FreeBSD hasmknodat(2), so rather than widening the fallback, it gets its own implementation using the same Root-relative creation as Linux — which also confines it better than the darwin path that resolves the parent throughos.Rootand then creates on the real path.FreeBSD is now built by goreleaser (amd64 and arm64) and validated in CI two ways: a cross-compile in the main matrix for a fast signal, and the full test suite in a FreeBSD VM, since GitHub has no FreeBSD runner.
NetBSD, OpenBSD and DragonFly still don't build — go-fuse has no support for them — so the README now says that explicitly instead of lumping all BSDs together as untested.
Verified locally:
GOOS=freebsdbuilds and vets clean for amd64/arm64; darwin, windows and linux/arm64 still build;go test ./...andgo test -race ./...pass on Linux, includingTestMountIndex, which does a real FUSE mount against the new go-fuse.The FreeBSD test job has not run anywhere before this PR, so its first run here is the real verification.