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.
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.
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
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
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.
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".
`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.
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.
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.
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.
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.
`\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.
`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.