borg icon indicating copy to clipboard operation
borg copied to clipboard

macOS: test fuse-t

Open ThomasWaldmann opened this issue 3 years ago • 2 comments

https://www.fuse-t.org should be tested by a macOS user whether it works with borg:

  • using llfuse
  • using pyfuse3

Besides practical testing one should also run borg's automated testsuite.

wiki: https://github.com/macos-fuse-t/fuse-t/wiki

hackernews comments: https://news.ycombinator.com/item?id=32726166

ThomasWaldmann avatar Sep 05 '22 19:09 ThomasWaldmann

Came to post the same. Will try it out. May help us revive those mount tests. And even the Homebrew formulas.

m3nu avatar Sep 07 '22 10:09 m3nu

It would also help if the developer of fuse-t actually open sources it.

Currently there is not much to see in that github repo.

ThomasWaldmann avatar Sep 07 '22 10:09 ThomasWaldmann

Fuse-T developer said it will eventually release source code when the code will be in good state. We (I) can certainely test it, it's just a matter of including the right lib. But before getting stuff more "official", I really suggest waiting for OSS release and code review, since it could break all the shiny security put in place by borg.

firewavemtl avatar Oct 27 '22 18:10 firewavemtl

It appears not to work. Usingborg 1.2.3 from the borgbackup/tap/borgbackup-fuse tap.

(base) gorby@Gorbys-MacBook-Air ~ % borg mount backup mnt
borg mount not available: no FUSE support, BORG_FUSE_IMPL=pyfuse3,llfuse.

gorbypark avatar Feb 24 '23 22:02 gorbypark

@gorbypark hmm, the error msg is the same as if neither llfuse nor pyfuse3 is installed.

Maybe first get it working with another fuse implementation and then try fuse-t again.

ThomasWaldmann avatar Feb 25 '23 16:02 ThomasWaldmann

@gorbypark hmm, the error msg is the same as if neither llfuse nor pyfuse3 is installed.

Maybe first get it working with another fuse implementation and then try fuse-t again.

Everything works when macfuse is installed + the kernel extension is enabled. Fuse-t is correctly installed as I use it for sshfs.

When macfuse is installed (but kernel extensions is not enabled) and fuse-t also installed, I receive

borg mount borgbackups borgmount
Enter passphrase for key /Users/gorby/borgbackups:
mount_macfuse: the file system is not available (1)

If I uninstall macfuse, leaving only fuse-t, I receive what I got above,

borg mount borgbackups borgmount
borg mount not available: no FUSE support, BORG_FUSE_IMPL=pyfuse3,llfuse.

gorbypark avatar Feb 25 '23 17:02 gorbypark

Can you just try from a python interpreter:

import llfuse
import pyfuse3

Does this work or is there some exception?

ThomasWaldmann avatar Feb 25 '23 17:02 ThomasWaldmann

Can you just try from a python interpreter:

import llfuse
import pyfuse3

Does this work or is there some exception?

It seems I do not have those available. I'm not an expert at python, but I believe during the installation of Borg, I saw an env was being used to install some python dependencies? Is it possible I need to activate that environment? I guess it doesn't really make sense to have to run Borg in a specific environment, though. I will try and install llfuse and pyfuse3 globally and see what happens.

python borgtest.py
Traceback (most recent call last):
  File "/Users/gorby/borgtest.py", line 1, in <module>
    import llfuse
ModuleNotFoundError: No module named 'llfuse'

gorbypark avatar Feb 25 '23 17:02 gorbypark

Can you just try from a python interpreter:

import llfuse
import pyfuse3

Does this work or is there some exception?

Ok, so it appears that both llfuse and pyfuse3 rely on libfuse being installed, which as far as I can tell is not available on macOS. I am not sure if macFuse is supplying the headers for libfuse allowing it to work?

With macfuse uninstalled, both pip install llfuse or pip install pyfuse3 fail with a similar error. Installing macfuse (but not activating the kernel extensions) allows pip install llfuse to install. Although, importing llfuse throws this error

python borgtest.py
Traceback (most recent call last):
  File "/Users/mhamilton/borgtest.py", line 1, in <module>
    import llfuse
ImportError: dlopen(/Users/mhamilton/miniconda3/lib/python3.10/site-packages/llfuse.cpython-310-darwin.so, 0x0002): Library not loaded: /usr/local/lib/libfuse.2.dylib
  Referenced from: <95A54E15-AF19-3697-9927-4C88551C223B> /Users/mhamilton/miniconda3/lib/python3.10/site-packages/llfuse.cpython-310-darwin.so
  Reason: tried: '/usr/local/lib/libfuse.2.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libfuse.2.dylib' (no such file), '/usr/local/lib/libfuse.2.dylib' (no such file), '/usr/lib/libfuse.2.dylib' (no such file, not in dyld cache)

This is trying to pip install pyfuse3

pip install pyfuse3
Collecting pyfuse3
  Using cached pyfuse3-3.2.2.tar.gz (510 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 2
  ╰─> [4 lines of output]
      Package fuse3 was not found in the pkg-config search path.
      Perhaps you should add the directory containing `fuse3.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'fuse3' found
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

gorbypark avatar Feb 25 '23 17:02 gorbypark

AFAIK, macfuse is still only supporting fuse2 (not fuse3), so pyfuse3 can not work for macfuse.

ThomasWaldmann avatar Feb 25 '23 17:02 ThomasWaldmann

AFAIK, macfuse is still only supporting fuse2 (not fuse3), so pyfuse3 can not work for macfuse.

Ok, kinda makes sense, it seems like llfuse is for fuse2, so installing macfuse is giving headers for fuse2. Although, fuse-t's website is saying

Drop-in replacement for osxfuse (https://osxfuse.github.io/). API headers in libfuse are identical so there's no need to change anything in the filesystem implementation. The APIs are compatible with macfuse but differ from the Linux version of libfuse because the macfuse project was not updated in sync with the corresponding Linux version

It seems like fuse-t should be compatible with macfuse, but I'm not quite sure if I'm interpreting that correctly.

gorbypark avatar Feb 25 '23 17:02 gorbypark

@gorbypark maybe you could ask the fuse-t author if they know what's missing or how to fix.

ThomasWaldmann avatar Feb 25 '23 18:02 ThomasWaldmann

One year later and the fuse-t project does still not seem to be going open source. Guess that makes it way less interesting for borg users and thus I am closing this.

ThomasWaldmann avatar Nov 18 '23 20:11 ThomasWaldmann