Commit Graph
100 Commits
Author SHA1 Message Date
Sylvestre Ledru cf1f3bc832 release: pin macOS/Windows targets to live runners
The cargo-dist 0.28 defaults macos-13 and windows-2019 have been retired
by GitHub. The release jobs for the Apple and Windows targets therefore
hung indefinitely awaiting a runner (hitting the 24h limit and being
cancelled), so the host job never ran and releases (0.9.0, 0.9.1) were
published without any binary assets.

Pin those targets to currently-available runners (the same labels used
successfully by uutils/diffutils) so the next tagged release uploads its
binaries.
2026-06-21 14:03:28 +02:00
Sylvestre Ledru 4d778b6fd9 ci: build static musl binaries for x86_64 and aarch64
Add x86_64-unknown-linux-musl and aarch64-unknown-linux-musl to the
cargo-dist targets so releases include fully static Linux binaries that
run regardless of glibc version. aarch64-musl builds natively on an ARM
runner to avoid cross-compiling the onig C dependency.

Fixes #387
2026-06-15 17:39:32 +02:00
Sylvestre Ledru 978d7ab215 release: define the [profile.dist] used by cargo-dist
The 0.9.0 release shipped with no assets because the release workflow
failed with "error: profile `dist` is not defined". cargo-dist always
builds release artifacts with `cargo build --profile dist`, but Cargo.toml
only defined `release` and `release-fast`, so every build job errored out
before producing a binary and nothing was uploaded to the release.

Add the [profile.dist] block (inheriting release) that cargo-dist expects.

Fixes #737
2026-06-15 14:41:20 +02:00
Sylvestre Ledru bb6a5ba53e ci: per-test GNU/bfs comparison and comment, like uutils sed/grep
The old comparison only commented when the PASS/FAIL/ERROR/SKIP *counts*
changed vs main, so it was blind to net-zero changes (one test fixed, one
broken). diff-gnu.sh also compared against an unextracted (empty) baseline,
flagging every current failure as a regression, and the published baseline
could be stale.

Adopt the sed/grep design:

- build-gnu.sh / build-bfs.sh now emit a per-test JSON summary
  (findutils-gnu-full-result.json / bfs-full-result.json) listing every
  test's name + PASS/FAIL/SKIP, via the new gnu_json_result.py /
  bfs_json_result.py.
- compare_test_results.py diffs the set of failing test names against a
  reference, writing a human-readable result file (empty when nothing
  changed) and exiting non-zero only on new, non-intermittent failures.
- compat.yml fetches the reference *-full-result.json from the default
  branch's latest run (dawidd6/action-download-artifact) and uploads a
  comparison artifact per suite.
- comment.yml posts a PR comment whenever the comparison is non-empty,
  i.e. on any per-test improvement or regression regardless of net count.
- ignore-intermittent.txt lists known-flaky tests, reported but not
  failing the job.

