libfuse / sshfs

A network filesystem client to connect to SSH servers
GNU General Public License v2.0
5.84k stars 492 forks source link

Native dependency 'fuse3' not found #99

Closed ob-ivan closed 6 years ago

ob-ivan commented 6 years ago

I'm running Fedora 26 with 4.12.14-300 kernel on x86_64 arch. I've just installed fuse3 following instructions at https://github.com/libfuse/libfuse. Tests were all green. The only issue I've encountered was that /etc/init.d/fuse3 didn't support chkconfig, and I sort of fixed that manually by adding:

# chkconfig: - 90 60

at the top of the script, then running all sorts of chkconfig --add fuse3, chkconfig fuse3 on, systemctl start fuse3 to get it up.

Now I try to install sshfs, and when I run meson .., this is what I get:

The Meson build system
Version: 0.42.1
Source dir: /home/ivan/Install/sshfs-3.3.0
Build dir: /home/ivan/Install/sshfs-3.3.0/build
Build type: native build
Project name: sshfs
Native C compiler: cc (gcc 7.2.1)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Message: Compiler warns about unused result even when casting to void
Program rst2man found: NO
Configuring config.h using configuration
Found pkg-config: /bin/pkg-config (1.3.9)

Meson encountered an error in file meson.build, line 47, column 0:
Native dependency 'fuse3' not found

Yet, fuse3 service seems to be up and running:

[ivan@fedora build]$ sudo systemctl status fuse3
[sudo] password for ivan: 
● fuse3.service - LSB: Start and stop fuse.
   Loaded: loaded (/etc/rc.d/init.d/fuse3; generated; vendor preset: disabled)
   Active: active (exited) since Sat 2017-09-30 17:46:46 MSK; 9min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 792 ExecStart=/etc/rc.d/init.d/fuse3 start (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/fuse3.service

Sep 30 17:46:45 fedora.localdomain systemd[1]: Starting LSB: Start and stop fuse....
Sep 30 17:46:46 fedora.localdomain fuse3[792]: Loading fuse module.
Sep 30 17:46:46 fedora.localdomain fuse3[792]: Mounting fuse control filesystem.
Sep 30 17:46:46 fedora.localdomain systemd[1]: Started LSB: Start and stop fuse..

What could I have possibly done wrong? And how do I do it right?

Nikratio commented 6 years ago

What does pkg-config --modversion fuse3 say? If it gives you an error, then this is the source of your problem. Maybe pkg-config doesn't look for the fuse3.pc file in the place where Meson has installed it?

ob-ivan commented 6 years ago

@Nikratio you guess it right:

[ivan@fedora ~]$ pkg-config --modversion fuse3
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
Package 'fuse3', required by 'virtual:world', not found

I used find to (ahem) find fuse3.pc located in ~/Install/fuse-3.2.0/build/meson-private/fuse3.pc path (Install being the directory where I move files before running various installers), which is a bit unexpected.

I would (rather naively) expect installers to place package- or service-related files to corresponding system folders by default, as they do with /etc/init.d/ scripts for example. And if not, then the necessity of moving those around or adding their paths to various environment variables to be documented (either in libfuse, or sshfs, or both). Could it be a documentation issue? Or the reader is the problem?

PS. Also, in my current environment echo $PKG_CONFIG_PATH gives empty string. If I set it to the full path to fuse3.pc, then it gives me Native dependency 'glib-2.0' not found. So my next move would be collecting all package config paths in the variable? I have no clue as how to locate them.

Nikratio commented 6 years ago

Thanks for checking! Meson is normally installing the .pc file in the right path. Apparently it didn't work for you though. I'm closing this issue now since it seems to be a libfuse bug. It would be great if you could re-file it at https://github.com/libfuse/libfuse/issues. Please include the output of ninja -v install. In my case, it includes:

Installing /home/nikratio/in-progress/libfuse/build-test/meson-private/fuse3.pc to foo/usr/local/lib/x86_64-linux-gnu/pkgconfig
EthanBK commented 5 years ago

Thanks for the discussion! I'm having the same issue

ElectricRCAircraftGuy commented 3 years ago

This problem still exists. Ubuntu 20.04:

git clone https://github.com/libfuse/sshfs.git
cd sshfs
mkdir build
cd build
sudo apt update

# install dependencies
sudo apt install meson cmake fuse3

meson ..

Build errors:

sshfs/build$ meson ..
The Meson build system
Version: 0.53.2
Source dir: /home/gabriel/GS/dev/sshfs
Build dir: /home/gabriel/GS/dev/sshfs/build
Build type: native build
Project name: sshfs
Project version: 3.7.1
C compiler for the host machine: cc (gcc 9.3.0 "cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0")
C linker for the host machine: cc ld.bfd 2.34
Host machine cpu family: x86_64
Host machine cpu: x86_64
meson.build:5: WARNING: Consider using the built-in warning_level option instead of using "-Wall".
meson.build:5: WARNING: Consider using the built-in warning_level option instead of using "-Wextra".
Message: Compiler warns about unused result even when casting to void
Program rst2man found: YES (/usr/bin/rst2man)
Configuring config.h using configuration
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Found CMake: /usr/bin/cmake (3.16.3)
Run-time dependency fuse3 found: NO (tried pkgconfig and cmake)

meson.build:47:0: ERROR: Dependency "fuse3" not found, tried pkgconfig and cmake

A full log can be found at /home/gabriel/GS/dev/sshfs/build/meson-logs/meson-log.txt

How do I fix this and get it to build?

ElectricRCAircraftGuy commented 3 years ago

It looks like I was missing a few dependencies: libfuse3-dev and libglib2.0-dev. So, do this instead:

# install dependencies
sudo apt install meson cmake fuse3 libfuse3-dev libglib2.0-dev

References:

  1. for libglib2.0-dev: https://askubuntu.com/questions/58321/how-do-i-install-glib/58357#58357
  2. for libfuse3-dev: https://github.com/sbencoding/wdfs/issues/7#issuecomment-585919576
ElectricRCAircraftGuy commented 3 years ago

Here's the full steps. I'll update the readme and do a PR to resolve both this issue and #121.

build:

git clone https://github.com/libfuse/sshfs.git # <==== DON'T DO THIS! DOWNLOAD LATEST TARBALL RELEASE INSTEAD!
cd sshfs
mkdir build
cd build
sudo apt update

# install dependencies
sudo apt install meson cmake fuse3 libfuse3-dev libglib2.0-dev

meson ..

Note: mesonconf doesn't work, so use meson configure instead! See meson -h for help options.

ninja # build and link; this produces the `sshfs` executable output!
sorenwacker commented 2 years ago

This still happens. Above code solved it.