The experimental fuse3 support is not complete yet, and fuse3 is new and
still difficult to install on some platforms.
Make it optional at compile time, and default to off.
Signed-off-by: Justin Husted <sigstop@gmail.com>
uuid-dev zlib1g-dev valgrind
Then, just make && make install
uuid-dev zlib1g-dev valgrind
Then, just make && make install
+
+
+-- Experimental features --
+
+Experimental fuse support is currently disabled by default. Fuse support is at
+an early stage and may corrupt your filesystem, so it should only be used for
+testing. To enable, you'll also need to add:
+
+* libfuse3
+
+On debian:
+ apt install -y libfuse3-dev
+
+Then, make using the BCACHEFS_FUSE environment variable:
+
+BCACHEFS_FUSE=1 make &&
+
+
+-- Tests --
+
+Some tests are available to validate the "bcachefs" binary. The tests depend
+on python3 pytest.
+
+On debian:
+ apt install -u python3-pytest
+
+Then, you can run the tests via:
+
+ make check
CFLAGS+=-DCONFIG_BCACHEFS_DEBUG=y
endif
CFLAGS+=-DCONFIG_BCACHEFS_DEBUG=y
endif
-PKGCONFIG_LIBS="blkid uuid liburcu libsodium zlib liblz4 libzstd fuse3"
+PKGCONFIG_LIBS="blkid uuid liburcu libsodium zlib liblz4 libzstd"
+ifdef BCACHEFS_FUSE
+ PKGCONFIG_LIBS+="fuse3"
+ CFLAGS+=-DBCACHEFS_FUSE
+endif
PKGCONFIG_CFLAGS:=$(shell $(PKG_CONFIG) --cflags $(PKGCONFIG_LIBS))
ifeq (,$(PKGCONFIG_CFLAGS))
PKGCONFIG_CFLAGS:=$(shell $(PKG_CONFIG) --cflags $(PKGCONFIG_LIBS))
ifeq (,$(PKGCONFIG_CFLAGS))
if (!strcmp(cmd, "setattr"))
return cmd_setattr(argc, argv);
if (!strcmp(cmd, "setattr"))
return cmd_setattr(argc, argv);
if (!strcmp(cmd, "fusemount"))
return cmd_fusemount(argc, argv);
if (!strcmp(cmd, "fusemount"))
return cmd_fusemount(argc, argv);
if (!strcmp(cmd, "--help")) {
usage();
if (!strcmp(cmd, "--help")) {
usage();
#include <errno.h>
#include <float.h>
#include <getopt.h>
#include <errno.h>
#include <float.h>
#include <getopt.h>
+
+#endif /* BCACHEFS_FUSE */
#
# Tests of the fuse mount functionality.
#
# Tests of the fuse mount functionality.
+pytestmark = pytest.mark.skipif(
+ not util.have_fuse(), reason="bcachefs not built with fuse support.")
+
def test_mount(bfuse):
bfuse.mount()
bfuse.unmount()
def test_mount(bfuse):
bfuse.mount()
bfuse.unmount()
import pytest
import re
import subprocess
import pytest
import re
import subprocess
import tempfile
import threading
import time
import tempfile
import threading
import time
assert self.returncode == 0
assert len(self.stdout) > 0
assert len(self.stderr) == 0
assert self.returncode == 0
assert len(self.stdout) > 0
assert len(self.stderr) == 0
+
+def have_fuse():
+ res = run(BCH_PATH, 'fusemount', valgrind=False)
+ return "Please supply a mountpoint." in res.stdout