Closed sebastianklug closed 3 years ago
This is not really an issue with rar2fs which means this is not exactly the correct forum for problems as this one. But lets see if we can possibly ignore that fact...
By using the default location of fuse main header file, which should be /usr/include/fuse.h, using --with-fuse is really not necessary. Any system header files should automatically be picked from /usr/include. But since using this one give you the error about fuse version it seems the one in /usr/include is in fact the fuse3 header file. A rather standard fuse2 (fuse legacy) installation has a /usr/include/fuse.h that simply redirect next include to /usr/include/fuse/fuse.h. Since you get an error here regarding fuse version you need to show me what the file in /usr/include looks like. On my system it looks like this
/*
This header is for compatibility with older software using FUSE.
Please use 'pkg-config --cflags fuse' to set include path. The
correct usage is still '#include <fuse.h>', not '#include
<fuse/fuse.h>'.
*/
#include "fuse/fuse.h"
Then at the top of the file in /usr/include/fuse/fuse.h there should be a version of the API defined (rar2fs however sets this to 26), as in my case
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU LGPLv2.
See the file COPYING.LIB.
*/
#ifndef _FUSE_H_
#define _FUSE_H_
/** @file
*
* This file defines the library interface of FUSE
*
* IMPORTANT: you should define FUSE_USE_VERSION before including this
* header. To use the newest API define it to 26 (recommended for any
* new application), to use the old API define it to 21 (default) 22
* or 25, to use the even older 1.X API define it to 11.
*/
#ifndef FUSE_USE_VERSION
#define FUSE_USE_VERSION 21
#endif
#include "fuse_common.h"
...
So in the first case something seems broken with respect to what version is expected and is most likely due to conflict with fuse2 and fuse3 or fuse3 simply is the default version on later Ubuntu distributions.
In the second case it also seems to be some conflict. Since you now point directly to /usr/include/fuse using --with-fuse it means any include of fuse.h from e.g. rar2fs will bypass the file in /usr/include. That you now see an error from _fusecommon.h is that it does not like being included that way. That works fine for a pure legacy install of fuse2 but something might have changed here. If this is a bug in the fuse-dev packages for Ubuntu is hard to tell though, But why you get the error should be because of the same reason e.g. I would get it if trying to install _fusecommon.h directly without going through fuse.h. Here is my _fusecommon.h in /usr/include/fuse
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU LGPLv2.
See the file COPYING.LIB.
*/
/** @file */
#if !defined(_FUSE_H_) && !defined(_FUSE_LOWLEVEL_H_)
#error "Never include <fuse_common.h> directly; use <fuse.h> or <fuse_lowlevel.h> instead."
#endif
...
Hence it expects _FUSE_H_
or _FUSE_LOWLEVEL_H_
to be set, which for rar2fs should be the former since it uses the high level API. But since _FUSE_H_
is not set fuse.h does not seem to do the right thing and rar2fs does not include anything but fuse.h.
So to summarize, I think something is off in the default installation of fuse or it is simply that fuse3 is the new default and that is not supported by rar2fs. Also, trying to install fuse2 on top of it seems to cause a conflict due to some package management issue not handling parallel installations of both API versions properly.
Also fuse3 main header probably explains the error thrown by _fusecommon.h
#if !defined(FUSE_H_) && !defined(FUSE_LOWLEVEL_H_)
#error "Never include <fuse_common.h> directly; use <fuse.h> or <fuse_lowlevel.h> instead."
#endif
The definition checked is different from fuse2.
Thank you so much for the thorough explenation. The fault was neither rar2fs or fuse. I had somehow gotten to a very strange state when installing both libfuse-dev and libfuse3-dev (along with downloading libfuse from git..).
I created a new VM, and here are the steps i took for a successful install:
sudo apt install libfuse-dev
sudo apt install make
sudo apt install g++
wget https://www.rarlab.com/rar/unrarsrc-6.0.3.tar.gz
wget https://github.com/hasse69/rar2fs/releases/download/v1.29.4/rar2fs-1.29.4.tar.gz
tar zxvf rar2fs-1.29.4.tar.gz
tar zxvf unrarsrc-6.0.3.tar.gz
cd unrar/
make lib
cd ../rar2fs-1.29.4/
./configure --with-unrar=/path/to/unrar/
make
sudo make install
I'm having trouble with make. I have tried a couple of ways with different results.
First with default fuse.h Then with fuse.h from libfuse-dev pkg, this gives a somewhat different set of errors and warning. And finally libfuse3-dev. But fuse.h is not found (even with --with-fuse), so I assume fuse 2 should be used.
Is there something I am missing or have forgotten to configure?