diff --git a/Cargo.toml b/Cargo.toml index 37f40ad8b..25af7527a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -564,7 +564,6 @@ itertools.workspace = true jiff = { workspace = true, optional = true } phf.workspace = true regex = { workspace = true, optional = true } -selinux = { workspace = true, optional = true } textwrap.workspace = true uucore.workspace = true zip = { workspace = true, optional = true } @@ -714,6 +713,7 @@ rstest_reuse.workspace = true [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] rustix.workspace = true +selinux = { workspace = true, optional = true } # this breaks clippy linting with: "tests/by-util/test_factor_benches.rs: No such file or directory (os error 2)" # factor_benches = { optional = true, version = "0.0.0", package = "uu_factor_benches", path = "tests/benches/factor" } diff --git a/src/uu/cp/Cargo.toml b/src/uu/cp/Cargo.toml index a184ee887..1d248b9e9 100644 --- a/src/uu/cp/Cargo.toml +++ b/src/uu/cp/Cargo.toml @@ -22,7 +22,6 @@ doctest = false clap = { workspace = true } filetime = { workspace = true } libc = { workspace = true } -selinux = { workspace = true, optional = true } uucore = { workspace = true, features = [ "backup-control", "buf-copy", @@ -41,6 +40,9 @@ thiserror = { workspace = true } fluent = { workspace = true } rustix = { workspace = true } +[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] +selinux = { workspace = true, optional = true } + [target.'cfg(unix)'.dependencies] exacl = { workspace = true, optional = true } nix = { workspace = true, features = ["fs"] } diff --git a/src/uu/id/Cargo.toml b/src/uu/id/Cargo.toml index 7fcdc64c0..3890aadc9 100644 --- a/src/uu/id/Cargo.toml +++ b/src/uu/id/Cargo.toml @@ -23,9 +23,11 @@ doctest = false clap = { workspace = true } rustix = { workspace = true } uucore = { workspace = true, features = ["entries", "process"] } -selinux = { workspace = true, optional = true } fluent = { workspace = true } +[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] +selinux = { workspace = true, optional = true } + [[bin]] name = "id" path = "src/main.rs" diff --git a/src/uu/install/Cargo.toml b/src/uu/install/Cargo.toml index 229fd06b4..d4f8b52bf 100644 --- a/src/uu/install/Cargo.toml +++ b/src/uu/install/Cargo.toml @@ -21,7 +21,6 @@ path = "src/install.rs" clap = { workspace = true } filetime = { workspace = true } file_diff = { workspace = true } -selinux = { workspace = true, optional = true } thiserror = { workspace = true } uucore = { workspace = true, default-features = true, features = [ "backup-control", @@ -34,6 +33,9 @@ uucore = { workspace = true, default-features = true, features = [ ] } fluent = { workspace = true } +[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] +selinux = { workspace = true, optional = true } + [features] selinux = ["dep:selinux", "uucore/selinux"] diff --git a/src/uu/ls/Cargo.toml b/src/uu/ls/Cargo.toml index dfe7f2110..260743a1f 100644 --- a/src/uu/ls/Cargo.toml +++ b/src/uu/ls/Cargo.toml @@ -26,7 +26,6 @@ clap = { workspace = true, features = ["env"] } glob = { workspace = true } lscolors = { workspace = true } rustc-hash = { workspace = true } -selinux = { workspace = true, optional = true } terminal_size = { workspace = true } thiserror = { workspace = true } uucore = { workspace = true, features = [ @@ -45,6 +44,9 @@ uucore = { workspace = true, features = [ uutils_term_grid = { workspace = true } fluent = { workspace = true } +[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] +selinux = { workspace = true, optional = true } + # hostname crate does not support WASI (no OS-level hostname API) [target.'cfg(not(target_os = "wasi"))'.dependencies] hostname = { workspace = true } diff --git a/src/uucore/Cargo.toml b/src/uucore/Cargo.toml index da2c1b903..c34d5fae0 100644 --- a/src/uucore/Cargo.toml +++ b/src/uucore/Cargo.toml @@ -67,7 +67,6 @@ sm3 = { workspace = true, optional = true } crc-fast = { workspace = true, optional = true, features = ["std"] } bigdecimal = { workspace = true, optional = true } num-traits = { workspace = true, optional = true } -selinux = { workspace = true, optional = true } # icu stuff icu_calendar = { workspace = true, optional = true, features = [ @@ -95,6 +94,9 @@ thiserror = { workspace = true } [dev-dependencies] tempfile = { workspace = true } +[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] +selinux = { workspace = true, optional = true } + [target.'cfg(unix)'.dependencies] nix = { workspace = true, features = [ "dir",