Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FreeBSD #509

Closed
wants to merge 0 commits into from
Closed

Add support for FreeBSD #509

wants to merge 0 commits into from

Conversation

lch
Copy link
Contributor

@lch lch commented Apr 2, 2024

Hi,

I'm trying to add support for FreeBSD, which is mentioned in issue #85 #120 #415 #432 .

In this PR, I have added the proper functions needed for build on FreeBSD, and I have tested building successfully on FreeBSD 14.0-RELEASE, with following building command (as Darwin)

go build ./fuse/... ./fs/... ./example/loopback/...

Some syscalls and constants which are lacking on FreeBSD are replaced to similar ones. And some functions specific on Linux/Darwin are moved to corresponding _linux.go and _darwin.go.
However, there are still some tests which will fail the go test command, like test in fuse/nodefs will fail. For example TestMemNodeFsWrite and TestMemNodeFsBasic. And I have noticed that in the run of some tests, it will hang for unknown reason radomly, like TestMemNodeFsWrite in fs/nodefs, which made it hard to debug. Since they are marked as deprecated api, I'm not sure whether they should be fixed.

I am committed to persistently investigating the problems, and hoping them get resolved. I would greatly appreciate your comments and suggestions.

@rfjakob
Copy link
Contributor

rfjakob commented Apr 27, 2024

Am I doing something wrong here?

go-fuse$ go version
go version go1.21.4 linux/amd64

go-fuse$ git describe
v2.5.1-8-g90eabd7

go-fuse$ GOOS=freebsd go build ./fs/
# github.com/hanwen/go-fuse/v2/fs
fs/files.go:44:25: cannot convert (*loopbackFile)(nil) (value of type *loopbackFile) to type FileAllocater: *loopbackFile does not implement FileAllocater (missing method Allocate)
fs/files.go:211:13: f.utimens undefined (type *loopbackFile has no field or method utimens)
fs/bridge.go:257:2: undefined: setBlocks
fs/loopback.go:126:32: undefined: intDev
fs/loopback.go:344:9: undefined: NewLoopbackDirStream

@rfjakob
Copy link
Contributor

rfjakob commented Apr 27, 2024

Looks the same on https://app.vagrantup.com/generic/boxes/freebsd14

[vagrant@freebsd14 ~/go-fuse/fs]$ uname -a
FreeBSD freebsd14.localdomain 14.0-RELEASE FreeBSD 14.0-RELEASE #0 releng/14.0-n265380-f9716eee8ab4: Fri Nov 10 05:57:23 UTC 2023     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

[vagrant@freebsd14 ~/go-fuse/fs]$ go version
warning: GOPATH set to GOROOT (/home/vagrant/go) has no effect
go version go1.22.2 freebsd/amd64

[vagrant@freebsd14 ~/go-fuse/fs]$ git describe
v2.5.1-8-g90eabd7

[vagrant@freebsd14 ~/go-fuse/fs]$ go build
warning: GOPATH set to GOROOT (/home/vagrant/go) has no effect
# github.com/hanwen/go-fuse/v2/fs
./files.go:44:25: cannot convert (*loopbackFile)(nil) (value of type *loopbackFile) to type FileAllocater: *loopbackFile does not implement FileAllocater (missing method Allocate)
./files.go:211:13: f.utimens undefined (type *loopbackFile has no field or method utimens)
./bridge.go:257:2: undefined: setBlocks
./loopback.go:126:32: undefined: intDev
./loopback.go:344:9: undefined: NewLoopbackDirStream

@hanwen
Copy link
Owner

hanwen commented Apr 27, 2024 via email

@lch
Copy link
Contributor Author

lch commented Apr 27, 2024

Sorry for the inconvenience. There are some commits I proposed on gerrit have not synced to github. And I'm still working on it.

@rfjakob
Copy link
Contributor

rfjakob commented Apr 28, 2024 via email

@rfjakob
Copy link
Contributor

rfjakob commented May 17, 2024

Looks good now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants