diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 4bdf2a8ac36..2334b60aab2 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -11,7 +11,7 @@ env: PROJECT_NAME: coreutils PROJECT_DESC: "Core universal (cross-platform) utilities" PROJECT_AUTH: "uutils" - RUST_MIN_SRV: "1.89" + RUST_MIN_SRV: "1.91" CARGO_INCREMENTAL: "0" # * style job configuration STYLE_FAIL_ON_FAULT: true ## (bool) fail the build if a style job contains a fault (error or warning); may be overridden on a per-job basis diff --git a/Cargo.lock b/Cargo.lock index 3d9cd110f14..3ea2f99984b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1864,9 +1864,9 @@ dependencies = [ [[package]] name = "notify" -version = "8.2.2" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41a04a5f59df9322cc657286dd2d79f90816119b22c5f847607c850110205ab" +checksum = "5482d5bd11b91a337521980e5d52fe115bdccfb4c217099daaf0abd69159dc4e" dependencies = [ "bitflags", "inotify", @@ -1875,17 +1875,16 @@ dependencies = [ "log", "mio", "notify-types", - "objc2-core-foundation", - "objc2-core-services", "walkdir", "windows-sys", + "xxhash-rust", ] [[package]] name = "notify-types" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a437a9308232ce794b1e7fdf540d38ea37efc3c73492640c13b4c8568b8f108" +checksum = "cbd044e85df3d939d8e32a1c35a3b737c7d0a4eeb7acd737bd207644e00f4e5f" dependencies = [ "bitflags", ] @@ -1979,25 +1978,6 @@ dependencies = [ "objc2-encode", ] -[[package]] -name = "objc2-core-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" -dependencies = [ - "bitflags", -] - -[[package]] -name = "objc2-core-services" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583300ad934cba24ff5292aee751ecc070f7ca6b39a574cc21b7b5e588e06a0b" -dependencies = [ - "libc", - "objc2-core-foundation", -] - [[package]] name = "objc2-encode" version = "4.1.0" @@ -4669,6 +4649,12 @@ dependencies = [ "rustix", ] +[[package]] +name = "xxhash-rust" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40de123dbb523ebcc00d61ec01840ad192578afc378d859f3429caa38308fad5" + [[package]] name = "yansi" version = "1.0.1" diff --git a/Cargo.toml b/Cargo.toml index cc929cf1b82..b7e69c48d47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ members = [ [workspace.package] categories = ["command-line-utilities"] edition = "2024" -rust-version = "1.89" +rust-version = "1.91" homepage = "https://github.com/uutils/coreutils" keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"] license = "MIT" @@ -92,7 +92,9 @@ memchr = "2.7.2" memmap2 = "0.9.4" nix = { version = "0.31.3", default-features = false } nom = "8.0.0" -notify = { version = "8.2.0", features = ["macos_kqueue"] } +notify = { version = "9.0.0", default-features = false, features = [ + "macos_kqueue", +] } num-bigint = "0.4.4" num-integer = "0.1.47" num-prime = "0.7.0" diff --git a/deny.toml b/deny.toml index d221be2fe83..0c901d6b0bd 100644 --- a/deny.toml +++ b/deny.toml @@ -19,15 +19,16 @@ ignore = [ unused-allowed-license = "allow" version = 2 allow = [ - "MIT", "Apache-2.0", - "ISC", "BSD-2-Clause", "BSD-3-Clause", + "BSL-1.0", "CC0-1.0", + "ISC", + "MIT", + "MPL-2.0", "Unicode-3.0", "Zlib", - "MPL-2.0", ] confidence-threshold = 0.8 diff --git a/flake.nix b/flake.nix index 212ba79e202..dcb101bc6ee 100644 --- a/flake.nix +++ b/flake.nix @@ -49,7 +49,7 @@ default = pkgsFor.${system}.pkgs.mkShell { packages = build_deps ++ gnu_testing_deps; - RUSTC_VERSION = "1.89"; + RUSTC_VERSION = "1.91"; LIBCLANG_PATH = pkgsFor.${system}.lib.makeLibraryPath [pkgsFor.${system}.llvmPackages_latest.libclang.lib]; shellHook = '' export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 09cd127fc3d..b925bcceb33 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -17,7 +17,7 @@ members = ["."] [workspace.package] edition = "2024" -rust-version = "1.89" +rust-version = "1.91" license = "MIT" # Enable debug symbols in release builds for readable backtraces diff --git a/src/uu/tail/src/follow/watch.rs b/src/uu/tail/src/follow/watch.rs index 8b5704f456d..563d6a5425f 100644 --- a/src/uu/tail/src/follow/watch.rs +++ b/src/uu/tail/src/follow/watch.rs @@ -651,6 +651,7 @@ pub fn follow(mut observer: Observer, settings: &Settings) -> UResult<()> { Ok(Err(notify::Error { kind: notify::ErrorKind::Io(ref e), paths, + .. })) if e.kind() == std::io::ErrorKind::NotFound => { if let Some(event_path) = paths.first().filter(|p| observer.files.contains_key(p)) { let _ = observer diff --git a/src/uucore/src/lib/features/parser/parse_time.rs b/src/uucore/src/lib/features/parser/parse_time.rs index 01db02ebb6c..620c9ca9fb3 100644 --- a/src/uucore/src/lib/features/parser/parse_time.rs +++ b/src/uucore/src/lib/features/parser/parse_time.rs @@ -128,10 +128,7 @@ mod tests { #[test] fn test_units() { - assert_eq!( - from_str("2d", true), - Ok(Duration::from_secs(60 * 60 * 24 * 2)) - ); + assert_eq!(from_str("2d", true), Ok(Duration::from_hours(24 * 2))); assert!(from_str("2d", false).is_err()); } @@ -247,7 +244,7 @@ mod tests { from_str("0x1.1p-1d", true), Ok(Duration::from_secs_f64(0.53125f64 * 3600.0 * 24.0)) ); - assert_eq!(from_str("0xfh", true), Ok(Duration::from_secs(15 * 3600))); + assert_eq!(from_str("0xfh", true), Ok(Duration::from_hours(15))); } #[test] diff --git a/src/uucore/src/lib/features/time.rs b/src/uucore/src/lib/features/time.rs index f8ee063f047..2ee1dad884f 100644 --- a/src/uucore/src/lib/features/time.rs +++ b/src/uucore/src/lib/features/time.rs @@ -126,6 +126,7 @@ mod tests { // Test that very large (positive or negative) lead to just the timestamp being printed. #[test] fn test_large_system_time() { + #[allow(clippy::duration_suboptimal_units)] let time = UNIX_EPOCH + Duration::from_secs(67_768_036_191_763_200); let mut out = Vec::new(); format_system_time( @@ -137,6 +138,7 @@ mod tests { .expect("Formatting error."); assert_eq!(String::from_utf8(out).unwrap(), "67768036191763200"); + #[allow(clippy::duration_suboptimal_units)] let time = UNIX_EPOCH - Duration::from_secs(67_768_040_922_076_800); let mut out = Vec::new(); format_system_time( @@ -152,6 +154,7 @@ mod tests { // Test that very large (positive or negative) lead to just the timestamp being printed. #[test] fn test_large_system_time_float() { + #[allow(clippy::duration_suboptimal_units)] let time = UNIX_EPOCH + Duration::from_secs(67_768_036_191_763_000) + Duration::from_nanos(123); let mut out = Vec::new(); @@ -167,6 +170,7 @@ mod tests { "67768036191763000.000000123" ); + #[allow(clippy::duration_suboptimal_units)] let time = UNIX_EPOCH - Duration::from_secs(67_768_040_922_076_000) + Duration::from_nanos(123); let mut out = Vec::new(); diff --git a/src/uucore/src/lib/features/uptime/unix.rs b/src/uucore/src/lib/features/uptime/unix.rs index 42f21587689..6cbf59994c6 100644 --- a/src/uucore/src/lib/features/uptime/unix.rs +++ b/src/uucore/src/lib/features/uptime/unix.rs @@ -295,7 +295,7 @@ mod tests { // Reasonable upper bound: system hasn't been up for more than 365 days // (This is just a sanity check) assert!( - uptime < Duration::from_secs(365 * 86400), + uptime < Duration::from_hours(365 * 24), "Uptime seems unreasonably high: {uptime:?}" ); } diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index defd244c295..fc1940c6432 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -2322,7 +2322,7 @@ fn test_ls_time_styles() { // Create a recent and old (<6 months) file, as format can be different. at.touch("test"); let f3 = at.make_file("test-old"); - f3.set_modified(SystemTime::now() - Duration::from_secs(3600 * 24 * 365)) + f3.set_modified(SystemTime::now() - Duration::from_hours(24 * 365)) .unwrap(); let re_full_recent = Regex::new( @@ -2572,7 +2572,7 @@ fn test_ls_time_recent_future() { .stdout_matches(&re_iso_recent); // 100 days ago is still recent (<0.5 years) - f.set_modified(SystemTime::now() - Duration::from_secs(3600 * 24 * 100)) + f.set_modified(SystemTime::now() - Duration::from_hours(24 * 100)) .unwrap(); scene .ucmd() @@ -2582,7 +2582,7 @@ fn test_ls_time_recent_future() { .stdout_matches(&re_iso_recent); // 200 days ago is not recent - f.set_modified(SystemTime::now() - Duration::from_secs(3600 * 24 * 200)) + f.set_modified(SystemTime::now() - Duration::from_hours(24 * 200)) .unwrap(); scene .ucmd() @@ -2612,7 +2612,7 @@ fn test_ls_time_recent_future() { .stdout_contains("RECENT"); // Old file - f.set_modified(SystemTime::now() - Duration::from_secs(3600 * 24 * 200)) + f.set_modified(SystemTime::now() - Duration::from_hours(24 * 200)) .unwrap(); scene .ucmd()