Commit Graph

1053 Commits

Author SHA1 Message Date
dependabot[bot] 8add685cc6 build(deps): bump codecov/codecov-action from 6 to 7
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 6 to 7.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-09 09:29:29 +02:00
dependabot[bot] c4afeab1bc build(deps): bump actions/checkout from 4 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-09 09:29:07 +02:00
Sylvestre Ledru 62deaf6e60 updatedb: clear error when the output database can't be created
Opening the output file with `?` surfaced a bare "No such file or
directory" with no indication of which file failed (easy to hit because the
default output path /usr/local/var/locatedb often doesn't exist).

Report it like GNU does, naming the path and the reason, e.g.
`cannot create '/usr/local/var/locatedb': No such file or directory`.
strip_errno() drops the trailing "(os error N)" noise.
0.9.0
2026-06-08 23:38:59 +02:00
Sylvestre Ledru 1be5541c74 find: avoid redundant stat per -fstype evaluation
The -fstype matcher called path.symlink_metadata() (a statx/lstat syscall)
on every entry before consulting its cache, just to obtain the device id.
With several -fstype clauses on the same expression (as updatedb builds:
nfs/NFS/proc), every file was stat'd once per clause.

Derive the device id from WalkEntry::metadata() instead, which is cached on
the entry in a OnceCell and shared across all matchers, so each file is
stat'd at most once regardless of how many -fstype clauses run.

On 'updatedb --localpaths=/usr' (~506k files) this drops statx calls from
~1.52M to ~506k and wall-clock from ~1.82s to ~1.32s, with byte-identical
output.
2026-06-08 23:38:59 +02:00
Sylvestre Ledru 5d0e7add34 lints: enable clippy all/cargo/pedantic groups, mirroring uutils/coreutils
Enable the broader clippy lint set used by uutils/coreutils (the all,
cargo and pedantic groups plus the use_self nursery lint), allowing the
noisy/low-value lints. The preceding commits fix the warnings these
groups surface so the tree stays warning-free.
2026-06-08 22:48:45 +02:00
Sylvestre Ledru 42f8a9af36 find: fix clippy::needless_for_each 2026-06-08 22:48:45 +02:00
Sylvestre Ledru 664a9c23e6 xargs: fix clippy::needless_continue 2026-06-08 22:48:45 +02:00
Sylvestre Ledru fd4bd6acfa find,xargs: fix clippy::items_after_statements 2026-06-08 22:48:45 +02:00
Sylvestre Ledru fa4f90befb find: fix clippy::unnecessary_wraps 2026-06-08 22:48:45 +02:00
Sylvestre Ledru 7deeee6fdf find: fix clippy::unreadable_literal 2026-06-08 22:48:45 +02:00
Sylvestre Ledru 51a50022c2 find: fix clippy::assigning_clones 2026-06-08 22:48:45 +02:00
Sylvestre Ledru 600f3af140 find: fix clippy::implicit_clone 2026-06-08 22:48:45 +02:00
Sylvestre Ledru a63482b8cf find: fix clippy::match_bool 2026-06-08 22:48:45 +02:00
Sylvestre Ledru 47796303ca find: fix clippy::single_match_else 2026-06-08 22:48:45 +02:00
Sylvestre Ledru baa6ce5d92 find: fix clippy::unnecessary_semicolon 2026-06-08 22:48:45 +02:00
Sylvestre Ledru 9f33c14fc9 find: fix clippy::map_unwrap_or 2026-06-08 22:48:45 +02:00
Sylvestre Ledru a80620c88f find: fix clippy::redundant_closure_for_method_calls 2026-06-08 22:48:45 +02:00
Sylvestre Ledru a2c75f94ca prepare release 0.9.0 (#714) 2026-06-08 22:44:43 +02:00
dependabot[bot] 44fbc59263 build(deps): bump rstest from 0.25.0 to 0.26.1 (#710)
Bumps [rstest](https://github.com/la10736/rstest) from 0.25.0 to 0.26.1.
- [Release notes](https://github.com/la10736/rstest/releases)
- [Changelog](https://github.com/la10736/rstest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/la10736/rstest/compare/v0.25.0...v0.26.1)

---
updated-dependencies:
- dependency-name: rstest
  dependency-version: 0.26.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-08 08:40:05 +02:00
✿ Fleur de Blue fb9f8df047 fix: Handle write failures when printing --help/--version (#656) 2026-06-07 19:05:03 +02:00
Sylvestre Ledru 2044d1e31d make locate and updatedb work on Windows (#704)
locate and updatedb were Unix-only (gated behind cfg and stubbed out on
Windows). Make them cross-platform:

- locate: decode raw DB entries via a platform-specific bytes_to_path
  (verbatim bytes on Unix, lossy UTF-8 elsewhere), use Metadata::len()
  instead of the unix-only size(), and a cross-platform make_symlink in
  tests that skips gracefully when symlink creation is unprivileged.
- drop the #[cfg(unix)] gate on the locate module and the
  "unsupported on Windows" main stubs for locate/updatedb.
- db_tests: remove #[cfg(not(windows))] gates, write updatedb output to
  a tempdir instead of /dev/null, and add a full updatedb->locate
  roundtrip test that is platform-independent.
2026-06-07 11:52:08 +02:00
Jesse Rosenstock 0494ba1be4 find: Update --help text (#707)
Replace the "early alpha implementation" placeholder help text with a
proper organized reference grouped by category (global options,
operators, positional options, tests, and actions), with brief
descriptions for each entry. The old text was a flat list that hadn't
kept up with the implementation and still carried the "early alpha"
disclaimer.

Also fix a typo in a comment: "- newercm" -> "-newercm".
2026-06-07 11:51:45 +02:00
Sylvestre Ledru fc446aba0b ci: add CodSpeed benchmarks for updatedb and locate (#705)
Drive both utilities end-to-end through their real entry points.

- benches/updatedb_bench.rs: walks a generated tree (~8.5k paths) and
  writes a LOCATE02 database, measuring the walk + front-coding + write
  (full build and a -regex/-prune variant). Empty prune options keep the
  run deterministic regardless of temp_dir location.
- benches/locate_bench.rs: builds the database once via updatedb, then
  scans it in -c/count mode so database decoding and pattern matching
  dominate (no-match, substring, -b basename, -i ignore-case, -r regex).
  Unix-only, matching the locate module's cfg.

The existing CodSpeed workflow picks these up via cargo codspeed build/run.
2026-06-06 11:00:04 +02:00
Sylvestre Ledru 33703b79d8 ci: add CodSpeed benchmarks for find and xargs (#703)
Introduce criterion benchmarks (via codspeed-criterion-compat) that drive
find and xargs end-to-end through their real entry points, plus a CodSpeed
GitHub Actions workflow to track performance on pushes and PRs.

- benches/find_bench.rs: walks a generated directory tree exercising the
  matcher tree (-name/-iname/-regex/-size/-type, grouping, -prune, -printf).
  Output is sent to a sink so the directory walk and matching dominate.
- benches/xargs_bench.rs: feeds a corpus via -a and runs 'true' so xargs'
  own argument reading/splitting/batching dominates (whitespace, NUL, -n, -s).
- .github/workflows/codspeed.yml: mirrors the uutils/grep setup.
2026-06-06 10:37:56 +02:00
Jeremy Smart c5ff1bbb6b implement locate and updatedb (#536)
---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-06-06 10:10:44 +02:00