From cd8790239f3ad8a3d532e1ec66527dc0b7d6b3c0 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 8 Apr 2025 16:27:18 -0400 Subject: [PATCH 01/25] find: Fix -fstype with stacked mounts If you stack two mounts on top of each other, e.g. # mount -t ext4 /dev/sdX /mnt # mount -t f2fs /dev/sdY /mnt then read_fs_list() will return two entries for that mount point. The later one is the one with the correct type, since the later mount is on top of the earlier one. --- src/find/matchers/fs.rs | 3 ++- src/find/matchers/printf.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/find/matchers/fs.rs b/src/find/matchers/fs.rs index ee53c367..051604c3 100644 --- a/src/find/matchers/fs.rs +++ b/src/find/matchers/fs.rs @@ -53,7 +53,8 @@ pub fn get_file_system_type(path: &Path, cache: &RefCell>) -> URes let fs_list = uucore::fsext::read_fs_list()?; let result = fs_list .into_iter() - .find(|fs| fs.dev_id == dev_id) + .filter(|fs| fs.dev_id == dev_id) + .next_back() .map_or_else(String::new, |fs| fs.fs_type); // cache the latest query if not a match before diff --git a/src/find/matchers/printf.rs b/src/find/matchers/printf.rs index c7b6e196..d018ff06 100644 --- a/src/find/matchers/printf.rs +++ b/src/find/matchers/printf.rs @@ -451,7 +451,8 @@ fn format_directive<'entry>( uucore::fsext::read_fs_list().expect("Could not find the filesystem info"); fs_list .into_iter() - .find(|fs| fs.dev_id == dev_id) + .filter(|fs| fs.dev_id == dev_id) + .next_back() .map_or_else(String::new, |fs| fs.fs_type) .into() } From 6d6c40aec6245ae8906adb54c5a42277c5411a4d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 03:21:55 +0000 Subject: [PATCH 02/25] build(deps): bump assert_cmd from 2.0.16 to 2.0.17 Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd) from 2.0.16 to 2.0.17. - [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md) - [Commits](https://github.com/assert-rs/assert_cmd/compare/v2.0.16...v2.0.17) --- updated-dependencies: - dependency-name: assert_cmd dependency-version: 2.0.17 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0122f473..d4ed9100 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,9 +89,9 @@ dependencies = [ [[package]] name = "assert_cmd" -version = "2.0.16" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d" +checksum = "2bd389a4b2970a01282ee455294913c0a43724daedcd1a24c3eb0ec1c1320b66" dependencies = [ "anstyle", "bstr", From 2c3928ba21da3eebbe95442b638f8919b5b8f16c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 04:12:31 +0000 Subject: [PATCH 03/25] build(deps): bump clap from 4.5.36 to 4.5.37 Bumps [clap](https://github.com/clap-rs/clap) from 4.5.36 to 4.5.37. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.36...clap_complete-v4.5.37) --- updated-dependencies: - dependency-name: clap dependency-version: 4.5.37 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4ed9100..31e2cc58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,18 +196,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.36" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2df961d8c8a0d08aa9945718ccf584145eee3f3aa06cddbeac12933781102e04" +checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.36" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "132dbda40fb6753878316a489d5a1242a8ef2f0d9e47ba01c951ea8aa7d013a5" +checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" dependencies = [ "anstream", "anstyle", From a571de6812eb84bddb0b59201c2c1542f24ee3f8 Mon Sep 17 00:00:00 2001 From: cryptodarth <89084149+Crypto-Darth@users.noreply.github.com> Date: Thu, 24 Apr 2025 23:47:39 +0530 Subject: [PATCH 04/25] Implement : Chained Type matcher arguments (#527) * code dump * fix : new checks + working stage * minor fixes + duplicates check * fix : add check for incorrect chained commands * add : Chained Argument matching for -xtype * add: test * cargo fmt * Add : more tests + old test fix * refactor : move common code to function * fix : convert match to if/else * Improve : Testcase for xtype * cargo clippy fix * update : testcase * fix : error handling * fix : use single type * add: basic tests on binary level * Add : -xtype tests * refactor : use single type without Option<> * fix : use better search logic * refactor : use HashSet<> instead of Vec<> * remove : unnecessary hashmap usage * Update src/find/matchers/type_matcher.rs Co-authored-by: Tavian Barnes * change: variable name * remove: type and replace with HashSet * remove: trimming --------- Co-authored-by: Tavian Barnes --- src/find/matchers/entry.rs | 2 +- src/find/matchers/type_matcher.rs | 138 +++++++++++++++++++++++++----- tests/find_cmd_tests.rs | 106 +++++++++++++++++++++++ 3 files changed, 225 insertions(+), 21 deletions(-) diff --git a/src/find/matchers/entry.rs b/src/find/matchers/entry.rs index ab4b2b4c..fb28f2a0 100644 --- a/src/find/matchers/entry.rs +++ b/src/find/matchers/entry.rs @@ -24,7 +24,7 @@ enum Entry { } /// File types. -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub enum FileType { Unknown, Fifo, diff --git a/src/find/matchers/type_matcher.rs b/src/find/matchers/type_matcher.rs index 95696c91..a1af4889 100644 --- a/src/find/matchers/type_matcher.rs +++ b/src/find/matchers/type_matcher.rs @@ -4,16 +4,16 @@ // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. -use std::error::Error; - use super::{FileType, Follow, Matcher, MatcherIO, WalkEntry}; +use std::collections::HashSet; +use std::error::Error; /// This matcher checks the type of the file. pub struct TypeMatcher { - file_type: FileType, + file_type: HashSet, } -fn parse(type_string: &str) -> Result> { +fn parse(type_string: &str, mode: &str) -> Result> { let file_type = match type_string { "f" => FileType::Regular, "d" => FileType::Directory, @@ -24,8 +24,20 @@ fn parse(type_string: &str) -> Result> { "s" => FileType::Socket, // D: door (Solaris) "D" => { + #[cfg(not(target_os = "solaris"))] + { + return Err(From::from(format!("{mode} D is not supported because Solaris doors are not supported on the platform find was compiled on."))); + } + #[cfg(target_os = "solaris")] + { + return Err(From::from(format!( + "Type argument {type_string} not supported yet" + ))); + } + } + "" => { return Err(From::from(format!( - "Type argument {type_string} not supported yet" + "Arguments to {mode} should contain at least one letter" ))) } _ => { @@ -39,29 +51,32 @@ fn parse(type_string: &str) -> Result> { impl TypeMatcher { pub fn new(type_string: &str) -> Result> { - let file_type = parse(type_string)?; - Ok(Self { file_type }) + let main_file_type = type_creator(type_string, "-type")?; + Ok(Self { + file_type: main_file_type, + }) } } impl Matcher for TypeMatcher { fn matches(&self, file_info: &WalkEntry, _: &mut MatcherIO) -> bool { - file_info.file_type() == self.file_type + self.file_type.contains(&file_info.file_type()) } } /// Like [TypeMatcher], but toggles whether symlinks are followed. pub struct XtypeMatcher { - file_type: FileType, + file_type: HashSet, } impl XtypeMatcher { pub fn new(type_string: &str) -> Result> { - let file_type = parse(type_string)?; - Ok(Self { file_type }) + let main_file_type = type_creator(type_string, "-xtype")?; + Ok(Self { + file_type: main_file_type, + }) } } - impl Matcher for XtypeMatcher { fn matches(&self, file_info: &WalkEntry, _: &mut MatcherIO) -> bool { let follow = if file_info.follow() { @@ -72,16 +87,45 @@ impl Matcher for XtypeMatcher { let file_type = follow .metadata(file_info) - .map(|m| m.file_type()) - .map(FileType::from); - - match file_type { - Ok(file_type) if file_type == self.file_type => true, - // Since GNU find 4.10, ELOOP will match -xtype l - Err(e) if self.file_type.is_symlink() && e.is_loop() => true, - _ => false, + .map(|m| m.file_type().into()) + .or_else(|e| { + if e.is_loop() { + Ok(FileType::Symlink) + } else { + Err(e) + } + }) + .unwrap_or(FileType::Unknown); + + self.file_type.contains(&file_type) + } +} + +fn type_creator(type_string: &str, mode: &str) -> Result, Box> { + let mut file_types = std::collections::HashSet::new(); + + if type_string.contains(',') { + for part in type_string.split(',') { + if part.is_empty() { + return Err(From::from(format!("find: Last file type in list argument to {mode} is missing, i.e., list is ending on: ','"))); + } + let file_type = parse(part, mode)?; + if !file_types.insert(file_type) { + return Err(From::from(format!( + "Duplicate file type '{part}' in the argument list to {mode}" + ))); + } } + } else { + if type_string.len() > 1 { + return Err(From::from(format!( + "Must separate multiple arguments to {mode} using: ','" + ))); + } + file_types.insert(parse(type_string, mode)?); } + + Ok(file_types) } #[cfg(test)] @@ -238,4 +282,58 @@ mod tests { let deps = FakeDependencies::new(); assert!(matcher.matches(&entry, &mut deps.new_matcher_io())); } + + #[test] + fn chained_arguments_type() { + assert!(TypeMatcher::new("").is_err()); + assert!(TypeMatcher::new("f,f").is_err()); + assert!(TypeMatcher::new("f,").is_err()); + assert!(TypeMatcher::new("x,y").is_err()); + assert!(TypeMatcher::new("fd").is_err()); + + assert!(XtypeMatcher::new("").is_err()); + assert!(XtypeMatcher::new("f,f").is_err()); + assert!(XtypeMatcher::new("f,").is_err()); + assert!(XtypeMatcher::new("x,y").is_err()); + assert!(XtypeMatcher::new("fd").is_err()); + } + + #[test] + fn type_matcher_multiple_valid_types() { + let deps = FakeDependencies::new(); + let file = get_dir_entry_for("test_data/simple", "abbbc"); + let dir = get_dir_entry_for("test_data", "simple"); + let symlink = get_dir_entry_for("test_data/links", "link-f"); + + let matcher = TypeMatcher::new("f,d").unwrap(); + assert!(matcher.matches(&file, &mut deps.new_matcher_io())); + assert!(matcher.matches(&dir, &mut deps.new_matcher_io())); + assert!(!matcher.matches(&symlink, &mut deps.new_matcher_io())); + + let matcher = TypeMatcher::new("l,d").unwrap(); + assert!(!matcher.matches(&file, &mut deps.new_matcher_io())); + assert!(matcher.matches(&dir, &mut deps.new_matcher_io())); + assert!(matcher.matches(&symlink, &mut deps.new_matcher_io())); + } + + #[cfg(unix)] + #[test] + fn xtype_matcher_mixed_types_with_symlinks() { + let deps = FakeDependencies::new(); + + // Regular file through symlink + let entry = get_dir_entry_follow("test_data/links", "link-f", Follow::Always); + let matcher = XtypeMatcher::new("f,l").unwrap(); + assert!(matcher.matches(&entry, &mut deps.new_matcher_io())); + + // Broken symlink + let broken_entry = get_dir_entry_for("test_data/links", "link-missing"); + assert!(matcher.matches(&broken_entry, &mut deps.new_matcher_io())); + + //looping symlink + let matcher2 = XtypeMatcher::new("l").unwrap(); + let looping_entry = get_dir_entry_for("test_data/links", "link-loop"); + assert!(matcher.matches(&looping_entry, &mut deps.new_matcher_io())); + assert!(matcher2.matches(&looping_entry, &mut deps.new_matcher_io())); + } } diff --git a/tests/find_cmd_tests.rs b/tests/find_cmd_tests.rs index c4c3692e..86165801 100644 --- a/tests/find_cmd_tests.rs +++ b/tests/find_cmd_tests.rs @@ -74,6 +74,112 @@ fn two_matchers_one_matches() { .stdout(predicate::str::is_empty()); } +#[test] +fn multiple_matcher_success() { + Command::cargo_bin("find") + .expect("found binary") + .args(["-type", "f,d,l", "-name", "abbbc"]) + .assert() + .success() + .stderr(predicate::str::is_empty()) + .stdout(predicate::str::contains("abbbc")); + + Command::cargo_bin("find") + .expect("found binary") + .args(["-xtype", "f,d,l", "-name", "abbbc"]) + .assert() + .success() + .stderr(predicate::str::is_empty()) + .stdout(predicate::str::contains("abbbc")); +} + +#[test] +fn multiple_matcher_failure() { + Command::cargo_bin("find") + .expect("found binary") + .args(["-type", "fd", "-name", "abbb"]) + .assert() + .failure() + .stderr(predicate::str::contains("Must separate multiple arguments")) + .stdout(predicate::str::is_empty()); + + Command::cargo_bin("find") + .expect("found binary") + .args(["-type", "f,", "-name", "abbb"]) + .assert() + .failure() + .stderr(predicate::str::contains("list is ending on: ','")) + .stdout(predicate::str::is_empty()); + + Command::cargo_bin("find") + .expect("found binary") + .args(["-type", "f,f", "-name", "abbb"]) + .assert() + .failure() + .stderr(predicate::str::contains("Duplicate file type")) + .stdout(predicate::str::is_empty()); + + Command::cargo_bin("find") + .expect("found binary") + .args(["-type", "", "-name", "abbb"]) + .assert() + .failure() + .stderr(predicate::str::contains( + "should contain at least one letter", + )) + .stdout(predicate::str::is_empty()); + + Command::cargo_bin("find") + .expect("found binary") + .args(["-type", "x,y", "-name", "abbb"]) + .assert() + .failure() + .stderr(predicate::str::contains("Unrecognised type argument")) + .stdout(predicate::str::is_empty()); + // x-type tests below + Command::cargo_bin("find") + .expect("found binary") + .args(["-xtype", "fd", "-name", "abbb"]) + .assert() + .failure() + .stderr(predicate::str::contains("Must separate multiple arguments")) + .stdout(predicate::str::is_empty()); + + Command::cargo_bin("find") + .expect("found binary") + .args(["-xtype", "f,", "-name", "abbb"]) + .assert() + .failure() + .stderr(predicate::str::contains("list is ending on: ','")) + .stdout(predicate::str::is_empty()); + + Command::cargo_bin("find") + .expect("found binary") + .args(["-xtype", "f,f", "-name", "abbb"]) + .assert() + .failure() + .stderr(predicate::str::contains("Duplicate file type")) + .stdout(predicate::str::is_empty()); + + Command::cargo_bin("find") + .expect("found binary") + .args(["-xtype", "", "-name", "abbb"]) + .assert() + .failure() + .stderr(predicate::str::contains( + "should contain at least one letter", + )) + .stdout(predicate::str::is_empty()); + + Command::cargo_bin("find") + .expect("found binary") + .args(["-xtype", "x,y", "-name", "abbb"]) + .assert() + .failure() + .stderr(predicate::str::contains("Unrecognised type argument")) + .stdout(predicate::str::is_empty()); +} + #[serial(working_dir)] #[test] fn files0_empty_file() { From 3f026bfe6bf1fbb0b61abf374d19b57f119f859e Mon Sep 17 00:00:00 2001 From: cryptodarth <89084149+Crypto-Darth@users.noreply.github.com> Date: Thu, 24 Apr 2025 23:56:59 +0530 Subject: [PATCH 05/25] Merge pull request #534 from Crypto-Darth/error-msgs change "Error:" to "find:" + Testcase fix --- src/find/matchers/mod.rs | 8 ++++++-- src/find/mod.rs | 2 +- tests/find_cmd_tests.rs | 8 +++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/find/matchers/mod.rs b/src/find/matchers/mod.rs index 05ad37ae..ca2ed15e 100644 --- a/src/find/matchers/mod.rs +++ b/src/find/matchers/mod.rs @@ -720,7 +720,9 @@ fn build_matcher_tree( i += 1; let matcher = UserMatcher::from_user_name(user) .or_else(|| Some(UserMatcher::from_uid(user.parse::().ok()?))) - .ok_or_else(|| format!("{user} is not the name of a known user"))?; + .ok_or_else(|| { + format!("invalid user name or UID argument to -user: '{user}'") + })?; Some(matcher.into_box()) } "-nouser" => Some(NoUserMatcher {}.into_box()), @@ -749,7 +751,9 @@ fn build_matcher_tree( i += 1; let matcher = GroupMatcher::from_group_name(group) .or_else(|| Some(GroupMatcher::from_gid(group.parse::().ok()?))) - .ok_or_else(|| format!("{group} is not the name of an existing group"))?; + .ok_or_else(|| { + format!("invalid group name or GID argument to -group: '{group}'") + })?; Some(matcher.into_box()) } "-nogroup" => Some(NoGroupMatcher {}.into_box()), diff --git a/src/find/mod.rs b/src/find/mod.rs index f3008faf..b9c9cd3a 100644 --- a/src/find/mod.rs +++ b/src/find/mod.rs @@ -318,7 +318,7 @@ pub fn find_main(args: &[&str], deps: &dyn Dependencies) -> i32 { match do_find(&args[1..], deps) { Ok(ret) => ret, Err(e) => { - writeln!(&mut stderr(), "Error: {e}").unwrap(); + writeln!(&mut stderr(), "find: {e}").unwrap(); 1 } } diff --git a/tests/find_cmd_tests.rs b/tests/find_cmd_tests.rs index 86165801..5e698557 100644 --- a/tests/find_cmd_tests.rs +++ b/tests/find_cmd_tests.rs @@ -851,7 +851,9 @@ fn find_with_user_predicate() { .args(["test_data", "-user", " "]) .assert() .failure() - .stderr(predicate::str::contains("is not the name of a known user")) + .stderr(predicate::str::contains( + "invalid user name or UID argument to -user", + )) .stdout(predicate::str::is_empty()); } @@ -921,7 +923,7 @@ fn find_with_group_predicate() { .assert() .failure() .stderr(predicate::str::contains( - "is not the name of an existing group", + "invalid group name or GID argument to -group:", )) .stdout(predicate::str::is_empty()); } @@ -1035,7 +1037,7 @@ fn find_age_range() { .failure() .code(1) .stderr(predicate::str::contains( - "Error: Expected a decimal integer (with optional + or - prefix) argument to", + "find: Expected a decimal integer (with optional + or - prefix) argument to", )) .stdout(predicate::str::is_empty()); } From 2bb919e29d678a6843095ed5c208b658c2c6a7b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 03:17:53 +0000 Subject: [PATCH 06/25] build(deps): bump chrono from 0.4.40 to 0.4.41 Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.40 to 0.4.41. - [Release notes](https://github.com/chronotope/chrono/releases) - [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md) - [Commits](https://github.com/chronotope/chrono/compare/v0.4.40...v0.4.41) --- updated-dependencies: - dependency-name: chrono dependency-version: 0.4.41 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31e2cc58..c39f6202 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -161,9 +161,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", diff --git a/Cargo.toml b/Cargo.toml index 6ed71241..d4bdd138 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ description = "Rust implementation of GNU findutils" authors = ["uutils developers"] [dependencies] -chrono = "0.4.40" +chrono = "0.4.41" clap = "4.5" faccess = "0.2.4" walkdir = "2.5" From 9b51ba56250cc6a6c4cc89a221c43466e1ee42f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 03:17:58 +0000 Subject: [PATCH 07/25] build(deps): bump nix from 0.29.0 to 0.30.0 Bumps [nix](https://github.com/nix-rust/nix) from 0.29.0 to 0.30.0. - [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md) - [Commits](https://github.com/nix-rust/nix/compare/v0.29.0...v0.30.0) --- updated-dependencies: - dependency-name: nix dependency-version: 0.30.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 18 +++++++++++++++--- Cargo.toml | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31e2cc58..1211501f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -307,7 +307,7 @@ dependencies = [ "clap", "faccess", "filetime", - "nix 0.29.0", + "nix 0.30.0", "onig", "predicates", "pretty_assertions", @@ -469,9 +469,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libredox" @@ -544,6 +544,18 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537bc3c4a347b87fd52ac6c03a02ab1302962cfd93373c5d7a112cdc337854cc" +dependencies = [ + "bitflags 2.4.1", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "normalize-line-endings" version = "0.3.0" diff --git a/Cargo.toml b/Cargo.toml index 6ed71241..025f427d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,13 +17,13 @@ walkdir = "2.5" regex = "1.11" onig = { version = "6.4", default-features = false } uucore = { version = "0.0.30", features = ["entries", "fs", "fsext", "mode"] } -nix = { version = "0.29", features = ["fs", "user"] } +nix = { version = "0.30", features = ["fs", "user"] } argmax = "0.3.1" [dev-dependencies] assert_cmd = "2" filetime = "0.2" -nix = { version = "0.29", features = ["fs"] } +nix = { version = "0.30", features = ["fs"] } predicates = "3" serial_test = "3.2" tempfile = "3" From db60087142fe699bccaf2ba7dc40cbb03572c154 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 03:08:49 +0000 Subject: [PATCH 08/25] build(deps): bump nix from 0.30.0 to 0.30.1 Bumps [nix](https://github.com/nix-rust/nix) from 0.30.0 to 0.30.1. - [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md) - [Commits](https://github.com/nix-rust/nix/compare/v0.30.0...v0.30.1) --- updated-dependencies: - dependency-name: nix dependency-version: 0.30.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e0697c6..0d6a9c2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -307,7 +307,7 @@ dependencies = [ "clap", "faccess", "filetime", - "nix 0.30.0", + "nix 0.30.1", "onig", "predicates", "pretty_assertions", @@ -546,9 +546,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.30.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537bc3c4a347b87fd52ac6c03a02ab1302962cfd93373c5d7a112cdc337854cc" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ "bitflags 2.4.1", "cfg-if", From 1548034e17d499f563b69fff1f03bf305a6c8c34 Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Mon, 5 May 2025 09:15:45 -0700 Subject: [PATCH 09/25] Updated README to use SVG graphs. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index feb0ee79..a5747a81 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ bash util/build-gnu.sh tests/misc/help-version.sh ## Comparing with GNU -![Evolution over time - GNU testsuite](https://github.com/uutils/findutils-tracking/blob/main/gnu-results.png?raw=true) -![Evolution over time - BFS testsuite](https://github.com/uutils/findutils-tracking/blob/main/bfs-results.png?raw=true) +![Evolution over time - GNU testsuite](https://github.com/uutils/findutils-tracking/blob/main/gnu-results.svg?raw=true) +![Evolution over time - BFS testsuite](https://github.com/uutils/findutils-tracking/blob/main/bfs-results.svg?raw=true) ## Build/run with BFS From 319e1de58118bca78e195f1c84febb64aadd6a36 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Wed, 7 May 2025 09:32:08 +0200 Subject: [PATCH 10/25] ci: use ubuntu-latest instead of ubuntu-20.04 which is no longer available on Github --- .github/workflows/release.yml | 8 ++++---- dist-workspace.toml | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc9d1e79..3ae24e03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ on: jobs: # Run 'dist plan' (or host) to determine what tasks we need to do plan: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-latest" outputs: val: ${{ steps.plan.outputs.manifest }} tag: ${{ !github.event.pull_request && github.ref_name || '' }} @@ -168,7 +168,7 @@ jobs: needs: - plan - build-local-artifacts - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-latest" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json @@ -218,7 +218,7 @@ jobs: if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-latest" outputs: val: ${{ steps.host.outputs.manifest }} steps: @@ -282,7 +282,7 @@ jobs: # still allowing individual publish jobs to skip themselves (for prereleases). # "host" however must run to completion, no skipping allowed! if: ${{ always() && needs.host.result == 'success' }} - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-latest" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: diff --git a/dist-workspace.toml b/dist-workspace.toml index 03a34b41..9ae104b2 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -17,3 +17,8 @@ pr-run-mode = "plan" install-path = "CARGO_HOME" # Whether to install an updater program install-updater = false +# Ignore out-of-date contents +allow-dirty = ["ci"] + +[dist.github-custom-runners] +x86_64-unknown-linux-gnu = "ubuntu-latest" From 41c1013e4b62fb2571406e1b78b3c566edb46598 Mon Sep 17 00:00:00 2001 From: Jeremy Smart Date: Thu, 8 May 2025 20:58:16 -0400 Subject: [PATCH 11/25] update link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 063d7d02..955e0f49 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -180,7 +180,7 @@ To ensure easy collaboration, we have guidelines for using Git and GitHub. ### Commit messages You can read this section in the Git book to learn how to write good commit -messages: https://git-scm.com/book/ch5-2.html. +messages: https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project. In addition, here are a few examples for a summary line when committing to uutils: From dd0b2d94afb36370a5cc2f7c221b9644f301bc55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 03:57:41 +0000 Subject: [PATCH 12/25] build(deps): bump tempfile from 3.19.1 to 3.20.0 Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.19.1 to 3.20.0. - [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md) - [Commits](https://github.com/Stebalien/tempfile/compare/v3.19.1...v3.20.0) --- updated-dependencies: - dependency-name: tempfile dependency-version: 3.20.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d6a9c2e..7eecefb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -943,9 +943,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", "getrandom", From de9a58a0b5babf35f2ab51fc0a4b50209a2071f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 03:57:47 +0000 Subject: [PATCH 13/25] build(deps): bump clap from 4.5.37 to 4.5.38 Bumps [clap](https://github.com/clap-rs/clap) from 4.5.37 to 4.5.38. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.37...clap_complete-v4.5.38) --- updated-dependencies: - dependency-name: clap dependency-version: 4.5.38 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d6a9c2e..56a436fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,18 +196,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.37" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" +checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.37" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" +checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" dependencies = [ "anstream", "anstyle", From 90845d95ceb12289a1b5ee50704ed66f2f7349c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 03:24:39 +0000 Subject: [PATCH 14/25] build(deps): bump onig from 6.4.0 to 6.5.1 Bumps [onig](https://github.com/iwillspeak/rust-onig) from 6.4.0 to 6.5.1. - [Release notes](https://github.com/iwillspeak/rust-onig/releases) - [Changelog](https://github.com/rust-onig/rust-onig/blob/main/CHANGELOG.md) - [Commits](https://github.com/iwillspeak/rust-onig/compare/v6.4.0...V6.5.1) --- updated-dependencies: - dependency-name: onig dependency-version: 6.5.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 10 +++++----- Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 75efdbc8..335cfb7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -585,11 +585,11 @@ checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad" [[package]] name = "onig" -version = "6.4.0" +version = "6.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" +checksum = "336b9c63443aceef14bea841b899035ae3abe89b7c486aaf4c5bd8aafedac3f0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "libc", "once_cell", "onig_sys", @@ -597,9 +597,9 @@ dependencies = [ [[package]] name = "onig_sys" -version = "69.8.1" +version = "69.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" +checksum = "c7f86c6eef3d6df15f23bcfb6af487cbd2fed4e5581d58d5bf1f5f8b7f6727dc" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index e4c7056d..2a75930b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ clap = "4.5" faccess = "0.2.4" walkdir = "2.5" regex = "1.11" -onig = { version = "6.4", default-features = false } +onig = { version = "6.5", default-features = false } uucore = { version = "0.0.30", features = ["entries", "fs", "fsext", "mode"] } nix = { version = "0.30", features = ["fs", "user"] } argmax = "0.3.1" From f96852e957a13b0cb2f140e44c4a89f763c12aec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 03:20:48 +0000 Subject: [PATCH 15/25] build(deps): bump clap from 4.5.38 to 4.5.39 Bumps [clap](https://github.com/clap-rs/clap) from 4.5.38 to 4.5.39. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.38...clap_complete-v4.5.39) --- updated-dependencies: - dependency-name: clap dependency-version: 4.5.39 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 335cfb7b..fed3330a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,18 +196,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.38" +version = "4.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" +checksum = "fd60e63e9be68e5fb56422e397cf9baddded06dae1d2e523401542383bc72a9f" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.38" +version = "4.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" +checksum = "89cc6392a1f72bbeb820d71f32108f61fdaf18bc526e1d23954168a67759ef51" dependencies = [ "anstream", "anstyle", From 7034627fcce0e525a435a7ef17848c0b064b9e1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 03:33:42 +0000 Subject: [PATCH 16/25] build(deps): bump clap from 4.5.39 to 4.5.40 Bumps [clap](https://github.com/clap-rs/clap) from 4.5.39 to 4.5.40. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.39...clap_complete-v4.5.40) --- updated-dependencies: - dependency-name: clap dependency-version: 4.5.40 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fed3330a..3b007aa5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,18 +196,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.39" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd60e63e9be68e5fb56422e397cf9baddded06dae1d2e523401542383bc72a9f" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.39" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89cc6392a1f72bbeb820d71f32108f61fdaf18bc526e1d23954168a67759ef51" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstream", "anstyle", From 0b9f252f43d2894578400022ca7d78b25b62fce7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 03:30:56 +0000 Subject: [PATCH 17/25] build(deps): bump argmax from 0.3.1 to 0.4.0 Bumps [argmax](https://github.com/sharkdp/argmax) from 0.3.1 to 0.4.0. - [Release notes](https://github.com/sharkdp/argmax/releases) - [Commits](https://github.com/sharkdp/argmax/compare/v0.3.1...v0.4.0) --- updated-dependencies: - dependency-name: argmax dependency-version: 0.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 25 ++++--------------------- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3b007aa5..d8e7d4ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,13 +78,13 @@ dependencies = [ [[package]] name = "argmax" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7e3ef5e3a7f2c5e5a49d90ad087c03d38258e75155daac64deb62c50972c66" +checksum = "0144c58b55af0133ec3963ce5e4d07aad866e3bbcfdcddbf4590dbd7ad6ff557" dependencies = [ - "lazy_static", "libc", - "nix 0.24.3", + "nix 0.30.1", + "once_cell", ] [[package]] @@ -461,12 +461,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - [[package]] name = "libc" version = "0.2.172" @@ -521,17 +515,6 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" -[[package]] -name = "nix" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", -] - [[package]] name = "nix" version = "0.29.0" diff --git a/Cargo.toml b/Cargo.toml index 2a75930b..393f029c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ regex = "1.11" onig = { version = "6.5", default-features = false } uucore = { version = "0.0.30", features = ["entries", "fs", "fsext", "mode"] } nix = { version = "0.30", features = ["fs", "user"] } -argmax = "0.3.1" +argmax = "0.4.0" [dev-dependencies] assert_cmd = "2" From 1984df45e1d4b3f12c7ff31409ce0e1117d80178 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 03:55:53 +0000 Subject: [PATCH 18/25] build(deps): bump clap from 4.5.40 to 4.5.41 Bumps [clap](https://github.com/clap-rs/clap) from 4.5.40 to 4.5.41. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.40...clap_complete-v4.5.41) --- updated-dependencies: - dependency-name: clap dependency-version: 4.5.41 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8e7d4ba..21b3445a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,18 +196,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" dependencies = [ "anstream", "anstyle", From a36d4192af63ac5c32cf0f2bf79b48021ab70e1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 03:43:57 +0000 Subject: [PATCH 19/25] build(deps): bump clap from 4.5.41 to 4.5.42 Bumps [clap](https://github.com/clap-rs/clap) from 4.5.41 to 4.5.42. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.41...clap_complete-v4.5.42) --- updated-dependencies: - dependency-name: clap dependency-version: 4.5.42 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21b3445a..406bd2bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,18 +196,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.41" +version = "4.5.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" +checksum = "ed87a9d530bb41a67537289bafcac159cb3ee28460e0a4571123d2a778a6a882" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.41" +version = "4.5.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" +checksum = "64f4f3f3c77c94aff3c7e9aac9a2ca1974a5adf392a8bb751e827d6d127ab966" dependencies = [ "anstream", "anstyle", From 74f2009781360fe09e17e9cb5f64c50a491b11e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 03:34:56 +0000 Subject: [PATCH 20/25] build(deps): bump actions/download-artifact from 4 to 5 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ae24e03..8d66ecf0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,7 +129,7 @@ jobs: run: ${{ matrix.install_dist.run }} # Get the dist-manifest - name: Fetch local artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: pattern: artifacts-* path: target/distrib/ @@ -177,14 +177,14 @@ jobs: with: submodules: recursive - name: Install cached dist - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: cargo-dist-cache path: ~/.cargo/bin/ - run: chmod +x ~/.cargo/bin/dist # Get all the local artifacts for the global tasks to use (for e.g. checksums) - name: Fetch local artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: pattern: artifacts-* path: target/distrib/ @@ -226,14 +226,14 @@ jobs: with: submodules: recursive - name: Install cached dist - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: cargo-dist-cache path: ~/.cargo/bin/ - run: chmod +x ~/.cargo/bin/dist # Fetch artifacts from scratch-storage - name: Fetch artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: pattern: artifacts-* path: target/distrib/ @@ -253,7 +253,7 @@ jobs: path: dist-manifest.json # Create a GitHub Release while uploading all files to it - name: "Download GitHub Artifacts" - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: pattern: artifacts-* path: artifacts From e32735bfbeb5398186481595e54305fa2aa0470f Mon Sep 17 00:00:00 2001 From: Sridhar Sarnobat Date: Mon, 13 Oct 2025 00:17:13 -0400 Subject: [PATCH 21/25] 2025-10-12: README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index feb0ee79..fa615318 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,4 @@ bash util/build-bfs.sh posix/basic ``` For more details, see https://github.com/uutils/findutils-tracking/ + \ No newline at end of file From 2cbb37780735148d159226312ae25fe477c79e90 Mon Sep 17 00:00:00 2001 From: Sridhar Sarnobat Date: Mon, 13 Oct 2025 00:39:00 -0400 Subject: [PATCH 22/25] 2025-10-12: README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fa615318..f8be9bfe 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,4 @@ bash util/build-bfs.sh posix/basic ``` For more details, see https://github.com/uutils/findutils-tracking/ - \ No newline at end of file + \ No newline at end of file From 436dff6941bbc3498c81579f0a687160f6e9bdb5 Mon Sep 17 00:00:00 2001 From: jsondevers Date: Sat, 26 Apr 2025 15:20:47 -0700 Subject: [PATCH 23/25] porting findutils testing to use uutests closes #537 --- Cargo.toml | 6 ++++-- tests/common/mod.rs | 10 ++++++++++ tests/find_cmd_tests.rs | 31 +++++++++++++++---------------- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 393f029c..5e6814e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,8 +17,10 @@ walkdir = "2.5" regex = "1.11" onig = { version = "6.5", default-features = false } uucore = { version = "0.0.30", features = ["entries", "fs", "fsext", "mode"] } -nix = { version = "0.30", features = ["fs", "user"] } -argmax = "0.4.0" +nix = { version = "0.29", features = ["fs", "user"] } +argmax = "0.3.1" +uutests = { version = "0.0.30" } +ctor = "0.4.1" [dev-dependencies] assert_cmd = "2" diff --git a/tests/common/mod.rs b/tests/common/mod.rs index aa8de375..c42353ba 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -8,3 +8,13 @@ // in one test but not another can cause a dead code warning. #[allow(dead_code)] pub mod test_helpers; +pub const TESTS_BINARY: &str = env!("CARGO_BIN_EXE_find"); + +// Use the ctor attribute to run this function before any tests +#[ctor::ctor] +fn init() { + unsafe { + // Necessary for uutests to be able to find the binary + std::env::set_var("UUTESTS_BINARY_PATH", TESTS_BINARY); + } +} diff --git a/tests/find_cmd_tests.rs b/tests/find_cmd_tests.rs index 5e698557..53c68949 100644 --- a/tests/find_cmd_tests.rs +++ b/tests/find_cmd_tests.rs @@ -16,6 +16,8 @@ use std::fs::{self, File}; use std::io::{Read, Write}; use std::{env, io::ErrorKind}; use tempfile::Builder; +use uutests::util::TestScenario; +use uutests::{at_and_ucmd, new_ucmd, util_name}; #[cfg(unix)] use std::os::unix::fs::symlink; @@ -39,15 +41,14 @@ fn fix_up_regex_slashes(re: &str) -> String { re.to_owned() } -#[serial(working_dir)] #[test] fn no_args() { - Command::cargo_bin("find") - .expect("found binary") - .assert() - .success() - .stderr(predicate::str::is_empty()) - .stdout(predicate::str::contains("test_data")); + let ts = TestScenario::new("find"); + ts.cmd(env!("CARGO_BIN_EXE_find")) + .current_dir(env!("CARGO_MANIFEST_DIR")) + .succeeds() + .no_stderr() + .stdout_contains("test_data"); } #[serial(working_dir)] @@ -813,15 +814,13 @@ fn find_time() { #[test] fn expression_empty_parentheses() { - Command::cargo_bin("find") - .expect("found binary") - .args(["-true", "(", ")"]) - .assert() - .failure() - .stderr(predicate::str::contains( - "empty parentheses are not allowed", - )) - .stdout(predicate::str::is_empty()); + let (_at, mut ucmd) = at_and_ucmd!(); + ucmd.arg("-true") + .arg("(") + .arg(")") + .fails() + .stderr_contains("empty parentheses are not allowed") + .no_stdout(); } #[test] From 4a50619816f3fa9187f72623d2e0c6a59a20738c Mon Sep 17 00:00:00 2001 From: Sridhar Sarnobat Date: Mon, 13 Oct 2025 00:17:13 -0400 Subject: [PATCH 24/25] 2025-10-12: README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a5747a81..c2088961 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,4 @@ bash util/build-bfs.sh posix/basic ``` For more details, see https://github.com/uutils/findutils-tracking/ + \ No newline at end of file From 550d2c18e7f1c47dfcc720ada4957387278b12d2 Mon Sep 17 00:00:00 2001 From: Sridhar Sarnobat Date: Mon, 13 Oct 2025 00:39:00 -0400 Subject: [PATCH 25/25] 2025-10-12: README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c2088961..7036908d 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,4 @@ bash util/build-bfs.sh posix/basic ``` For more details, see https://github.com/uutils/findutils-tracking/ - \ No newline at end of file + \ No newline at end of file