webdavfs
webdavfs copied to clipboard
./main.go:279:21: undefined: fuse.AllowRoot # go1.14 darwin/amd64
I want to compile binary on macOS but for Linux.
➜ miquels# git clone https://github.com/miquels/webdavfs
Cloning into 'webdavfs'...
remote: Enumerating objects: 268, done.
remote: Total 268 (delta 0), reused 0 (delta 0), pack-reused 268
Receiving objects: 100% (268/268), 76.39 KiB | 221.00 KiB/s, done.
Resolving deltas: 100% (171/171), done.
➜ miquels# cd webdavfs
➜ webdavfs git:(master) go version
go version go1.14 darwin/amd64
➜ webdavfs git:(master) go get
# github.com/miquels/webdavfs
./main.go:279:21: undefined: fuse.AllowRoot
It's because of this change https://github.com/bazil/fuse/commit/e0b89709bc6481f1345b6e19363cf18766e53fc7
Workaround: use old Bazil's fuse:
➜ webdavfs git:(master) cd ../../../bazil.org/fuse
➜ fuse git:(master) git reset --hard d6840b2
or even 65cc252
if you use go 1.10 or older.
I've added a go.mod file with a dependency on an older fuse package, now it builds again. That's a temporary fix. I'll work on a proper one.
Not sure if this is going to get fixed properly, see https://github.com/miquels/webdavfs/commit/41e220625594d11fda2e50616103952247a851bd
In my tests, 117d633 worked on Linux, and 41e2206 did not.
$ head -1 /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
$ go version
go version go1.15.15 linux/amd64
$ go get -v github.com/miquels/webdavfs@117d633
go: downloading github.com/miquels/webdavfs v0.0.0-20200520090810-117d63347042
go: github.com/miquels/webdavfs 117d633 => v0.0.0-20200520090810-117d63347042
go: downloading golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7
go: downloading bazil.org/fuse v0.0.0-20180421153158-65cc252bf669
go: downloading github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3
golang.org/x/net/context
github.com/pborman/getopt/v2
bazil.org/fuse
bazil.org/fuse/fuseutil
bazil.org/fuse/fs
github.com/miquels/webdavfs
$ go get -v github.com/miquels/webdavfs
go: github.com/miquels/webdavfs upgrade => v0.0.0-20221020123835-41e220625594
github.com/miquels/webdavfs
# github.com/miquels/webdavfs
go/pkg/mod/github.com/miquels/[email protected]/main.go:279:21: undefined: fuse.AllowRoot
I have no idea what's going on here. If I do the same on a Debian 11 server it's even more mysterious:
go get -v github.com/miquels/webdavfs
....
golang.org/x/sys/unix
# golang.org/x/sys/unix
../go/src/golang.org/x/sys/unix/syscall.go:83:16: undefined: unsafe.Slice
../go/src/golang.org/x/sys/unix/syscall_linux.go:2271:9: undefined: unsafe.Slice
../go/src/golang.org/x/sys/unix/syscall_unix.go:118:7: undefined: unsafe.Slice
../go/src/golang.org/x/sys/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice
OTOH, if I just git clone
the github repo, then do go build
the code builds just fine. So, I suggest you do that.
Closing this issue.