rclone: build: bazil.org/fuse no longer supports macOS

Alas the maintainer of the fuse library that rclone uses for rclone mount is dropping support for macOS. I updated the library and it no longer builds on macOS.

https://github.com/bazil/fuse/issues/224

This isn’t a disaster - rclone has 2 other supported mount libraries on macOS.

  • mount2
  • cmount

They both have pros and cons though.

mount2

mount2 is relatively new and untested. It is supported on macOS but it isn’t supported on FreeBSD so we can’t drop the mount library completely. It would be easy to make this the default mount on macOS.

cmount

cmount uses libfuse directly via its C interface. It works well but requires building rclone with CGO.

A naive build of rclone on macOS with CGO will mean that rclone won’t run without the OSXFUSE library installed. Need to check this is actually the case as it might be dynamically loaded like cgofuse does on windows.

Investigations show that it is quite difficult to build go binaries on macOS that are static - this is discouraged by Apple, so what we need is a partially static binary which has libfuse compiled in but is still a dynamic library.

Another alternative would be to provide 2 binaries for macOS one which supports mount and one which doesn’t. This is undesireable!

If we can build rclone with the correct library statically then it might be a good idea to use cmount for all platforms.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 53 (39 by maintainers)

Commits related to this issue

Most upvoted comments

I have merged the changes to use cgofuse to master now 😃

The plan will be

for v1.53 (DONE)

  • compile in rclone cmount/cgofuse for macOS users unconditionally
  • warn that rclone mount will be using rclone cmount to nudge people to try it before v1.54 and report problems while they still have a way back

for v1.54

  • remove rclone mount for macOS and make its implementation be rclone cmount provided there haven’t been problems we can’t fix.

FWIW anacrolix/fuse now also supports FUSE-T.

An alternative to cgofuse is to use @anacrolix’s own fork of bazil/fuse, which is a drop-in replacement (no code changes necessary) which provides the exact same functionality — plus working macFUSE 4+ support.

You can get it from here: https://github.com/anacrolix/fuse

This has been merged in brew, so any future installs or upgrades from brew should have the cmount command.

FYI I have released cgofuse v1.4.0.

Your “it all fits in my head” comment is so spot on. Many other programming languages that keep adding features miss that very important point.

Coming from many years of C# and having discovered Go only recently, I can totally relate to that 😄

Anyway… I gave a try on both my Mac:

  • the one with OSXFUSE installed works perfectly as before (both mount and cmount)
  • the one without OSXFUSE runs fine until I try to mount (as expected) but we would probably want to catch the panic 🤔
Minnie rclone-v1.52.2-198-g5a59983e-fix-4393-cmount-beta-osx-amd64 % ./rclone mount dropbox: ~/rclone
2020/07/04 16:33:25 Fatal error: failed to mount FUSE fs: cannot locate OSXFUSE
Minnie rclone-v1.52.2-198-g5a59983e-fix-4393-cmount-beta-osx-amd64 % ./rclone cmount dropbox: ~/rclone
panic: cgofuse: cannot find FUSE

goroutine 53 [running]:
github.com/rclone/rclone/vendor/github.com/billziss-gh/cgofuse/fuse.(*FileSystemHost).Mount(0xc000a94200, 0x7ffeefbffa99, 0x16, 0xc0001d1e00, 0x10, 0x14, 0xc0001eb700)
	github.com/rclone/rclone/vendor/github.com/billziss-gh/cgofuse/fuse/host.go:610 +0x792
github.com/rclone/rclone/cmd/cmount.mount.func1(0xc000a94200, 0x7ffeefbffa99, 0x16, 0xc0001d1e00, 0x10, 0x14, 0x5b64ee0, 0xc0000c8fc0, 0xc00010f3e0)
	github.com/rclone/rclone/cmd/cmount/mount.go:168 +0x6d
created by github.com/rclone/rclone/cmd/cmount.mount
	github.com/rclone/rclone/cmd/cmount/mount.go:166 +0x436

I find Go a very productive language for me. It all fits in my head (like C) so usually just keeps out my way.

Your “it all fits in my head” comment is so spot on. Many other programming languages that keep adding features miss that very important point.