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

Improve/define FreeBSD support #173

Closed
bnaylor opened this issue May 24, 2017 · 17 comments
Closed

Improve/define FreeBSD support #173

bnaylor opened this issue May 24, 2017 · 17 comments
Assignees
Labels

Comments

@bnaylor
Copy link
Contributor

bnaylor commented May 24, 2017

Meson wants to use -ldl but this is not required on FreeBSD, that functionality is built into libc.

vagrant@:~/libfuse/build % meson ..
WARNING: You are using 'US-ASCII' which is not a a Unicode-compatible locale.
WARNING: You might see errors if you use UTF-8 strings as filenames, as strings, or as file contents.
WARNING: Please switch to a UTF-8 locale for your platform.
The Meson build system
Version: 0.40.1
Source dir: /home/vagrant/libfuse
Build dir: /home/vagrant/libfuse/build
Build type: native build
Project name: libfuse3
Native c compiler: cc (clang 3.4.1)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Checking for function "fork": YES
Checking for function "fstatat": YES
Checking for function "openat": YES
Checking for function "readlinkat": YES
Checking for function "pipe2": YES
Checking for function "splice": NO
Checking for function "vmsplice": NO
Checking for function "posix_fallocate": YES
Checking for function "fdatasync": NO
Checking for function "utimensat": YES
Checking for function "setxattr": NO
Checking for function "iconv": YES
Checking whether type "struct stat" has member "st_atim": YES
Checking whether type "struct stat" has member "st_atimespec": YES
Configuring config.h using configuration
Dependency threads found: YES

Meson encountered an error in file lib/meson.build, line 20, column 0:
C library 'dl' not found
@Nikratio Nikratio self-assigned this May 24, 2017
@Nikratio Nikratio added the bug label May 24, 2017
@Nikratio
Copy link
Contributor

Thanks for the report! Could you confirm that the commit above fixes the issue (and still results in a working build)?

@bnaylor
Copy link
Contributor Author

bnaylor commented May 24, 2017

It proceeds past the libdl issue but runs into a problem with mntent.h not being found during the build:

2 warnings generated.
[7/59] Compiling c object 'util/fusermount3@exe/util_mount_util.c.o'
FAILED: util/fusermount3@exe/util_mount_util.c.o
cc  '-Iutil/fusermount3@exe' '-Iutil' '-I../util' '-I.' '-I../' '-Ilib' '-I../lib' '-Iinclude' '-I../include' '-Xclang' '-fcolor-diagnostics' '-pipe' '-D_FILE_OFFSET_BITS=64' '-D_REENTRANT' '-DHAVE_CONFIG_H' '-Wall' '-Wextra' '-Wno-sign-compare' '-Wstrict-prototypes' '-Wmissing-declarations' '-Wwrite-strings' '-O2' '-g' '-fno-strict-aliasing' '-MMD' '-MQ' 'util/fusermount3@exe/util_mount_util.c.o' '-MF' 'util/fusermount3@exe/util_mount_util.c.o.d' -o 'util/fusermount3@exe/util_mount_util.c.o' -c util/mount_util.c
util/mount_util.c:24:10: fatal error: 'mntent.h' file not found
#include <mntent.h>

I think the ./configure version of the build on FreeBSD does not build this - since you just can use 'umount'.

@Nikratio
Copy link
Contributor

Hmm. Using fusermount3 is required for e.g. -o auto_unmount to work - but I guess that's just not supported on FreeBSD then.

How do non-privileged mounts work on FreeBSD? Is FUSE only available to root, or is there special fuse support in /bin/mount?

@Nikratio Nikratio reopened this May 24, 2017
@bnaylor
Copy link
Contributor Author

bnaylor commented May 25, 2017

I ran into the auto_unmount issues when testing some of the tests & examples, so yes I think that's not supported. (That was a new option to me.)

fuse: unknown option(s): `-o auto_unmount'

FreeBSD proper has a mount.fuse helper:
https://www.freebsd.org/cgi/man.cgi?query=mount.fuse&sektion=8&manpath=freebsd-release-ports

Going too much further down this path (from just basic compile issues), we may be duplicating effort that the FreeBSD ports maintainers have already taken care of in the fuse port. I'm actually not building this for FreeBSD, but a commercial OS that's based on the FreeBSD kernel, so some of these issues do not strictly apply to me (and I'm not super familiar with any modifications they may have done in the FreeBSD port.)

Not sure how much more time you want to spend on it, or whether it has historically been expected that the reference source would work smoothly out of the box on non-Linux systems. I'm happy to keep plugging at it if you want, though.

@bnaylor
Copy link
Contributor Author

bnaylor commented May 25, 2017

Er, to clarify: all the above is from FreeBSD. That is not my end goal, but it is a useful proxy.

@Nikratio
Copy link
Contributor

I'd be happy to improve support for FreeBSD, or at the very least determine what the current status is. I have never used FreeBSD though, so appreciate any help you can give.

For example, the mount.fuse manpage is actually the one shipped with an older version of libfuse. Would you be able to find out where the mount.fuse binary comes from?

@Nikratio Nikratio changed the title meson build doesn't work on FreeBSD Improve/define FreeBSD support May 25, 2017
@bnaylor
Copy link
Contributor Author

bnaylor commented May 26, 2017

Sure, I can look further into it. It looks like fbsd ports is still on 2.9.5. Does that change the question any?

@Nikratio
Copy link
Contributor

Not really, no :-). Thanks!

@Nikratio
Copy link
Contributor

@bnaylor Did you have a chance to look into this?

@bnaylor
Copy link
Contributor Author

bnaylor commented May 31, 2017

Not yet, sorry. Been a holiday, kind of did non-computer things. Will check it out this week.

@bnaylor
Copy link
Contributor Author

bnaylor commented Jun 6, 2017

I realized that I've been following in fbsd's footsteps as I try to get things working in Ontap - could have saved a little time by tracking these questions down first.

Many 3rd party utilities are provided in FreeBSD via the 'ports' collection, which is an organized set of Makefiles and patches to the stock source that can be fetched and built by end users if the ports collection isn't installed already. For libfuse, here are the patches they're applying to the utils:

https://svn.freebsd.org/ports/head/sysutils/fusefs-libs/files/

@bnaylor
Copy link
Contributor Author

bnaylor commented Jun 8, 2017

But, it looks like mount_fusefs is not coming from the port. There is a separate version that is maintained
alongside the kernel FUSE support: https://github.com/freebsd/freebsd/tree/master/sbin/mount_fusefs

@Nikratio
Copy link
Contributor

Nikratio commented Jun 8, 2017

Thanks! The patches in the port also seem to be mostly about removing stuff that I thought was in there specifically for FreeBSD.

It seems that the best way forward is just to not build fusermount on BSD at all, and rely on the core system to provide it (dropping the auto-unmount feature). Does that make sense?

@bnaylor
Copy link
Contributor Author

bnaylor commented Jun 8, 2017

Yes, it looks like that's what's happening by way of their current system anyway. It is a little confusing (to me, anyway) but I'm sure they have their reasons, and it means you don't need to worry about it.

@Nikratio
Copy link
Contributor

Nikratio commented Aug 3, 2017

I've asked on the freebsd-fs and freebsd-fuse lists for advice just in case.

@Nikratio
Copy link
Contributor

Nikratio commented Aug 6, 2017

All FreeBSD-port specific patches have now been merged. Would anyone be able to test it?

@Nikratio
Copy link
Contributor

Nikratio commented Aug 6, 2017

(please re-open this issue if you encounter any problems).

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

No branches or pull requests

2 participants