Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass USE_FUSE2 define to apfs-fuse build under macOS #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

msbit
Copy link

@msbit msbit commented Oct 9, 2020

On my mac, with the lastest OSXFUSE version (3.11.2), the version of FUSE that is installed is actually 2.9.7:

$ pkg-config --modversion osxfuse
2.9.7
$ pkg-config --modversion fuse
2.9.7

so compiling apfs-fuse without defining USE_FUSE2 breaks with the following output (which is the same as for #118):

[ 93%] Building CXX object CMakeFiles/apfs-fuse.dir/apfsfuse/ApfsFuse.cpp.o
/Volumes/sensitive/apfs-fuse/apfsfuse/ApfsFuse.cpp:671:38: warning: unused parameter 'data' [-Wunused-parameter]
static int apfs_parse_fuse_opt(void *data, const char *arg, int key, struct fuse_args* outargs)
                                     ^
/Volumes/sensitive/apfs-fuse/apfsfuse/ApfsFuse.cpp:671:88: warning: unused parameter 'outargs' [-Wunused-parameter]
static int apfs_parse_fuse_opt(void *data, const char *arg, int key, struct fuse_args* outargs)
                                                                                       ^
/Volumes/sensitive/apfs-fuse/apfsfuse/ApfsFuse.cpp:927:7: error: no matching function for call to 'fuse_session_new'
        se = fuse_session_new(&args, &ops, sizeof(ops), nullptr);
             ^~~~~~~~~~~~~~~~
/usr/local/include/osxfuse/fuse/fuse_lowlevel.h:1646:22: note: candidate function not viable: requires 2 arguments, but 4 were provided
struct fuse_session *fuse_session_new(struct fuse_session_ops *op, void *data);
                     ^
/Volumes/sensitive/apfs-fuse/apfsfuse/ApfsFuse.cpp:932:8: error: use of undeclared identifier 'fuse_session_mount'; did you mean 'fuse_session_ops'?
                        if (fuse_session_mount(se, mountpoint) == 0)
                            ^
/usr/local/include/osxfuse/fuse/fuse_lowlevel.h:1603:8: note: 'fuse_session_ops' declared here
struct fuse_session_ops {
       ^
/Volumes/sensitive/apfs-fuse/apfsfuse/ApfsFuse.cpp:939:5: error: use of undeclared identifier 'fuse_session_unmount'
                                fuse_session_unmount(se);
                                ^
2 warnings and 3 errors generated.
make[2]: *** [CMakeFiles/apfs-fuse.dir/apfsfuse/ApfsFuse.cpp.o] Error 1
make[1]: *** [CMakeFiles/apfs-fuse.dir/all] Error 2
make: *** [all] Error 2

The fix here is to specify the same target_compile_definitions for builds with APPLE defined as for those without USE_FUSE3=ON would otherwise.

As the OSXFUSE version of FUSE is v2, add the same call to
`target_compile_definitions` in the check for `APPLE` as for the
check against `USE_FUSE2` when `APPLE` isn't defined
@torarnv
Copy link

torarnv commented Jun 30, 2021

Just hit this issue, and PR fixes it. Please merge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants