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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.