summary refs log tree commit diff
path: root/doc/packages/fuse.section.md
diff options
context:
space:
mode:
authorAdam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com>2023-11-08 06:15:46 +0000
committerGitHub <noreply@github.com>2023-11-08 06:15:46 +0000
commitba2ed469c261928415e1121f26bfe96ebbed8a33 (patch)
tree806254c8497062bce2f1d43b4602002290a4ae1a /doc/packages/fuse.section.md
parent4c234ceeb61f6d111bb1db30376cdb4019e56142 (diff)
parent3db5de3ba9909bc8631fe6808638099a5cad0a49 (diff)
downloadnixpkgs-ba2ed469c261928415e1121f26bfe96ebbed8a33.tar
nixpkgs-ba2ed469c261928415e1121f26bfe96ebbed8a33.tar.gz
nixpkgs-ba2ed469c261928415e1121f26bfe96ebbed8a33.tar.bz2
nixpkgs-ba2ed469c261928415e1121f26bfe96ebbed8a33.tar.lz
nixpkgs-ba2ed469c261928415e1121f26bfe96ebbed8a33.tar.xz
nixpkgs-ba2ed469c261928415e1121f26bfe96ebbed8a33.tar.zst
nixpkgs-ba2ed469c261928415e1121f26bfe96ebbed8a33.zip
Merge branch 'master' into staging-next
Diffstat (limited to 'doc/packages/fuse.section.md')
-rw-r--r--doc/packages/fuse.section.md45
1 files changed, 45 insertions, 0 deletions
diff --git a/doc/packages/fuse.section.md b/doc/packages/fuse.section.md
new file mode 100644
index 00000000000..6deea6b5626
--- /dev/null
+++ b/doc/packages/fuse.section.md
@@ -0,0 +1,45 @@
+# FUSE {#sec-fuse}
+
+Some packages rely on
+[FUSE](https://www.kernel.org/doc/html/latest/filesystems/fuse.html) to provide
+support for additional filesystems not supported by the kernel.
+
+In general, FUSE software are primarily developed for Linux but many of them can
+also run on macOS. Nixpkgs supports FUSE packages on macOS, but it requires
+[macFUSE](https://osxfuse.github.io) to be installed outside of Nix. macFUSE
+currently isn't packaged in Nixpkgs mainly because it includes a kernel
+extension, which isn't supported by Nix outside of NixOS.
+
+If a package fails to run on macOS with an error message similar to the
+following, it's a likely sign that you need to have macFUSE installed.
+
+    dyld: Library not loaded: /usr/local/lib/libfuse.2.dylib
+    Referenced from: /nix/store/w8bi72bssv0bnxhwfw3xr1mvn7myf37x-sshfs-fuse-2.10/bin/sshfs
+    Reason: image not found
+    [1]    92299 abort      /nix/store/w8bi72bssv0bnxhwfw3xr1mvn7myf37x-sshfs-fuse-2.10/bin/sshfs
+
+Package maintainers may often encounter the following error when building FUSE
+packages on macOS:
+
+    checking for fuse.h... no
+    configure: error: No fuse.h found.
+
+This happens on autoconf based projects that use `AC_CHECK_HEADERS` or
+`AC_CHECK_LIBS` to detect libfuse, and will occur even when the `fuse` package
+is included in `buildInputs`. It happens because libfuse headers throw an error
+on macOS if the `FUSE_USE_VERSION` macro is undefined. Many projects do define
+`FUSE_USE_VERSION`, but only inside C source files. This results in the above
+error at configure time because the configure script would attempt to compile
+sample FUSE programs without defining `FUSE_USE_VERSION`.
+
+There are two possible solutions for this problem in Nixpkgs:
+
+1. Pass `FUSE_USE_VERSION` to the configure script by adding
+   `CFLAGS=-DFUSE_USE_VERSION=25` in `configureFlags`. The actual value would
+   have to match the definition used in the upstream source code.
+2. Remove `AC_CHECK_HEADERS` / `AC_CHECK_LIBS` for libfuse.
+
+However, a better solution might be to fix the build script upstream to use
+`PKG_CHECK_MODULES` instead. This approach wouldn't suffer from the problem that
+`AC_CHECK_HEADERS`/`AC_CHECK_LIBS` has at the price of introducing a dependency
+on pkg-config.