Please switch fuse dependency to fuse3
Description of problem
Fuse3 is now 5 years old, mature and mainstream. 2 years ago in 2019 it was decided then to ask any user to switch to the new version. You can see that in their 2.9.9 release info but also if you look for bugs throughout open source projects
Now in 2021 plenty of those have been implemented and Distributions (at least Ubuntu, but I think this is a general desire) would like to move generally 2->3 to further demote fuse2 and fully go with fuse2.
Upstream listed general steps on a switch to 3.0 in their 3.0 release notes and while that reads a lot I was checking other projects and at least in the ones I checked the changes looked fairly mechanical - for example in gvfsd.
A minor detail, but making the problem slightly worse is that the common buddy of libvirt qemu as in 6.0 added fuse support and needs fuse3. So a common installation would always need both.
Libvirt only uses it for libvirt-lxc which I have no good insight, use case or tests since Ubuntu favors LXD for the same use case - therefore I'm not considering to create a patch right now. But since it seems back then in the barrage of bugs upstream has created they have missed libvirt - so I thought I could raise the awareness by filing this issue here.
Steps to reproduce
- remove libfuse-dev
- install libfuse3-dev
- build against fuse3 via
src/lxc/lxc_fuse.h:
#define FUSE_USE_VERSION 30
meson.build:
fuse_version = '3.0.0'
fuse_dep = dependency('fuse3', version: '>=' + fuse_version, required: get_option('fuse'))
You'll then on build get the expected API change build-fails. Example:
../../src/lxc/lxc_fuse.c: In function 'lxcProcReaddir':
../../src/lxc/lxc_fuse.c:84:5: error: too few arguments to function 'filler'
84 | filler(buf, ".", NULL, 0);
| ^~~~~~
../../src/lxc/lxc_fuse.c:85:5: error: too few arguments to function 'filler'
85 | filler(buf, "..", NULL, 0);
| ^~~~~~
../../src/lxc/lxc_fuse.c:86:5: error: too few arguments to function 'filler'
86 | filler(buf, fuse_meminfo_path + 1, NULL, 0);
| ^~~~~~
../../src/lxc/lxc_fuse.c: At top level:
../../src/lxc/lxc_fuse.c:255:16: warning: initialization of 'int (*)(const char *, struct stat *, struct fuse_file_info *)' from incompatible pointer type 'int (*)(const char *, struct stat *)' [-Wincompatible-pointer-types]
255 | .getattr = lxcProcGetattr,
| ^~~~~~~~~~~~~~
../../src/lxc/lxc_fuse.c:255:16: note: (near initialization for 'lxcProcOper.getattr')
../../src/lxc/lxc_fuse.c:256:16: warning: initialization of 'int (*)(const char *, void *, int (*)(void *, const char *, const struct stat *, off_t, enum fuse_fill_dir_flags), off_t, struct fuse_file_info *, enum fuse_readdir_flags)' {aka 'int (*)(const char *, void *, int (*)(void *, const char *, const struct stat *, long int, enum fuse_fill_dir_flags), long int, struct fuse_file_info *, enum fuse_readdir_flags)'} from incompatible pointer type 'int (*)(const char *, void *, int (*)(void *, const char *, const struct stat *, off_t, enum fuse_fill_dir_flags), off_t, struct fuse_file_info *)' {aka 'int (*)(const char *, void *, int (*)(void *, const char *, const struct stat *, long int, enum fuse_fill_dir_flags), long int, struct fuse_file_info *)'} [-Wincompatible-pointer-types]
256 | .readdir = lxcProcReaddir,
| ^~~~~~~~~~~~~~
../../src/lxc/lxc_fuse.c:256:16: note: (near initialization for 'lxcProcOper.readdir')
../../src/lxc/lxc_fuse.c: In function 'lxcFuseDestroy':
../../src/lxc/lxc_fuse.c:264:22: warning: passing argument 1 of 'fuse_unmount' from incompatible pointer type [-Wincompatible-pointer-types]
264 | fuse_unmount(fuse->mountpoint, fuse->ch);
| ~~~~^~~~~~~~~~~~
| |
| char *
In file included from ../../src/lxc/lxc_fuse.h:26,
from ../../src/lxc/lxc_fuse.c:28:
/usr/include/fuse3/fuse.h:948:32: note: expected 'struct fuse *' but argument is of type 'char *'
948 | void fuse_unmount(struct fuse *f);
| ~~~~~~~~~~~~~^
../../src/lxc/lxc_fuse.c:264:5: error: too many arguments to function 'fuse_unmount'
264 | fuse_unmount(fuse->mountpoint, fuse->ch);
| ^~~~~~~~~~~~
In file included from ../../src/lxc/lxc_fuse.h:26,
from ../../src/lxc/lxc_fuse.c:28:
/usr/include/fuse3/fuse.h:948:6: note: declared here
948 | void fuse_unmount(struct fuse *f);
| ^~~~~~~~~~~~
../../src/lxc/lxc_fuse.c: In function 'lxcSetupFuse':
../../src/lxc/lxc_fuse.c:307:31: warning: passing argument 1 of 'fuse_mount' from incompatible pointer type [-Wincompatible-pointer-types]
307 | fuse->ch = fuse_mount(fuse->mountpoint, &args);
| ~~~~^~~~~~~~~~~~
| |
| char *
In file included from ../../src/lxc/lxc_fuse.h:26,
from ../../src/lxc/lxc_fuse.c:28:
/usr/include/fuse3/fuse.h:939:29: note: expected 'struct fuse *' but argument is of type 'char *'
939 | int fuse_mount(struct fuse *f, const char *mountpoint);
| ~~~~~~~~~~~~~^
../../src/lxc/lxc_fuse.c:307:45: warning: passing argument 2 of 'fuse_mount' from incompatible pointer type [-Wincompatible-pointer-types]
307 | fuse->ch = fuse_mount(fuse->mountpoint, &args);
| ^~~~~
| |
| struct fuse_args *
In file included from ../../src/lxc/lxc_fuse.h:26,
from ../../src/lxc/lxc_fuse.c:28:
/usr/include/fuse3/fuse.h:939:44: note: expected 'const char *' but argument is of type 'struct fuse_args *'
939 | int fuse_mount(struct fuse *f, const char *mountpoint);
| ~~~~~~~~~~~~^~~~~~~~~~
../../src/lxc/lxc_fuse.c:307:14: warning: assignment to 'struct fuse_chan *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
307 | fuse->ch = fuse_mount(fuse->mountpoint, &args);
| ^
../../src/lxc/lxc_fuse.c:312:57: error: macro "fuse_new" passed 5 arguments, but takes just 4
312 | sizeof(lxcProcOper), fuse->def);
| ^
In file included from ../../src/lxc/lxc_fuse.h:26,
from ../../src/lxc/lxc_fuse.c:28:
/usr/include/fuse3/fuse.h:925: note: macro "fuse_new" defined here
925 | #define fuse_new(args, op, size, data) fuse_new_30(args, op, size, data)
|
../../src/lxc/lxc_fuse.c:311:18: error: 'fuse_new' undeclared (first use in this function); did you mean 'fuse_fs_new'?
311 | fuse->fuse = fuse_new(fuse->ch, &args, &lxcProcOper,
| ^~~~~~~~
| fuse_fs_new
../../src/lxc/lxc_fuse.c:311:18: note: each undeclared identifier is reported only once for each function it appears in
../../src/lxc/lxc_fuse.c:314:26: warning: passing argument 1 of 'fuse_unmount' from incompatible pointer type [-Wincompatible-pointer-types]
314 | fuse_unmount(fuse->mountpoint, fuse->ch);
| ~~~~^~~~~~~~~~~~
| |
| char *
In file included from ../../src/lxc/lxc_fuse.h:26,
from ../../src/lxc/lxc_fuse.c:28:
/usr/include/fuse3/fuse.h:948:32: note: expected 'struct fuse *' but argument is of type 'char *'
948 | void fuse_unmount(struct fuse *f);
| ~~~~~~~~~~~~~^
../../src/lxc/lxc_fuse.c:314:9: error: too many arguments to function 'fuse_unmount'
314 | fuse_unmount(fuse->mountpoint, fuse->ch);
| ^~~~~~~~~~~~
In file included from ../../src/lxc/lxc_fuse.h:26,
from ../../src/lxc/lxc_fuse.c:28:
/usr/include/fuse3/fuse.h:948:6: note: declared here
948 | void fuse_unmount(struct fuse *f);
| ^~~~~~~~~~~~
At top level:
../../src/lxc/lxc_fuse.c:254:31: warning: 'lxcProcOper' defined but not used [-Wunused-variable]
254 | static struct fuse_operations lxcProcOper = {
| ^~~~~~~~~~~