1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #8027 from cakebaker/cargo_toml_remove_procfs_dependency

Cargo.toml: remove `procfs` dependency & adapt `cp` test
This commit is contained in:
Sylvestre Ledru 2025-06-02 10:17:13 +02:00 committed by GitHub
commit 7b41a160b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 62 deletions

54
Cargo.lock generated
View file

@ -457,7 +457,6 @@ dependencies = [
"phf", "phf",
"phf_codegen", "phf_codegen",
"pretty_assertions", "pretty_assertions",
"procfs",
"rand 0.9.1", "rand 0.9.1",
"regex", "regex",
"rlimit", "rlimit",
@ -686,7 +685,7 @@ dependencies = [
"filedescriptor", "filedescriptor",
"mio", "mio",
"parking_lot", "parking_lot",
"rustix 1.0.1", "rustix",
"signal-hook", "signal-hook",
"signal-hook-mio", "signal-hook-mio",
"winapi", "winapi",
@ -1444,12 +1443,6 @@ dependencies = [
"zlib-rs", "zlib-rs",
] ]
[[package]]
name = "linux-raw-sys"
version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"
version = "0.9.4" version = "0.9.4"
@ -1912,28 +1905,6 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "procfs"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f"
dependencies = [
"bitflags 2.9.0",
"hex",
"procfs-core",
"rustix 0.38.44",
]
[[package]]
name = "procfs-core"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec"
dependencies = [
"bitflags 2.9.0",
"hex",
]
[[package]] [[package]]
name = "quick-error" name = "quick-error"
version = "2.0.1" version = "2.0.1"
@ -2149,19 +2120,6 @@ dependencies = [
"semver", "semver",
] ]
[[package]]
name = "rustix"
version = "0.38.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
dependencies = [
"bitflags 2.9.0",
"errno",
"libc",
"linux-raw-sys 0.4.15",
"windows-sys 0.59.0",
]
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "1.0.1" version = "1.0.1"
@ -2171,7 +2129,7 @@ dependencies = [
"bitflags 2.9.0", "bitflags 2.9.0",
"errno", "errno",
"libc", "libc",
"linux-raw-sys 0.9.4", "linux-raw-sys",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@ -2415,7 +2373,7 @@ dependencies = [
"fastrand", "fastrand",
"getrandom 0.3.1", "getrandom 0.3.1",
"once_cell", "once_cell",
"rustix 1.0.1", "rustix",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@ -2425,7 +2383,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed"
dependencies = [ dependencies = [
"rustix 1.0.1", "rustix",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@ -2794,7 +2752,7 @@ dependencies = [
"filetime", "filetime",
"indicatif", "indicatif",
"libc", "libc",
"linux-raw-sys 0.9.4", "linux-raw-sys",
"quick-error", "quick-error",
"selinux", "selinux",
"uucore", "uucore",
@ -4168,7 +4126,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e"
dependencies = [ dependencies = [
"libc", "libc",
"rustix 1.0.1", "rustix",
] ]
[[package]] [[package]]

View file

@ -1,7 +1,7 @@
# coreutils (uutils) # coreutils (uutils)
# * see the repository LICENSE, README, and CONTRIBUTING files for more information # * see the repository LICENSE, README, and CONTRIBUTING files for more information
# spell-checker:ignore (libs) bigdecimal datetime serde bincode gethostid kqueue libselinux mangen memmap procfs uuhelp startswith constness expl # spell-checker:ignore (libs) bigdecimal datetime serde bincode gethostid kqueue libselinux mangen memmap uuhelp startswith constness expl
[package] [package]
name = "coreutils" name = "coreutils"
@ -526,9 +526,6 @@ hex-literal = "1.0.0"
rstest = { workspace = true } rstest = { workspace = true }
ctor = "0.4.1" ctor = "0.4.1"
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dev-dependencies]
procfs = { version = "0.17", default-features = false }
[target.'cfg(unix)'.dev-dependencies] [target.'cfg(unix)'.dev-dependencies]
nix = { workspace = true, features = ["process", "signal", "user", "term"] } nix = { workspace = true, features = ["process", "signal", "user", "term"] }
rlimit = "0.10.1" rlimit = "0.10.1"

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
// spell-checker:ignore (flags) reflink (fs) tmpfs (linux) rlimit Rlim NOFILE clob btrfs neve ROOTDIR USERDIR procfs outfile uufs xattrs // spell-checker:ignore (flags) reflink (fs) tmpfs (linux) rlimit Rlim NOFILE clob btrfs neve ROOTDIR USERDIR outfile uufs xattrs
// spell-checker:ignore bdfl hlsl IRWXO IRWXG nconfined matchpathcon libselinux-devel // spell-checker:ignore bdfl hlsl IRWXO IRWXG nconfined matchpathcon libselinux-devel
use uucore::display::Quotable; use uucore::display::Quotable;
use uutests::util::TestScenario; use uutests::util::TestScenario;
@ -2556,22 +2556,21 @@ fn test_cp_reflink_insufficient_permission() {
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
#[test] #[test]
fn test_closes_file_descriptors() { fn test_closes_file_descriptors() {
use procfs::process::Process;
use rlimit::Resource; use rlimit::Resource;
let me = Process::myself().unwrap();
let pid = std::process::id();
let fd_path = format!("/proc/{pid}/fd");
// The test suite runs in parallel, we have pipe, sockets // The test suite runs in parallel, we have pipe, sockets
// opened by other tests. // opened by other tests.
// So, we take in account the various fd to increase the limit // So, we take in account the various fd to increase the limit
let number_file_already_opened: u64 = me.fd_count().unwrap().try_into().unwrap(); let number_file_already_opened: u64 = std::fs::read_dir(fd_path)
.unwrap()
.count()
.try_into()
.unwrap();
let limit_fd: u64 = number_file_already_opened + 9; let limit_fd: u64 = number_file_already_opened + 9;
// For debugging purposes:
for f in me.fd().unwrap() {
let fd = f.unwrap();
println!("{fd:?} {:?}", fd.mode());
}
new_ucmd!() new_ucmd!()
.arg("-r") .arg("-r")
.arg("--reflink=auto") .arg("--reflink=auto")