fuser icon indicating copy to clipboard operation
fuser copied to clipboard

Executable depends on libfuse3.so

Open nrath-js opened this issue 1 year ago • 3 comments

Building the example "hello.rs" filesystem, I am getting an executable that is dynamically linked against libfuse3:

❯ ldd target/debug/hello
	linux-vdso.so.1 (0x00007ffc6355e000)
	libfuse3.so.3 => /lib64/libfuse3.so.3 (0x00007f85be344000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f85bd600000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f85bd200000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f85bce00000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f85bca00000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f85be000000)

My understanding was that fuser is a pure-rust implementation and only requires libfuse for the "fusermount" command. Why is there a runtime dependency?

I used the following Cargo.toml:

[package]
name = "hello"
version = "0.1.0"
edition = "2021"

[dependencies]
fuser = "0.7"
libc = "0.2.51"
log = "0.4.6"
env_logger = "0.11.3"
clap = { version = "4.4", features = ["cargo", "derive"] }

nrath-js avatar Nov 01 '24 12:11 nrath-js

By default it builds against libfuse. You have to disable the default features

cberner avatar Nov 02 '24 00:11 cberner

Thanks for the quick response! Sorry for being unclear, my question is: when using default features, what is libfuse used for?

nrath-js avatar Nov 04 '24 09:11 nrath-js

There's an answer regarding that topic in README.md:

Except for a single setup (mount) function call and a final teardown (umount) function call to libfuse, everything runs in Rust, and on Linux these calls to libfuse are optional. They can be removed by building without the "libfuse" feature flag.

It's really appreciated if we could get rid from libfuse dependencies on Macs as well, though.

vdudouyt avatar Nov 08 '24 14:11 vdudouyt