Skip to content

Fails to compile on MacOS #49

Description

@mouse07410

MacOS Tahoe 26.2, Xcode-16.4, Rust-1.92.0.

Current master fuse-mt fails to compile, failing on fuser v0.16.0:

$ cargo build && cargo test
    Updating crates.io index
     Locking 22 packages to latest compatible versions
   Compiling proc-macro2 v1.0.105
   Compiling libc v0.2.180
   Compiling unicode-ident v1.0.22
   Compiling quote v1.0.43
   Compiling cfg_aliases v0.2.1
   Compiling nix v0.29.0
   Compiling zerocopy v0.8.33
   Compiling cfg-if v1.0.4
   Compiling fuser v0.16.0
   Compiling bitflags v2.10.0
error: failed to run custom build command for `fuser v0.16.0`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/Users/ur20980/src/fuse-mt/target/debug/build/fuser-d842f8b222bdd6e3/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-check-cfg=cfg(fuser_mount_impl, values("pure-rust", "libfuse2", "libfuse3"))

  --- stderr

  thread 'main' (4230807) panicked at /Users/ur20980/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/fuser-0.16.0/build.rs:9:5:
  not implemented: Building without libfuse is only supported on Linux
  stack backtrace:
     0: __rustc::rust_begin_unwind
               at /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/std/src/panicking.rs:698:5
     1: core::panicking::panic_fmt
               at /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/panicking.rs:80:14
     2: build_script_build::main
     3: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...

But now, https://github.com/cberner/fuser.git has been fixed - compiles and passes all the tests on MacOS - see cberner/fuser#450.

Changing your Cargo.toml to use fuser master instead of released v0.16.0

diff --git a/Cargo.toml b/Cargo.toml
index 46743dd..906ca56 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,7 +11,7 @@ readme = "README.md"
 edition = "2018"
 
 [dependencies]
-fuser = "0.16"
+fuser = { git = "https://github.com/cberner/fuser.git", branch="master" }
 libc = "0.2"
 log = "0.4"
 threadpool = "1.8"

leads to the following problem:

$ cargo build && cargo test
    Updating git repository `https://github.com/cberner/fuser.git`
remote: Enumerating objects: 84, done.
remote: Counting objects: 100% (65/65), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 84 (delta 41), reused 34 (delta 30), pack-reused 19 (from 1)
Unpacking objects: 100% (84/84), 84.92 KiB | 653.00 KiB/s, done.
From https://github.com/cberner/fuser
   16bd1c3..4e1afbc  master     -> origin/master
    Updating crates.io index
     Locking 20 packages to latest compatible versions
      Adding autocfg v1.5.0
      Adding equivalent v1.0.2
      Adding fuser v0.16.0 (https://github.com/cberner/fuser.git?branch=master#4e1afbcf)
      Adding hashbrown v0.16.1
      Adding indexmap v2.13.0
      Adding memoffset v0.9.1
    Updating nix v0.29.0 -> v0.30.1
      Adding num_enum v0.7.5
      Adding num_enum_derive v0.7.5
      Adding pkg-config v0.3.32
      Adding proc-macro-crate v3.4.0
      Adding ref-cast v1.0.25
      Adding ref-cast-impl v1.0.25
      Adding rustversion v1.0.22
      Adding serde_core v1.0.228
      Adding serde_derive v1.0.228
      Adding toml_datetime v0.7.5+spec-1.1.0
      Adding toml_edit v0.23.10+spec-1.0.0
      Adding toml_parser v1.0.6+spec-1.1.0
      Adding winnow v0.7.14
   Compiling proc-macro2 v1.0.105
   Compiling unicode-ident v1.0.22
   Compiling quote v1.0.43
   Compiling libc v0.2.180
   Compiling equivalent v1.0.2
   Compiling hashbrown v0.16.1
   Compiling winnow v0.7.14
   Compiling indexmap v2.13.0
   Compiling toml_datetime v0.7.5+spec-1.1.0
   Compiling syn v2.0.114
   Compiling autocfg v1.5.0
   Compiling rustversion v1.0.22
   Compiling cfg_aliases v0.2.1
   Compiling memoffset v0.9.1
   Compiling nix v0.30.1
   Compiling toml_parser v1.0.6+spec-1.1.0
   Compiling ref-cast v1.0.25
   Compiling zerocopy v0.8.33
   Compiling toml_edit v0.23.10+spec-1.0.0
   Compiling pkg-config v0.3.32
   Compiling fuser v0.16.0 (https://github.com/cberner/fuser.git?branch=master#4e1afbcf)
   Compiling proc-macro-crate v3.4.0
   Compiling bitflags v2.10.0
   Compiling cfg-if v1.0.4
   Compiling page_size v0.6.0
   Compiling num_cpus v1.17.0
   Compiling log v0.4.29
   Compiling memchr v2.7.6
   Compiling smallvec v1.15.1
   Compiling threadpool v1.8.1
   Compiling num_enum_derive v0.7.5
   Compiling zerocopy-derive v0.8.33
   Compiling ref-cast-impl v1.0.25
   Compiling num_enum v0.7.5
   Compiling fuse_mt v0.6.3 (/Users/ur20980/src/fuse-mt)
error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
  --> src/fusemt.rs:23:37
   |
23 | impl<'a> IntoRequestInfo for fuser::Request<'a> {
   |                                     ^^^^^^^---- help: remove the unnecessary generics
   |                                     |
   |                                     expected 0 lifetime arguments
   |
note: struct defined here, with 0 lifetime parameters
  --> /Users/ur20980/.cargo/git/checkouts/fuser-363b66cea860d9b9/4e1afbc/src/request_param.rs:10:12
   |
10 | pub struct Request {
   |            ^^^^^^^

error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
   --> src/fusemt.rs:114:22
    |
114 |         req: &fuser::Request<'_>,
    |                      ^^^^^^^---- help: remove the unnecessary generics
    |                      |
    |                      expected 0 lifetime arguments
    |
note: struct defined here, with 0 lifetime parameters
   --> /Users/ur20980/.cargo/git/checkouts/fuser-363b66cea860d9b9/4e1afbc/src/request_param.rs:10:12
    |
 10 | pub struct Request {
    |            ^^^^^^^

error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
   --> src/fusemt.rs:128:22
    |
.  .  .  .  .
error[E0599]: no method named `info` found for reference `&fuser::Request` in the current scope
   --> src/fusemt.rs:858:41
    |
858 |         match self.target.getxtimes(req.info(), &path) {
    |                                         ^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `IntoRequestInfo` defines an item `info`, perhaps you need to implement it
   --> src/fusemt.rs:19:1
    |
 19 | trait IntoRequestInfo {
    | ^^^^^^^^^^^^^^^^^^^^^
help: there is a method `into` with a similar name
    |
858 -         match self.target.getxtimes(req.info(), &path) {
858 +         match self.target.getxtimes(req.into(), &path) {
    |

error[E0308]: mismatched types
   --> src/fusemt.rs:862:35
    |
862 |             Err(e) => reply.error(e),
    |                             ----- ^ expected `Errno`, found `i32`
    |                             |
    |                             arguments to this method are incorrect
    |
note: method defined here
   --> /Users/ur20980/.cargo/git/checkouts/fuser-363b66cea860d9b9/4e1afbc/src/reply.rs:296:12
    |
296 |     pub fn error(self, err: Errno) {
    |            ^^^^^

Some errors have detailed explanations: E0053, E0107, E0308, E0599.
For more information about an error, try `rustc --explain E0053`.
error: could not compile `fuse_mt` (lib) due to 181 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions