cberner / fuser

Filesystem in Userspace (FUSE) for Rust
MIT License
835 stars 114 forks source link

Improve error message when /dev/fuse isn't available #250

Open flokli opened 1 year ago

flokli commented 1 year ago

I wrote some unit tests that run some code using this crate. It worked so far, but when moving this into a sandboxed build, by building it with Nix, I got the following errors:

thread 'fuse::tests::mount' panicked at 'must succeed: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/fuse/tests.rs:43:70
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

There's multiple reasons on why this ultimately won't be possible (mostly due to how the sandbox sets up things), but the NotFound got me on a wrong path, I assumed the tempdir I'm using wasn't populated for some reason.

However it might have been either /dev/fuse or fusermount3 not being present.

It'd be nice if the error message could carry some info about what it is NotFound here. (/dev/fuse, fusermount binary, …)