From af8ba185806bc72da6ba079627bb92d20126b1b7 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 29 Oct 2023 14:15:34 +0000 Subject: [PATCH] mount: disable mount for freebsd The upstream library rclone uses for rclone mount no longer supports freebsd. Not only is it broken, but it no longer compiles. This patch disables rclone mount for freebsd. However all is not lost for freebsd users - compiling rclone with the `cmount` tag, so `go install -tags cmount` will install a working `rclone mount` command which uses cgofuse and the libfuse C library directly. Note that the binaries from rclone.org will not have mount support as we don't have a freebsd build machine in CI and it is very hard to cross compile cmount. See: https://github.com/bazil/fuse/issues/280 Fixes #5843 --- cmd/cmount/mount.go | 2 +- cmd/mount/dir.go | 4 ++-- cmd/mount/file.go | 4 ++-- cmd/mount/fs.go | 4 ++-- cmd/mount/handle.go | 4 ++-- cmd/mount/mount.go | 4 ++-- cmd/mount/mount_test.go | 4 ++-- cmd/mount/mount_unsupported.go | 6 ++---- 8 files changed, 15 insertions(+), 17 deletions(-) diff --git a/cmd/cmount/mount.go b/cmd/cmount/mount.go index 9649b1be6..f6d86bdb5 100644 --- a/cmd/cmount/mount.go +++ b/cmd/cmount/mount.go @@ -25,7 +25,7 @@ import ( func init() { name := "cmount" - cmountOnly := ProvidedBy(runtime.GOOS) + cmountOnly := runtime.GOOS != "linux" // rclone mount only works for linux if cmountOnly { name = "mount" } diff --git a/cmd/mount/dir.go b/cmd/mount/dir.go index 775edd4e6..4a6f939f6 100644 --- a/cmd/mount/dir.go +++ b/cmd/mount/dir.go @@ -1,5 +1,5 @@ -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux package mount diff --git a/cmd/mount/file.go b/cmd/mount/file.go index 1a0ad6c28..f745dcc7b 100644 --- a/cmd/mount/file.go +++ b/cmd/mount/file.go @@ -1,5 +1,5 @@ -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux package mount diff --git a/cmd/mount/fs.go b/cmd/mount/fs.go index ee5897e92..e81b2f078 100644 --- a/cmd/mount/fs.go +++ b/cmd/mount/fs.go @@ -1,7 +1,7 @@ // FUSE main Fs -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux package mount diff --git a/cmd/mount/handle.go b/cmd/mount/handle.go index c3293acc3..65d344538 100644 --- a/cmd/mount/handle.go +++ b/cmd/mount/handle.go @@ -1,5 +1,5 @@ -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux package mount diff --git a/cmd/mount/mount.go b/cmd/mount/mount.go index 9be432c5e..b32ba29ae 100644 --- a/cmd/mount/mount.go +++ b/cmd/mount/mount.go @@ -1,5 +1,5 @@ -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux // Package mount implements a FUSE mounting system for rclone remotes. package mount diff --git a/cmd/mount/mount_test.go b/cmd/mount/mount_test.go index 4e1d832a9..df4d02ec0 100644 --- a/cmd/mount/mount_test.go +++ b/cmd/mount/mount_test.go @@ -1,5 +1,5 @@ -//go:build linux || freebsd -// +build linux freebsd +//go:build linux +// +build linux package mount diff --git a/cmd/mount/mount_unsupported.go b/cmd/mount/mount_unsupported.go index 84f8656dc..c2feafbc3 100644 --- a/cmd/mount/mount_unsupported.go +++ b/cmd/mount/mount_unsupported.go @@ -1,10 +1,8 @@ -//go:build !linux && !freebsd -// +build !linux,!freebsd +//go:build !linux +// +build !linux // Package mount implements a FUSE mounting system for rclone remotes. // // Build for mount for unsupported platforms to stop go complaining // about "no buildable Go source files". -// -// Invert the build constraint: linux freebsd package mount