Sherlock-Holo / fuse3

an async version fuse library for rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Latest version doesn't build on Debian 11

xfbs opened this issue · comments

Reproduction steps:

  1. Install debian:11 (you can try this in docker)
  2. Install rust (rustup) version 1.63.0
  3. Create an empty crate with fuse3 (either v5.0 or the latest from git) and the tokio-runtime features
  4. Build

Error:

error[E0425]: cannot find function `getuid` in module `unistd`
   --> /home/patrick/.cargo/git/checkouts/fuse3-ea5edbf459049c77/0466328/src/mount_options.rs:217:52
    |
217 |                 self.uid.unwrap_or_else(|| unistd::getuid().as_raw())
    |                                                    ^^^^^^
    |
   ::: /home/patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.25.0/src/unistd.rs:662:1
    |
662 | pub fn getcwd() -> Result<PathBuf> {
    | ---------------------------------- similarly named function `getcwd` defined here
    |
help: a function with a similar name exists
    |
217 |                 self.uid.unwrap_or_else(|| unistd::getcwd().as_raw())
    |                                                    ~~~~~~
help: consider importing this function
    |
1   | use libc::getuid;
    |
help: if you import `getuid`, refer to it directly
    |
217 -                 self.uid.unwrap_or_else(|| unistd::getuid().as_raw())
217 +                 self.uid.unwrap_or_else(|| getuid().as_raw())
    |

error[E0425]: cannot find function `getgid` in module `unistd`
   --> /home/patrick/.cargo/git/checkouts/fuse3-ea5edbf459049c77/0466328/src/mount_options.rs:221:52
    |
221 |                 self.gid.unwrap_or_else(|| unistd::getgid().as_raw())
    |                                                    ^^^^^^
    |
   ::: /home/patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.25.0/src/unistd.rs:662:1
    |
662 | pub fn getcwd() -> Result<PathBuf> {
    | ---------------------------------- similarly named function `getcwd` defined here
    |
help: a function with a similar name exists
    |
221 |                 self.gid.unwrap_or_else(|| unistd::getcwd().as_raw())
    |                                                    ~~~~~~
help: consider importing this function
    |
1   | use libc::getgid;
    |
help: if you import `getgid`, refer to it directly
    |
221 -                 self.gid.unwrap_or_else(|| unistd::getgid().as_raw())
221 +                 self.gid.unwrap_or_else(|| getgid().as_raw())
    |

For more information about this error, try `rustc --explain E0425`.
error: could not compile `fuse3` due to 2 previous errors

the problem should be getuid need user feature in nix, however fuse3 doesn't enable this feature
i will fix it in a few days, or maybe you can create a PR to enable user feature?

@xfbs the 0.5.1 is released, please try it and let me know if problem still exists :)

Works for me! thank you very much.