Skip to content

Commit e4b141c

Browse files
committed
cargo: move SELinux dependency to target-specific section
1 parent 864b023 commit e4b141c

6 files changed

Lines changed: 16 additions & 6 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,6 @@ itertools.workspace = true
564564
jiff = { workspace = true, optional = true }
565565
phf.workspace = true
566566
regex = { workspace = true, optional = true }
567-
selinux = { workspace = true, optional = true }
568567
textwrap.workspace = true
569568
uucore.workspace = true
570569
zip = { workspace = true, optional = true }
@@ -714,6 +713,7 @@ rstest_reuse.workspace = true
714713

715714
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
716715
rustix.workspace = true
716+
selinux = { workspace = true, optional = true }
717717

718718
# this breaks clippy linting with: "tests/by-util/test_factor_benches.rs: No such file or directory (os error 2)"
719719
# factor_benches = { optional = true, version = "0.0.0", package = "uu_factor_benches", path = "tests/benches/factor" }

src/uu/cp/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ doctest = false
2222
clap = { workspace = true }
2323
filetime = { workspace = true }
2424
libc = { workspace = true }
25-
selinux = { workspace = true, optional = true }
2625
uucore = { workspace = true, features = [
2726
"backup-control",
2827
"buf-copy",
@@ -41,6 +40,9 @@ thiserror = { workspace = true }
4140
fluent = { workspace = true }
4241
rustix = { workspace = true }
4342

43+
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
44+
selinux = { workspace = true, optional = true }
45+
4446
[target.'cfg(unix)'.dependencies]
4547
exacl = { workspace = true, optional = true }
4648
nix = { workspace = true, features = ["fs"] }

src/uu/id/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ doctest = false
2323
clap = { workspace = true }
2424
rustix = { workspace = true }
2525
uucore = { workspace = true, features = ["entries", "process"] }
26-
selinux = { workspace = true, optional = true }
2726
fluent = { workspace = true }
2827

28+
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
29+
selinux = { workspace = true, optional = true }
30+
2931
[[bin]]
3032
name = "id"
3133
path = "src/main.rs"

src/uu/install/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ path = "src/install.rs"
2121
clap = { workspace = true }
2222
filetime = { workspace = true }
2323
file_diff = { workspace = true }
24-
selinux = { workspace = true, optional = true }
2524
thiserror = { workspace = true }
2625
uucore = { workspace = true, default-features = true, features = [
2726
"backup-control",
@@ -34,6 +33,9 @@ uucore = { workspace = true, default-features = true, features = [
3433
] }
3534
fluent = { workspace = true }
3635

36+
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
37+
selinux = { workspace = true, optional = true }
38+
3739
[features]
3840
selinux = ["dep:selinux", "uucore/selinux"]
3941

src/uu/ls/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ clap = { workspace = true, features = ["env"] }
2626
glob = { workspace = true }
2727
lscolors = { workspace = true }
2828
rustc-hash = { workspace = true }
29-
selinux = { workspace = true, optional = true }
3029
terminal_size = { workspace = true }
3130
thiserror = { workspace = true }
3231
uucore = { workspace = true, features = [
@@ -45,6 +44,9 @@ uucore = { workspace = true, features = [
4544
uutils_term_grid = { workspace = true }
4645
fluent = { workspace = true }
4746

47+
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
48+
selinux = { workspace = true, optional = true }
49+
4850
# hostname crate does not support WASI (no OS-level hostname API)
4951
[target.'cfg(not(target_os = "wasi"))'.dependencies]
5052
hostname = { workspace = true }

src/uucore/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ sm3 = { workspace = true, optional = true }
6767
crc-fast = { workspace = true, optional = true, features = ["std"] }
6868
bigdecimal = { workspace = true, optional = true }
6969
num-traits = { workspace = true, optional = true }
70-
selinux = { workspace = true, optional = true }
7170

7271
# icu stuff
7372
icu_calendar = { workspace = true, optional = true, features = [
@@ -95,6 +94,9 @@ thiserror = { workspace = true }
9594
[dev-dependencies]
9695
tempfile = { workspace = true }
9796

97+
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
98+
selinux = { workspace = true, optional = true }
99+
98100
[target.'cfg(unix)'.dependencies]
99101
nix = { workspace = true, features = [
100102
"dir",

0 commit comments

Comments
 (0)