Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
polarathene opened this issue Oct 20, 2024 · 1 comment · Fixed by #1194
Closed

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

polarathene opened this issue Oct 20, 2024 · 1 comment · Fixed by #1194

Comments

@polarathene
Copy link
Contributor

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;

@polarathene polarathene changed the title error[E0433]: failed to resolve: could not find mount in backend`` error[E0433]: failed to resolve: could not find mount in backend` Oct 20, 2024
@polarathene polarathene changed the title error[E0433]: failed to resolve: could not find mount in backend` error[E0433]: failed to resolve: could not find mount in \backend\`` Oct 20, 2024
@polarathene polarathene changed the title error[E0433]: failed to resolve: could not find mount in \backend\`` error[E0433]: failed to resolve: could not find mount in 'backend' Oct 20, 2024
@polarathene polarathene changed the title error[E0433]: failed to resolve: could not find mount in 'backend' error[E0433]: failed to resolve: could not find 'mount' in 'backend' Oct 20, 2024
@sunfishcode
Copy link
Member

Thanks for tracking this down!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants