Repository navigation
Build against libFUSE 3 on macOS - #577
Conversation
|
The failing This change is the macOS half of the blocker. Windows needs its own compile-time FUSE 2 path, because Dokany's FUSE wrapper is still FUSE 2.7 and there is no libFUSE 3 version of it. That is open as #578. The two are deliberately separate: they rewrite the same file for opposite reasons, macOS to select the FUSE 3 API and Windows to select the FUSE 2 one, and reviewing them together would obscure both. Whichever lands second needs a trivial merge in The interesting signal on this PR is the macOS jobs. Please look at those rather than at the overall red. I have not re-run the Windows jobs, because they fail with a deterministic compile error rather than intermittently. Generated by Claude Code |
|
Pushed The documented minimum is now enforced. The README and ChangeLog say libFUSE >= 3.9, but That floor is deliberately in pkg-config and not in the preprocessor, because libFUSE 3.9.0 ships a stale So
There is a comment in the CMake saying this, because it is the kind of thing someone will later try to "improve" into a header check.
Neither change alters behaviour. CryFS only calls One thing I could not check: macFUSE's On the merge with #578. I resolved it locally to confirm it is trivial: the two changes nest, Generated by Claude Code |
|
Checked the Windows build on The The remaining errors are exactly the five #578 addresses, and no others: That is Generated by Claude Code |
macOS still resolved the pkg-config module 'fuse', which is macFUSE's libFUSE 2.9 API, while the sources are FUSE 3 only. Every macOS job in CI fails at build, with errors like "unknown type name 'fuse_readdir_flags'" and "too many arguments to function call, expected 4, have 5". macFUSE has shipped libFUSE 3 since macFUSE 4.10.0 (March 2025), and the current 5.3.3 carries libFUSE 3.18.2. It installs fuse3.pc, /usr/local/include/fuse3 and libfuse3.4.dylib next to the old libFUSE 2 files, so the fix is to ask for 'fuse3' there as well. Two things ride along. macFUSE replaces six fuse_operations members with macOS specific variants unless FUSE_DARWIN_ENABLE_EXTENSIONS is 0: getattr and readdir take a 'struct fuse_darwin_attr' instead of a 'struct stat', statfs a 'struct statfs' instead of a 'struct statvfs', utimens a timespec[3] instead of a timespec[2], and get/setxattr an extra position argument. params.h turns them off before including <fuse.h>, which is what libFUSE itself does when it builds on macOS. Note that utimens would compile either way, because both array sizes decay to the same pointer type, and would then be handed a three element array. macFUSE installs into /usr/local, which isn't on pkg-config's default search path when pkg-config comes from Homebrew on Apple Silicon, so CMake adds it. If libFUSE 3 still isn't found, the error now names macFUSE and the version that has it instead of just failing the pkg-config check. params.h also refuses a libFUSE 2 header outright, so an old macFUSE produces one clear message instead of a wall of signature mismatches. Windows is exempt from that check, because Dokany's FUSE wrapper is still at FUSE 2.7 and needs a separate compile-time path; this commit does not address Windows. Unmounting needs no change. macFUSE has no fusermount3 and CryFS already calls umount on Apple. Verified by compiling the operations table against macFUSE's own libFUSE 3.18.2 headers with GCC and Clang, at FUSE_USE_VERSION 30, 39, 312 and 317: it fails with exactly the Darwin variant mismatches when the extensions are on, and compiles cleanly with them off. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP
…n 3.9 Two things about versions, both in code this change already touches. The README and the ChangeLog say libFUSE >= 3.9, but nothing enforced it: pkg_check_modules asked for 'fuse3' with no floor, so libFUSE 3.0 would build and link. It now asks for 'fuse3>=3.9'. The floor deliberately lives in pkg-config rather than in a preprocessor check, because libFUSE 3.9.0 ships a stale FUSE_MINOR_VERSION of 2 in its own headers, fixed only in 3.9.1. Verified against a real 3.9.0 install here: its fuse3.pc says 3.9.0 while its fuse_common.h yields FUSE_VERSION == 32, so '#if FUSE_VERSION < FUSE_MAKE_VERSION(3, 9)' rejects exactly the version being required. There is a comment saying so, because it invites being "fixed". FUSE_USE_VERSION was 39. libFUSE changed FUSE_MAKE_VERSION from (major*10 + minor) to (major*100 + minor) in 3.10.0, so on every header released since October 2020, 39 is not 3.9. It is a number that means nothing and merely happens to fall on the right side of each of libFUSE's remaining version guards. It is now 309, which is FUSE_MAKE_VERSION(3, 9) on a modern header and behaves exactly like 39 on an older one. The nicer spelling, FUSE_MAKE_VERSION(3, 9), is not usable here: this header is shared with the Windows build and Dokany's FUSE 2.7 headers have no such macro. Neither change alters behaviour. CryFS only calls fuse_main, and none of libFUSE's three FUSE_USE_VERSION guards (fuse_new, fuse_loop_mt, the ioctl prototype) applies to it. Verified. The pkg-config floor accepts 3.9.0, 3.14.0 and 3.17.2 and rejects 3.4.1. The operations table compiles clean at FUSE_USE_VERSION 309 under GCC and Clang against libFUSE 3.9.0, 3.14.0, 3.17.2 and macFUSE 3.18.2, and the FUSE 2 shape still compiles against Dokany's headers at 309 exactly as at 39. fspp-test passes 1007 tests. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP
I changed this to 309 in the previous commit on the argument that libfuse's
FUSE_MAKE_VERSION switched from (major*10 + minor) to (major*100 + minor) in
3.10.0, so 39 could no longer mean 3.9. That was wrong, and smessmer's review
question was right to push on it.
libfuse did not renumber the versions that already existed. The two-digit
values keep their meaning and the three-digit space starts at 3.10, so the
sequence is 29, 30, ... 39, 310, 311, 312. libfuse 3.17 still writes its own
guards for the old versions as literal 30, 32 and 35, and its own examples
still use 31, 34 and 35, switching to FUSE_MAKE_VERSION only from 3.12 on:
example/hello.c: #define FUSE_USE_VERSION 31
example/hello_ll_uds.c: #define FUSE_USE_VERSION 34
example/ioctl.c: #define FUSE_USE_VERSION 35
example/passthrough_ll.c: #define FUSE_USE_VERSION FUSE_MAKE_VERSION(3, 12)
example/memfs_ll.cc: #define FUSE_USE_VERSION 317
So 39 is the correct spelling for API 3.9, and it is 309 that has no meaning:
it falls in the gap between the two numbering spaces. Both happen to compile
the same today, which is what my measurement showed and why it did not catch
the mistake, but 39 is the value libfuse actually defines.
The pkg-config floor from the previous commit is unaffected and stays.
Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP
1e51325 to
048265a
Compare
Every run had three checks that could never finish. GitHub retired the windows-2019 runner image, so jobs asking for it are never picked up: they sit queued until they expire. On #577 the three windows-2019 jobs were still queued after more than four hours, while all 127 other jobs in the same run, including the three windows-2022 ones, had completed - those finished in about five minutes. GitHub's runner-images README no longer lists windows-2019 at all; the Windows images it offers are windows-2022, windows-2025, windows-2025-vs2026, windows-11-arm and windows-11-vs2026-arm. The effect was that no pull request in this repository could ever reach "all checks passed", which made every red-or-green judgement on a pull request a manual exercise in ignoring three permanently pending checks. The compiler version stops being conditional at the same time. It selected the Visual Studio 2019 toolset (192) for windows-2019 and 194 for windows-2022. With one image left the condition is always true, and leaving it in place would silently hand 192 to any runner image added to this matrix later. It is now the literal 194, which is what windows-2022 already resolved to, so nothing changes for the jobs that do run. Deliberately not included: - windows-2025 is not added in its place. It would be new, never-exercised coverage (Dokany install, MSVC toolset, conan profile), and adding it here would risk turning a change that makes CI honest into one that makes it red. Worth doing separately if a second Windows image is wanted. - The "Requires Visual Studio 2019/2022" line in AGENTS.md is left alone. Dropping a runner removes CI coverage, not support, and narrowing the claimed support matrix is a project decision rather than a CI repair. The CPack step keeps its windows-2022 condition, which is redundant with a single image but still expresses that packaging happens on that one image and not on any that might be added. Verified the workflow still parses, the windows matrix now resolves to 3 jobs instead of 6, and both job definitions and all triggers are unchanged. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP
* Drop the retired windows-2019 runner from CI Every run had three checks that could never finish. GitHub retired the windows-2019 runner image, so jobs asking for it are never picked up: they sit queued until they expire. On #577 the three windows-2019 jobs were still queued after more than four hours, while all 127 other jobs in the same run, including the three windows-2022 ones, had completed - those finished in about five minutes. GitHub's runner-images README no longer lists windows-2019 at all; the Windows images it offers are windows-2022, windows-2025, windows-2025-vs2026, windows-11-arm and windows-11-vs2026-arm. The effect was that no pull request in this repository could ever reach "all checks passed", which made every red-or-green judgement on a pull request a manual exercise in ignoring three permanently pending checks. The compiler version stops being conditional at the same time. It selected the Visual Studio 2019 toolset (192) for windows-2019 and 194 for windows-2022. With one image left the condition is always true, and leaving it in place would silently hand 192 to any runner image added to this matrix later. It is now the literal 194, which is what windows-2022 already resolved to, so nothing changes for the jobs that do run. Deliberately not included: - windows-2025 is not added in its place. It would be new, never-exercised coverage (Dokany install, MSVC toolset, conan profile), and adding it here would risk turning a change that makes CI honest into one that makes it red. Worth doing separately if a second Windows image is wanted. - The "Requires Visual Studio 2019/2022" line in AGENTS.md is left alone. Dropping a runner removes CI coverage, not support, and narrowing the claimed support matrix is a project decision rather than a CI repair. The CPack step keeps its windows-2022 condition, which is redundant with a single image but still expresses that packaging happens on that one image and not on any that might be added. Verified the workflow still parses, the windows matrix now resolves to 3 jobs instead of 6, and both job definitions and all triggers are unchanged. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP * Drop the explanatory comments from the CI matrix change Review feedback: the comment explaining why windows-2019 was removed is not needed in the workflow file - the reason belongs in the commit message and the history, not next to the line that no longer exists. Removed it, and trimmed the compiler_version comment down to the one line that documents what 194 actually is. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP --------- Co-authored-by: Claude <[email protected]>
The macOS jobs on this branch were failing to build with 'unknown type name FUSE_OFF_T', because the base branch still resolved pkg-config module 'fuse' on Darwin, which is macFUSE's libFUSE 2.9, so macOS compiled the FUSE 2 code path meant for Dokany. #577 fixed that on the base. Merging it in so CI runs these tests against a base that builds on macOS.
* Drop the retired windows-2019 runner from CI Every run had three checks that could never finish. GitHub retired the windows-2019 runner image, so jobs asking for it are never picked up: they sit queued until they expire. On #577 the three windows-2019 jobs were still queued after more than four hours, while all 127 other jobs in the same run, including the three windows-2022 ones, had completed - those finished in about five minutes. GitHub's runner-images README no longer lists windows-2019 at all; the Windows images it offers are windows-2022, windows-2025, windows-2025-vs2026, windows-11-arm and windows-11-vs2026-arm. The effect was that no pull request in this repository could ever reach "all checks passed", which made every red-or-green judgement on a pull request a manual exercise in ignoring three permanently pending checks. The compiler version stops being conditional at the same time. It selected the Visual Studio 2019 toolset (192) for windows-2019 and 194 for windows-2022. With one image left the condition is always true, and leaving it in place would silently hand 192 to any runner image added to this matrix later. It is now the literal 194, which is what windows-2022 already resolved to, so nothing changes for the jobs that do run. Deliberately not included: - windows-2025 is not added in its place. It would be new, never-exercised coverage (Dokany install, MSVC toolset, conan profile), and adding it here would risk turning a change that makes CI honest into one that makes it red. Worth doing separately if a second Windows image is wanted. - The "Requires Visual Studio 2019/2022" line in AGENTS.md is left alone. Dropping a runner removes CI coverage, not support, and narrowing the claimed support matrix is a project decision rather than a CI repair. The CPack step keeps its windows-2022 condition, which is redundant with a single image but still expresses that packaging happens on that one image and not on any that might be added. Verified the workflow still parses, the windows matrix now resolves to 3 jobs instead of 6, and both job definitions and all triggers are unchanged. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP * Drop the explanatory comments from the CI matrix change Review feedback: the comment explaining why windows-2019 was removed is not needed in the workflow file - the reason belongs in the commit message and the history, not next to the line that no longer exists. Removed it, and trimmed the compiler_version comment down to the one line that documents what 194 actually is. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP --------- Co-authored-by: Claude <[email protected]>
* Build against libFUSE 3 on macOS macOS still resolved the pkg-config module 'fuse', which is macFUSE's libFUSE 2.9 API, while the sources are FUSE 3 only. Every macOS job in CI fails at build, with errors like "unknown type name 'fuse_readdir_flags'" and "too many arguments to function call, expected 4, have 5". macFUSE has shipped libFUSE 3 since macFUSE 4.10.0 (March 2025), and the current 5.3.3 carries libFUSE 3.18.2. It installs fuse3.pc, /usr/local/include/fuse3 and libfuse3.4.dylib next to the old libFUSE 2 files, so the fix is to ask for 'fuse3' there as well. Two things ride along. macFUSE replaces six fuse_operations members with macOS specific variants unless FUSE_DARWIN_ENABLE_EXTENSIONS is 0: getattr and readdir take a 'struct fuse_darwin_attr' instead of a 'struct stat', statfs a 'struct statfs' instead of a 'struct statvfs', utimens a timespec[3] instead of a timespec[2], and get/setxattr an extra position argument. params.h turns them off before including <fuse.h>, which is what libFUSE itself does when it builds on macOS. Note that utimens would compile either way, because both array sizes decay to the same pointer type, and would then be handed a three element array. macFUSE installs into /usr/local, which isn't on pkg-config's default search path when pkg-config comes from Homebrew on Apple Silicon, so CMake adds it. If libFUSE 3 still isn't found, the error now names macFUSE and the version that has it instead of just failing the pkg-config check. params.h also refuses a libFUSE 2 header outright, so an old macFUSE produces one clear message instead of a wall of signature mismatches. Windows is exempt from that check, because Dokany's FUSE wrapper is still at FUSE 2.7 and needs a separate compile-time path; this commit does not address Windows. Unmounting needs no change. macFUSE has no fusermount3 and CryFS already calls umount on Apple. Verified by compiling the operations table against macFUSE's own libFUSE 3.18.2 headers with GCC and Clang, at FUSE_USE_VERSION 30, 39, 312 and 317: it fails with exactly the Darwin variant mismatches when the extensions are on, and compiles cleanly with them off. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP * Enforce the documented libFUSE minimum, and make FUSE_USE_VERSION mean 3.9 Two things about versions, both in code this change already touches. The README and the ChangeLog say libFUSE >= 3.9, but nothing enforced it: pkg_check_modules asked for 'fuse3' with no floor, so libFUSE 3.0 would build and link. It now asks for 'fuse3>=3.9'. The floor deliberately lives in pkg-config rather than in a preprocessor check, because libFUSE 3.9.0 ships a stale FUSE_MINOR_VERSION of 2 in its own headers, fixed only in 3.9.1. Verified against a real 3.9.0 install here: its fuse3.pc says 3.9.0 while its fuse_common.h yields FUSE_VERSION == 32, so '#if FUSE_VERSION < FUSE_MAKE_VERSION(3, 9)' rejects exactly the version being required. There is a comment saying so, because it invites being "fixed". FUSE_USE_VERSION was 39. libFUSE changed FUSE_MAKE_VERSION from (major*10 + minor) to (major*100 + minor) in 3.10.0, so on every header released since October 2020, 39 is not 3.9. It is a number that means nothing and merely happens to fall on the right side of each of libFUSE's remaining version guards. It is now 309, which is FUSE_MAKE_VERSION(3, 9) on a modern header and behaves exactly like 39 on an older one. The nicer spelling, FUSE_MAKE_VERSION(3, 9), is not usable here: this header is shared with the Windows build and Dokany's FUSE 2.7 headers have no such macro. Neither change alters behaviour. CryFS only calls fuse_main, and none of libFUSE's three FUSE_USE_VERSION guards (fuse_new, fuse_loop_mt, the ioctl prototype) applies to it. Verified. The pkg-config floor accepts 3.9.0, 3.14.0 and 3.17.2 and rejects 3.4.1. The operations table compiles clean at FUSE_USE_VERSION 309 under GCC and Clang against libFUSE 3.9.0, 3.14.0, 3.17.2 and macFUSE 3.18.2, and the FUSE 2 shape still compiles against Dokany's headers at 309 exactly as at 39. fspp-test passes 1007 tests. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP * Keep FUSE_USE_VERSION at 39, not 309 I changed this to 309 in the previous commit on the argument that libfuse's FUSE_MAKE_VERSION switched from (major*10 + minor) to (major*100 + minor) in 3.10.0, so 39 could no longer mean 3.9. That was wrong, and smessmer's review question was right to push on it. libfuse did not renumber the versions that already existed. The two-digit values keep their meaning and the three-digit space starts at 3.10, so the sequence is 29, 30, ... 39, 310, 311, 312. libfuse 3.17 still writes its own guards for the old versions as literal 30, 32 and 35, and its own examples still use 31, 34 and 35, switching to FUSE_MAKE_VERSION only from 3.12 on: example/hello.c: #define FUSE_USE_VERSION 31 example/hello_ll_uds.c: #define FUSE_USE_VERSION 34 example/ioctl.c: #define FUSE_USE_VERSION 35 example/passthrough_ll.c: #define FUSE_USE_VERSION FUSE_MAKE_VERSION(3, 12) example/memfs_ll.cc: #define FUSE_USE_VERSION 317 So 39 is the correct spelling for API 3.9, and it is 309 that has no meaning: it falls in the gap between the two numbering spaces. Both happen to compile the same today, which is what my measurement showed and why it did not catch the mistake, but 39 is the value libfuse actually defines. The pkg-config floor from the previous commit is unaffected and stays. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP --------- Co-authored-by: Claude <[email protected]>
This is the macOS half of the blocker from the review: the sources are FUSE 3 only, but CMake still linked the FUSE 2 wrappers on macOS and Windows. Windows is not addressed here and needs a separate change; see the note at the end.
The problem
src/fspp/fuse/CMakeLists.txtresolved the pkg-config modulefuseon Darwin, which is macFUSE's libFUSE 2.9 API, whileFuse.handFuse.cppusefuse_config,fuse_readdir_flags, the three-argumentgetattr, the five-argument filler andFUSE_CAP_*unconditionally. Every macOS job in the branch's CI fails at build:Why macOS can simply move to FUSE 3
macFUSE has shipped libFUSE 3 since macFUSE 4.10.0 (March 2025); the current 5.3.3 carries libFUSE 3.18.2. It installs
fuse3.pc,/usr/local/include/fuse3/andlibfuse3.4.dylibalongside the old libFUSE 2 files, so both APIs coexist and asking forfuse3is enough.brew install --cask macfuse, which CI already uses, installs the official 5.3.3 package.Sources: macFUSE 4.10.0 release notes, 5.3.3 notes,
lib/meson.buildonsupport/libfuse-3.18.What rides along
The Darwin API extensions have to be off. macFUSE replaces six
fuse_operationsmembers with macOS-specific variants unlessFUSE_DARWIN_ENABLE_EXTENSIONSis 0.getattrandreaddirtake astruct fuse_darwin_attrinstead of astruct stat,statfsastruct statfsinstead of astruct statvfs,utimensatimespec[3]instead of atimespec[2], andget/setxattran extra position argument.params.hturns them off before including<fuse.h>, which is what libFUSE itself does when it builds on macOS.utimensis worth calling out: it would compile either way, becausetimespec[2]andtimespec[3]decay to the same pointer type in a function signature. It would then be handed a three-element array. That is a good reason to be explicit rather than to rely on the default.pkg-config needs a hint. macFUSE installs into
/usr/local, which is not on pkg-config's default search path when pkg-config comes from Homebrew on Apple Silicon, and the CI runners aremacos-14,macos-15andmacos-26. CMake now prepends it. If libFUSE 3 is still not found, the error names macFUSE and the version that has it instead of just failing the pkg-config check.A guard for the wrong header.
params.hrefuses a libFUSE 2 header outright, so someone on an older macFUSE gets one clear message rather than a wall of signature mismatches.Unmounting needs no change. macFUSE builds no
fusermount3(its meson build excludesutil/on Darwin, and mounting goes throughMFMount), and CryFS already callsumounton Apple.Verification
macOS cannot be built here, so the operations table was compiled against macFUSE's own libFUSE 3.18.2 headers, fetched from
macfuse/libraryatsupport/libfuse-3.18, with both GCC and Clang:__APPLE__, extensions on (the default)__APPLE__, extensions off (what this change does)With the extensions on, the errors are precisely the three ones expected:
The
#errorguard was checked both ways: it fires against a FUSE 2 header and stays quiet against FUSE 3.Linux is unaffected:
fspp-teststill passes 1007 tests.Windows is still broken
Dokany's FUSE wrapper is still FUSE 2.7 and there is no libFUSE 3 version. Its
dokan_fuse/include/fuse_common.hhardcodesFUSE_MAJOR_VERSION 2/FUSE_MINOR_VERSION 7,getattrhas nofuse_file_info,renamehas noflags,inithas nofuse_config, and there are noFUSE_CAP_*constants at all. dokany#182, asking for a newer FUSE API, has been open since 2016.So Windows needs the compile-time FUSE 2 path that issue #419 describes, and that is a separate change. This one leaves the
_MSC_VERbranch exactly as it was and exempts Windows from the new header check, so nothing here stands in its way.🤖 Generated with Claude Code
https://claude.ai/code/session_015ErTwCwE5TPLj5VL3PDKhP
Generated by Claude Code