libvirt builds without fuse support when built with libfuse3-dev

Bug #1935664 reported by Graham Inggs
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt
New
Unknown
libvirt (Ubuntu)
Invalid
Wishlist
Unassigned

Bug Description

Fuse3 is a requirement for qemu 6 (LP: #1934510). Since we don't want to support two versions of fuse in main, we'd like reverse-dependencies of fuse to switch to fuse3.

libvirt built successfully in a test rebuild changing the build-dependency on libfuse-dev to libfuse3-dev, but without fuse support.

Excerpt from the build log:

Run-time dependency fuse found: NO (tried pkgconfig and cmake)

Revision history for this message
Graham Inggs (ginggs) wrote :

This is effectively a transition in main, so please don't upload until all of the other affected packages are ready.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Indeed, right now it seems to only support fuse2

libfuse-dev
Run-time dependency fuse found: YES 2.9.9

libfuse3-dev
Run-time dependency fuse found: NO (tried pkgconfig and cmake)

This is only needed for libvirt-lxc which is universe only and strongly discouraged in favor of LXD (much better for the same use case).
Introduced in [1] and not much changed since then it is pre-3.0 as that didn't exist back in 2012 afaik.

I'll file an issue upstream to support fuse3 as I'm convinced it is generally the right thing.
But if this is the last issue holding us back we can as well disable fuse support in ubuntu's libvirt without much consequence for users (libvirt-lxc still works, just some /proc info isn't as isolated)

Note [2] holds transition instructions.
And [3] shows that plenty of upstream projects got bugs filed back then when 3.0 released.
Many of them changed, libvirt didn't get a bug back then and might therefore not be aware yet.

Prio wishlist, since as I said worst-case we can disable it.

[1]: https://libvirt.org/git/?p=libvirt.git;a=commit;h=2a596dac5e00c4fcf750a693fd6174b68188efc3
[2]: https://github.com/libfuse/libfuse/blob/master/ChangeLog.rst#libfuse-300-2016-12-08
[3]: https://letmegooglethat.com/?q=%22This+is+a+maintenance+release+from+the+2.9+branch+of+libfuse.+Users+are+encouraged+to+transition+to+the+actively+developed+libfuse+3.x.%22

Changed in libvirt (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Download full text (6.8 KiB)

I can easily make it pass configure 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'))

But then as you'd expect the actual changes for the new API are needed.

../../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);
      | ^~~~~~~~~~~~
../.....

Read more...

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Graham Inggs (ginggs) wrote :

Sorry, I haven't got my brain around the the main/universe split yet.
Seeing libvirt-daemon-driver-lxc is universe, then it's OK for libvirt to have a build-dependency on libfuse-dev, even if libfuse-dev is demoted. So you wouldn't even need to disable fuse support.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

That is true, but the analysis was worth anyway as was the upstream report.

But indeed for the reason you opened the bug I think we can close it as "invalid" as it isn't needed to get fuse2 out of main.

Changed in libvirt (Ubuntu):
status: Triaged → Invalid
Graham Inggs (ginggs)
summary: - Please switch to fuse3
+ libvirt builds without fuse support when built with libfuse3-dev
Changed in libvirt:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.