osxfuse / sshfs

File system based on the SSH File Transfer Protocol
http://fuse.sourceforge.net
GNU General Public License v2.0
1.17k stars 130 forks source link

How to install on M1 (Big Sur) using homebrew? #65

Closed kostrykin closed 3 years ago

kostrykin commented 3 years ago

I installed osxfuse using homebrew,

brew install osxfuse

but when I try to install sshfs,

brew install sshfs

it says that no bottle exists, and suggests building from source. However, when I try building from source, it fails with the error:

sshfs.c:15:10: fatal error: 'fuse_lowlevel.h' file not found
#include <fuse_lowlevel.h>
^~~~~~~~~~~~~~~~~

The most strange thing is, the file fuse_lowlevel.h is located in the /usr/local/include/osxfuse/fuse/ directory, which is passed as a search directory to the clang compiler:

clang -DHAVE_CONFIG_H -I. -D_REENTRANT -DFUSE_USE_VERSION=26 -DLIBDIR=\"/opt/homebrew/Cellar/sshfs/2.10_2/lib\" -DIDMAP_DEFAULT="\"user\"" -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.66.6/include -I/opt/homebrew/Cellar/glib/2.66.6/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.66.6/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -g -O2 -Wall -W -I./compat -c -o sshfs-cache.o test -f 'cache.c' || echo './'cache.c

So why doesn't the compiler find fuse_lowlevel.h? Could it be, that clang interprets the -I parameter as an -iquote synonym? Unfortunately, I'm not familiar with clang.

I also trying building the formula by hand,

brew unpack --patch sshfs
cd sshfs-2.10
./configure --prefix=/opt/homebrew/Cellar/sshfs/2.10_2
make install

and interestingly, the compilation works, but the linking fails with the error

ld: symbol(s) not found for architecture arm64

so apparently, this issue is M1 related?

bfleischer commented 3 years ago

The easiest way to install SSHFS is downloading the installer package from https://osxfuse.github.io. This is not the most recent version, but it works just fine.

It looks like you installed an old version of FUSE. You need version 4 on M1 Macs. You can download the latest version from https://osxfuse.github.io.

brizzbuzz commented 3 years ago

Feel like this doesn't answer the question though 🤔 how does one do this through Homebrew (useful for workspace setup automation)