Skip to content

error[E0433]: failed to resolve: could not find 'mount' in 'backend' #1193

@polarathene

Description

@polarathene

TL;DR: I think this was meant to be removed from lib.rs with this Sep 2024 PR, but was missed?

rustix/src/lib.rs

Lines 296 to 300 in ec96121

// Temporarily provide some mount functions for use in the fs module for
// backwards compatibility.
#[cfg(linux_kernel)]
#[cfg(all(feature = "fs", not(feature = "mount")))]
pub(crate) mod mount;


I wanted to try the recently implemented select method, and realized it's not available in a release yet, so I switched to git for rustix:

rustix = { git = "https://github.com/bytecodealliance/rustix.git", features = ["procfs", "event"] }

Compiling fails however due to various errors about the backend lacking the mount module (All errors are from src/mount/ files referring to the backend mount module):

error[E0433]: failed to resolve: could not find `mount` in `backend`
  --> /root/.cargo/git/checkouts/rustix-8fafe793515fde97/ec96121/src/mount/fsopen.rs:3:21
   |
3  | use crate::backend::mount::types::{
   |                     ^^^^^ could not find `mount` in `backend`
   |
note: found an item that was configured out
  --> /root/.cargo/git/checkouts/rustix-8fafe793515fde97/ec96121/src/backend/linux_raw/mod.rs:49:16
   |
49 | pub(crate) mod mount;
   |                ^^^^^
note: the item is gated behind the `mount` feature
  --> /root/.cargo/git/checkouts/rustix-8fafe793515fde97/ec96121/src/backend/linux_raw/mod.rs:48:7
   |
48 | #[cfg(feature = "mount")]
   |       ^^^^^^^^^^^^^^^^^

The fs feature is implicitly enabled from procfs feature (so lib.rs then enables the mount module):

rustix/Cargo.toml

Lines 161 to 162 in ec96121

# Enable this to enable `rustix::io::proc_self_*` (on Linux) and `ttyname`.
procfs = ["once_cell", "itoa", "fs"]

Context

NOTE: This comment line was removed, not sure if that context was intended to be dropped along with the deprecation comment above it.

Config attributes for mod mount:

rustix/src/lib.rs

Lines 217 to 220 in ec96121

#[cfg(linux_kernel)]
#[cfg(feature = "mount")]
#[cfg_attr(docsrs, doc(cfg(feature = "mount")))]
pub mod mount;

rustix/src/lib.rs

Lines 296 to 300 in ec96121

// Temporarily provide some mount functions for use in the fs module for
// backwards compatibility.
#[cfg(linux_kernel)]
#[cfg(all(feature = "fs", not(feature = "mount")))]
pub(crate) mod mount;

rustix/src/lib.rs

Lines 176 to 180 in ec96121

// Pick the backend implementation to use.
#[cfg_attr(libc, path = "backend/libc/mod.rs")]
#[cfg_attr(linux_raw, path = "backend/linux_raw/mod.rs")]
#[cfg_attr(wasi, path = "backend/wasi/mod.rs")]
mod backend;

#[cfg(feature = "mount")]
pub(crate) mod mount;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions