Commit Graph
1076 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
Daniel Hofstetter c03e1941c8 Bump cargo-dist from 0.28.0 to 0.32.0 2026-06-21 14:03:06 +02:00
Sylvestre Ledru 1ac5fe45ac Release 0.9.1 2026-06-19 09:30:54 +02:00
dependabot[bot] b2046b1fa3 build(deps): bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [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/v6...v7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-19 08:10:21 +02:00
oech3 fda6417442 add 2 missing binaries to latest-commit 2026-06-18 18:55:17 +02:00
dependabot[bot] 2bc31fab7a build(deps): bump itertools from 0.14.0 to 0.15.0
Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.14.0 to 0.15.0.
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.14.0...v0.15.0)

---
updated-dependencies:
- dependency-name: itertools
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-17 08:01:32 +02:00
weili 6f204c604d xargs: do not panic on empty input in replace mode
In replace mode (-I/-i/--replace) xargs runs the command once per input item, so
with empty input it should run nothing. Instead the final builder was still
executed and `CommandBuilder::execute` indexed `extra_args[0]`, which is empty
for no input, panicking with index-out-of-bounds. Treat replace mode as implying
--no-run-if-empty (as GNU does) so empty input runs nothing and exits 0.
2026-06-16 09:49:07 +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
oech3 b637fb1c1e Cargo.toml: inherit lto = "thin" 2026-06-15 15:03:27 +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
oech3 43d89117fa CONTRIBUTING.md: replace coreutils by findutils 2026-06-13 09:10:39 +02:00
Jesse Rosenstock 795d29ab35 xargs: clarify -x and -t help text
The previous text implied -x only interacts with -L/-n and used
imprecise phrasing. The new text mirrors the POSIX spec: terminate
when a constructed command line would exceed the size limit rather
than reducing the argument count.

Clarify that -t prints each command to stderr, rather than just
"be verbose".
2026-06-10 15:00:22 +02:00
xtqqczze c619fbeb82 chore(deps): update rust crates 2026-06-10 14:51:52 +02:00
weili a70f5ccd7c find: -ls: don't panic on an unmapped owner uid/gid
`find <file> -ls` panicked (exit 101) when the file's owning uid (or gid) had
no `/etc/passwd` (`/etc/group`) entry: it resolved the name with
`User::from_uid(...).unwrap().unwrap()`, and the inner unwrap aborts on the
`Ok(None)` that an unmapped id returns. Unmapped owners are routine (extracted
archives, NFS, deleted accounts, container images).

Resolve the uid/gid via `uucore::entries::uid2usr`/`gid2grp`, falling back to
the numeric id when there is no entry, matching GNU find (which prints the
number). These helpers already serialize the non-thread-safe getpwuid/getgrgid
behind a mutex, so reuse them rather than reimplementing the lookup.

Add a -ls integration test that chowns a file to an unmapped id and checks the
numeric fallback; it skips when the process lacks the privilege to do so.
2026-06-10 07:45:53 +02:00
weili 5992901805 find: -printf: test octal escape before a multibyte char
Regression test for the panic fixed in #720/#723: a `\NNN` octal escape
immediately followed by a multibyte character (`\0€`) used to slice the
format string mid-char and abort. Assert `-printf` emits the escape byte
and the following character intact.
2026-06-10 07:45:25 +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
dependabot[bot] 5bf236b891 build(deps): bump regex from 1.12.3 to 1.12.4
Bumps [regex](https://github.com/rust-lang/regex) from 1.12.3 to 1.12.4.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.12.3...1.12.4)

---
updated-dependencies:
- dependency-name: regex
  dependency-version: 1.12.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-10 07:15:21 +02:00
weili 001966f326 find: -name: don't panic on a malformed POSIX bracket class
A `-name` glob with a `[.`/`[=`/`[:` introducer whose closing delimiter is
missing — only a lone `]` (or the delimiter) before a multibyte char, e.g.
`'[[:]é'` — panicked (exit 101). `extract_bracket_expr` searched for *either*
the delimiter or `]` and then added a blind `+ 2`, which overshot into the
following character and sliced off a UTF-8 boundary.

Search for the actual two-byte closing sequence `<delim>]` instead. A valid
class (`[:alpha:]`) is unchanged; a malformed one returns None, so the caller
treats `[` literally and accepts the pattern like GNU find (exit 0). Reachable
via -name/-iname/-path/-ipath/-lname/-ilname. Adds a regression test.
2026-06-09 22:41:13 +02:00
weili 53980035af find: -printf: don't panic on a multibyte char after an octal escape
`\NNN` octal escapes were parsed by slicing a fixed 3 bytes off the
format string, which panics when fewer than 3 octal digits are followed
by a multibyte character (e.g. `-printf '\0€'`): the 3-byte slice lands
inside the multibyte char and trips a char-boundary assertion.

Parse the octal escape from the leading octal digits only (1 to 3, all
ASCII) and advance by their byte length. This also fixes `\1`..`\7`,
which previously fell through to the single-character escape table and
errored instead of being treated as octal, matching GNU find.
2026-06-09 22:23:39 +02:00
weili e2d84e98d5 locate: don't panic on a too-short --database file
`locate -d <file> <pattern>` panicked (slice index underflow, exit 101) when
the database file is exactly one byte: `check_db` consumes that byte with
`read_exact`, then `read_until(b'\0', ...)` hits EOF and appends nothing,
leaving `buf` empty. `&buf[..buf.len() - 1]` then underflows `buf.len() - 1`
to `usize::MAX` and slices out of bounds.

Strip the trailing nul with `strip_suffix(b"\0")` (falling back to the whole
buffer when `read_until` stopped at EOF without one) instead of slicing
`buf.len() - 1`. An empty buffer now yields `None` (unrecognized format), so
the too-short database is skipped like any other invalid one and locate exits
1 instead of crashing. Adds a regression test.
2026-06-09 22:23:23 +02:00
dependabot[bot] 865ab0991e build(deps): bump moonrepo/setup-rust from 0 to 1
Bumps [moonrepo/setup-rust](https://github.com/moonrepo/setup-rust) from 0 to 1.
- [Release notes](https://github.com/moonrepo/setup-rust/releases)
- [Changelog](https://github.com/moonrepo/setup-rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moonrepo/setup-rust/compare/v0...v1)

---
updated-dependencies:
- dependency-name: moonrepo/setup-rust
  dependency-version: '1'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-09 09:35:56 +02:00
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