Remove the superseded compare_gnu_result.py / compare_bfs_result.py /
diff-gnu.sh / diff-bfs.sh.
2026-06-13 09:10:55 +02:00
Sylvestre Ledru 782744f35c ci: build and lint the wasm32-wasip1 target
Add a job that installs the wasm32-wasip1 target plus the WASI SDK (so the
bundled C in onig_sys can be cross-compiled) and runs cargo build and
clippy -D warnings, so non-Unix compilation can't regress.
2026-06-10 07:45:04 +02:00
Sylvestre Ledru c100ac226f build: support compiling for non-Unix targets such as wasm
The platform-specific code was split into cfg(unix)/cfg(windows) arms, so
wasm32 targets (which are neither) failed to compile. Widen the generic
Windows stubs to cfg(not(unix)) and make the -ls printer and xargs size
limiters fall back to portable APIs when no platform-specific one exists.
2026-06-10 07:45:04 +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.
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
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
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
Sylvestre Ledru e7c34ab12f test: properly exercise {} in -exec utility name (#702)
The test from #647 used {} only in an argument, so it passed on
unpatched code. Rewrite it to make the matched entry the
testing-commandline binary and pass {} as the utility name, so the
placeholder must resolve to the entry's path and execute.
2026-06-06 09:35:34 +02:00
Sylvestre Ledru a65160f724 find: match GNU prompt format for -ok/-okdir (#699)
The -ok/-okdir prompt rendered the full substituted command, but GNU
find prints a fixed, abbreviated form: "< executable ... pathname > ? "
(literal ..., a space before ?, and always the full entry path even for
-okdir). Match it exactly and update the prompt-format test.

Verified byte-for-byte against GNU findutils 4.10.0.
2026-06-05 13:18:13 +08:00
Sylvestre Ledru 5bef01f72f github action: publish the release as draft first (#530) 2026-06-04 22:51:02 +02:00
Sylvestre Ledru 9a1e379a9d fix: avoid panic on -fprintf with missing arguments (#698)
Fixes #696
2026-06-05 02:41:58 +08:00
Sylvestre Ledru fe9e872710 CONTRIBUTING: link to the review guidelines website 2026-05-30 10:00:13 +02:00
Sylvestre Ledru 1a65b7634a Merge pull request #596 from cakebaker/bump_uucore
Bump `uucore` from `0.2.2` to `0.4.0`
2025-12-06 16:58:51 +01:00
Sylvestre Ledru 5cb79e3868 Merge pull request #597 from cakebaker/bump_yanked_deps
Bump yanked dependencies
2025-11-19 09:45:52 +01:00
Sylvestre Ledru 0f7bf4d56e Merge pull request #591 from cakebaker/clippy_fix_derivable_impls
clippy: fix warning from `derivable_impls` lint
2025-10-31 09:53:53 +01:00
Sylvestre Ledru 8164791335 Merge pull request #587 from cakebaker/bump_assert_cmd
Bump `assert_cmd` & fix deprecation warnings
2025-10-30 07:59:48 +01:00
Sylvestre Ledru cad6c11cd0 Merge pull request #555 from cakebaker/bump_uucore
Bump `uucore` from `0.0.30` to `0.1.0`
2025-08-21 10:22:04 +02:00
Sylvestre Ledru 73d5e90590 Merge pull request #546 from cakebaker/ci_use_latest_ubuntu_in_release_workflow
ci: use `ubuntu-latest` instead of `ubuntu-20.04` for `release` workflow
2025-05-09 09:06:37 +02:00
Sylvestre Ledru be84586025 Merge pull request #547 from Qelxiros/docs_dead_link
docs: update dead link
2025-05-09 09:03:54 +02:00
Sylvestre Ledru a607612ee0 Merge pull request #545 from tdulcet/svg
Switched to SVG graphs
2025-05-05 19:53:27 +02:00
Sylvestre Ledru e5f7dae2ae Merge pull request #532 from tavianator/fstype-stacked
find: Fix -fstype with stacked mounts
2025-04-24 21:18:48 +02:00
Sylvestre Ledru cacb1c10bd Merge pull request #529 from KartikDua1504/fix-blocks
Fix: Use div_ceil with proper blocks computation
2025-04-10 11:23:03 -04:00
Sylvestre Ledru b94b5f0122 Merge pull request #524 from tavianator/cmp-signs
find: Allow comparable values with signs
2025-04-06 18:46:33 +02:00
Sylvestre Ledru 4f8fbf55a1 Merge pull request #528 from sylvestre/ver
prepare version 0.8.0
2025-04-06 18:41:08 +02:00
Sylvestre Ledru 3dbdbe8442 prepare version 0.8.0 2025-04-06 18:35:31 +02:00
Sylvestre Ledru 949bcb83c8 Merge pull request #526 from cakebaker/find_fix_typo_in_test
find: fix typo in test (slashs -> slashes)
2025-04-05 10:24:14 +02:00
Sylvestre Ledru ad61338bb2 ci: use github for gnulib 2025-04-04 23:04:33 +02:00
Sylvestre Ledru 4a1c683834 ci: remove trailing spaces 2025-04-04 23:00:59 +02:00
Sylvestre Ledru 2ec695381e ci: adjust to code cov v5 2025-04-04 22:27:47 +02:00
Sylvestre Ledru a04b499e15 Merge pull request #521 from tavianator/user-group-ids
find: User/group ID fixes
2025-04-04 14:01:21 +02:00
Sylvestre Ledru 81c39aad7d Merge pull request #522 from cakebaker/clippy_fix_warnings_from_rust_1_86
clippy: fix warnings from Rust 1.86
2025-04-04 09:50:42 +02:00
Sylvestre Ledru 013be1b093 Merge pull request #520 from tavianator/exec-multi-deterministic
tests: Make -exec {} + tests deterministic
2025-04-04 09:20:25 +02:00
Sylvestre Ledru 280381bb28 disable clippy::warn for now 2025-03-23 14:40:56 +01:00
Sylvestre Ledru 1809a3edca fix many clippy warnings
Done with
cargo clippy --fix
2025-03-23 14:38:11 +01:00
Sylvestre Ledru 0a54e7c6d9 clippy: add the same rules as coreutils 2025-03-23 14:35:35 +01:00
Sylvestre Ledru a7b596daef Merge pull request #506 from cakebaker/ci_update_dist
ci: update `dist` from `0.12` to `0.28`
2025-03-14 10:21:51 +01:00
Sylvestre Ledru cb3f3cfea4 Merge pull request #503 from cakebaker/remove_unused_once_cell
Remove unused `once_cell` dependency
2025-03-11 09:28:39 +01:00
Sylvestre Ledru e0397917e4 Merge pull request #470 from cakebaker/ci_fix_code_coverage
ci: use `-Cinstrument-coverage` instead of `-Zprofile`
2025-02-13 18:16:44 +01:00
Sylvestre Ledru a21c379953 Update to uucore 0.0.29 2025-01-20 10:12:10 +01:00
Sylvestre Ledru c45e474c7e Merge pull request #487 from hanbings/fix-ci
ci: Fix issues related to downloading builds in ci.
2025-01-20 10:11:35 +01:00
Sylvestre Ledru b7f93ea816 Merge pull request #475 from cakebaker/find_fix_clippy_warnings
find: fix new clippy warnings
2025-01-20 08:47:09 +01:00
Sylvestre Ledru 9d66be6b7d manage the special case 'find %A+ (#454)
* declare the variable where it is used

* manage the special case 'find %A+'

Closes: #451
2024-09-22 16:15:53 +08:00
Sylvestre Ledru e3f4224f12 prepare version 0.7.0 2024-09-08 10:04:46 +02:00
Sylvestre Ledru 8fc5ddb299 Merge pull request #450 from cakebaker/find_fix_clippy_warning
find: use array instead of closure
2024-09-06 08:53:55 +02:00
Sylvestre Ledru 5be00c85d7 Merge pull request #427 from tavianator/simplify-matcher-io
Remove unnecessary lifetime parameter from Dependencies
2024-07-28 09:53:25 +02:00
Sylvestre Ledru 7f4423e703 Merge pull request #417 from tavianator/options-return-true
options return true
2024-07-11 21:49:40 +02:00
Sylvestre Ledru 8bfa9d200b Revert "cargo-dist: generate more targets"
it fails with:
```
  error occurred: Failed to find tool. Is `aarch64-linux-musl-gcc` installed?
```
and
```
          /usr/bin/ld: /home/runner/work/findutils/findutils/target/aarch64-unknown-linux-gnu/dist/deps/find-c77ccffa664800a0.49era2xhdewepevi.rcgu.o: error adding symbols: file in wrong format
```

This reverts commit b5e7dd52d9.
2024-06-29 10:49:11 +02:00
Sylvestre Ledru a235b35ac3 Revert "Fix cargo-dist generation of arm64 linux"
This reverts commit ca252c9727.
2024-06-29 10:48:01 +02:00
Sylvestre Ledru ca252c9727 Fix cargo-dist generation of arm64 linux
See:
https://github.com/axodotdev/cargo-dist/issues/74#issuecomment-2053680080
2024-06-29 10:37:01 +02:00
Sylvestre Ledru c995e25eb4 prepare version 0.6.0 2024-06-29 10:16:34 +02:00
Sylvestre Ledru 7136628c45 Merge pull request #405 from hanbings/implement-371
find: Implement `-uid` and `-gid`
2024-06-26 22:48:23 +02:00
Sylvestre Ledru add14dbebf Merge pull request #394 from hanbings/fix-windows-test
find: Fix `-newerXY` test code for Windows platform.
2024-05-30 23:13:07 +02:00
Sylvestre Ledru ed97c851aa Merge pull request #395 from cakebaker/find_remove_unused_import
find: remove unused import on Windows
2024-05-30 23:12:20 +02:00
Sylvestre Ledru 0ca2450ab2 Merge pull request #396 from cakebaker/xargs_allow_dead_code
xargs: use `#[allow(dead_code)]` for enum
2024-05-30 23:12:04 +02:00
Sylvestre Ledru 3badb05772 Merge pull request #392 from cakebaker/ci_run_tests
ci: run `cargo test` instead of `cargo check` in "cargo test" jobs
2024-05-28 16:51:54 +02:00
Sylvestre Ledru aa6ff46078 release 0.5.1 2024-05-19 19:07:24 +02:00
Sylvestre Ledru b5e7dd52d9 cargo-dist: generate more targets 2024-05-19 11:58:13 +02:00
Sylvestre Ledru b91820de17 Merge pull request #385 from cakebaker/find_replace_zip_with_nested_loops
find: replace `zip` with nested loops in tests
2024-05-16 10:54:45 +02:00
Sylvestre Ledru 70b7b3633e Merge pull request #361 from hanbings/fix-355
find: Fix `convert_arg_to_comparable_value()` function parsing unexpected characters.
2024-05-16 10:43:43 +02:00
Sylvestre Ledru baa09baf47 Merge pull request #359 from cakebaker/ci_use_clippy_all_targets
ci: use `--all-targets` when running clippy
2024-04-23 08:49:02 +02:00
Sylvestre Ledru f32425a83c Merge pull request #350 from sylvestre/release
use cargo-dist + prepare 0.5.0
2024-04-04 00:25:48 +02:00
Sylvestre Ledru fd8ef0bb26 release: version 0.5.0 2024-04-04 00:19:57 +02:00
Sylvestre Ledru 93469e6f97 chore: wow shiny new cargo-dist CI 2024-04-04 00:19:57 +02:00
Sylvestre Ledru b801c97830 Merge pull request #349 from sylvestre/clipp2
Run clippy pedantic fixes on the recent changes
2024-04-04 00:19:48 +02:00
Sylvestre Ledru da0de660ae Run clippy pedantic fixes on the recent changes 2024-04-03 23:23:40 +02:00
Sylvestre Ledru b4fbbe50c2 Run clippy pedantic fixes
Done with:
$ cargo +nightly clippy --tests --fix --allow-dirty -- -W clippy::pedantic
2024-04-03 17:50:13 +02:00
Sylvestre Ledru 45c1938eef xargs: add more tests and priority 2024-04-02 21:37:59 +02:00
Sylvestre LedruandDaniel Hofstetter a123a94c7d Improve the help
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-04-02 19:11:00 +02:00
Sylvestre Ledru 21e15c3015 xargs -I: support -i/-I add a corner case test 2024-04-02 19:11:00 +02:00
Sylvestre Ledru 299973809a xargs -I: support -i/-I different behavior 2024-04-02 19:11:00 +02:00
Sylvestre LedruandDaniel Hofstetter 90cee0fe37 Fix long line
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-04-02 19:11:00 +02:00
Sylvestre Ledru 0c2bb89770 tests: improve test output in case of error 2024-04-02 19:11:00 +02:00
Sylvestre Ledru e64c69a703 use pretty_assertions 2024-04-02 19:11:00 +02:00
Sylvestre Ledru 9b3514a100 xargs: Implement -I to replace (Closes: #310) 2024-04-02 19:11:00 +02:00
Sylvestre Ledru a85f5d7e01 parse_delimiter: Make the code more idiomatic 2024-04-02 19:11:00 +02:00
Sylvestre Ledru 274d749f8d Merge pull request #346 from cakebaker/ci_name_upload_steps
ci: name upload steps
2024-04-02 18:05:15 +02:00
Sylvestre Ledru 5360d01b08 Merge pull request #343 from cakebaker/xargs_max_lines
xargs: add --max-lines
2024-03-28 22:29:11 +01:00
Sylvestre Ledru 49227dfe57 Merge pull request #339 from cakebaker/cargo_toml_specify_complete_chrono_version
Cargo.toml: specify complete chrono version
2024-03-25 11:10:23 +01:00
Sylvestre LedruandDaniel Hofstetter 67e279e986 README: add badges + bfs info (#337)
* README: add badges + bfs info

* fix typo

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* list all programs

* README: fix typo

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-03-25 11:02:27 +01:00
Sylvestre Ledru 27b4bf5bb2 Merge pull request #335 from cakebaker/find_fix_clippy_warnings
find: fix two clippy warnings
2024-03-23 09:09:21 +01:00
Sylvestre Ledru ae280f7751 Merge pull request #334 from tavianator/bfs-3.1.3
ci: Update bfs to 3.1.3
2024-03-19 18:41:53 +01:00
Sylvestre Ledru f7ccc76991 Merge pull request #332 from uutils/dependabot/cargo/clap-4.5.2
build(deps): bump clap from 4.4.18 to 4.5.2
2024-03-15 10:06:20 +01:00