diff --git a/src/uu/rm/Cargo.toml b/src/uu/rm/Cargo.toml index 23c840551d1..e1871af2ac5 100644 --- a/src/uu/rm/Cargo.toml +++ b/src/uu/rm/Cargo.toml @@ -15,15 +15,20 @@ readme.workspace = true path = "src/rm.rs" doctest = false -[dependencies] +[target.'cfg(all(unix, not(target_os = "redox")))'.dependencies] +uucore = { workspace = true, features = ["safe-traversal"] } + +[target.'cfg(any(unix, windows, target_os = "wasi"))'.dependencies] clap = { workspace = true } fluent = { workspace = true } indicatif = { workspace = true } thiserror = { workspace = true } uucore = { workspace = true, features = ["fs", "parser", "quoting-style"] } -[target.'cfg(all(unix, not(target_os = "redox")))'.dependencies] -uucore = { workspace = true, features = ["safe-traversal"] } +[target.'cfg(any(unix, windows, target_os = "wasi"))'.dev-dependencies] +divan = { workspace = true } +tempfile = { workspace = true } +uucore = { workspace = true, features = ["benchmark"] } [target.'cfg(unix)'.dependencies] libc = { workspace = true } @@ -31,11 +36,7 @@ libc = { workspace = true } [[bin]] name = "rm" path = "src/main.rs" - -[dev-dependencies] -divan = { workspace = true } -tempfile = { workspace = true } -uucore = { workspace = true, features = ["benchmark"] } +required-features = ["uucore/default"] [lints] workspace = true @@ -43,3 +44,4 @@ workspace = true [[bench]] name = "rm_bench" harness = false +required-features = ["uucore/default"] diff --git a/src/uu/rm/benches/rm_bench.rs b/src/uu/rm/benches/rm_bench.rs index 31b62072a5f..3a888163bea 100644 --- a/src/uu/rm/benches/rm_bench.rs +++ b/src/uu/rm/benches/rm_bench.rs @@ -3,6 +3,8 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. +#![cfg(any(unix, windows, target_os = "wasi"))] + use divan::{Bencher, black_box}; use tempfile::TempDir; use uu_rm::uumain; diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index 63e23f30f62..f95e0f7ca1c 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -5,6 +5,8 @@ // spell-checker:ignore (path) eacces inacc rm-r4 unlinkat fstatat rootlink +#![cfg(any(unix, windows, target_os = "wasi"))] + use clap::builder::{PossibleValue, ValueParser}; use clap::{Arg, ArgAction, Command, parser::ValueSource}; use indicatif::{ProgressBar, ProgressStyle};