Up to [cvs.NetBSD.org] / pkgsrc / sysutils / uutils-coreutils
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
sysutils/uutils-coreutils: update to 0.12.0
(leaf pkg)
Rust Coreutils 0.12.0 Release:
We are happy to announce the release of Rust Coreutils 0.12.0 - a release focused on compatibility fixes for our Ubuntu friends.
Ubuntu ships uutils coreutils as its default coreutils implementation, and this cycle was driven by what their users and maintainers reported: the bugs they asked us to prioritize are all fixed here, along with a long tail of smaller divergences from GNU. Few of these are glamorous, but they are exactly what breaks a script that has worked for twenty years.
Alongside that, we removed the last C dependency of expr (onig is replaced by the pure-Rust fancy-regex), continued the Windows port (nice, nohup and hostid now build there, and uucore's filesystem layer was rewritten with safe Win32 wrappers) and landed another round of security hardening on ls, sort and install.
Also, some contributions had carried comments and code over from GNU coreutils, against our own rule
that uutils is an original implementation. We reviewed the tree and rewrote what we found, in comments and in the few functions that followed the C too closely; no behaviour change. The GNU coreutils maintainers have been notified.
GNU coreutils 9.12 was released during our cycle (kudos to the team!), and some of the work went that way too. Chasing compatibility tends to turn up things worth fixing or improving on both sides.
We also made it official: a utility being significantly slower than GNU is now treated as a bug, not a wishlist item. If you hit one, please report it as a bug.
Highlights:
Ubuntu Compatibility
The issues Ubuntu asked us to fix first are all fixed: data loss in a parallel install -D (#12355), du on 32-bit architectures (#11848), ls ACL dereferencing (#13234), cp -R name collisions (LP#2167118) and chmod -R through symlinks (LP#2167122)
A whole family of options now accept a hyphen-leading value, like GNU does: csplit --suffix-format, paste -d, join -t, stat --format/--printf/-c and all of numfmt's options. A - in a delimiter or a format string is data, not a flag
rm no longer segfaults on very deeply nested directories
sort -n applies to the key instead of the whole line, echoes a disorder line verbatim instead of reformatting it as a number, and no longer keeps every input file open while sorting
basename trailing-separator handling for dot components, realpath exit status in quiet mode, ln keeping the destination when a forced link fails, csplit always creating the final split even when empty, fmt -x/-X, printf treating a -- past the format as an argument, test rejecting an -a/-o that ends the expression, echo -e no longer expanding \u, \U and \"
ls: dired fixes, a tie in the time sort broken by the name, name sort for -u/-c in long format, capability markers that respect the dereference config; dir and vdir match the GNU default quoting
cp: --no-preserve is retained over a later --preserve, and --attributes-only gives the destination the source's type
Error messages and exit codes aligned with GNU in uniq, chgrp, factor, date, expr, od, tty, tsort and pathchk
truncate finally implements --io-blocks, and date accepts multiple --reference
Security Hardening
ls: report stat() failures on directory entries instead of silently showing wrong metadata
sort: temporary files are created with mode 0600 instead of the umask, the -o output copy is kept private too, and a failure to truncate the output file is now reported
install: the fd-based destination is created exclusively and at 0600
rm, chmod, chown, chgrp: --preserve-root compares (st_dev, st_ino) rather than the path
chcon walks directories with DirFd instead of fts
SECURITY.md now requires a boundary crossing, not just a GNU divergence, for a report to be treated as a vulnerability
Robustness
Panics and overflows fixed in stat (out-of-range octal escape), ls (a color style with no attributes), split (a huge -n l/K/N chunk count), truncate (a size above i64::MAX no longer creates the file), cksum (an over-length BLAKE2b digest in a check file) and uucore (invalid input lines)
tsort handles invalid UTF-8 input and flushes stdout properly; date reports invalid UTF-8 lines in -f input; truncate supports non-UTF-8 paths for --reference
Dependency Diet
expr replaces onig with fancy-regex, removing a C dependency and the CI hacks that came with it. As a side effect, expr switched to leftmost-longest regex matching, matching GNU
mv replaces fs_extra with std directory sizing; fts-sys is gone; cksum uses aws-lc instead of vendored OpenSSL on MSVC, so a Perl install is no longer needed to build on Windows
bstr default features disabled, uucore's hand-rolled process functions dropped in favor of rustix
Cross-platform Reach
Windows: nice (with a Priority Class mapping), nohup and hostid now build, dirname handles backslashes, user locale detection landed, checksum paths use forward slashes, and mv, sync, hostname, touch and rm moved to safe std APIs
uucore on Windows: fsext rewritten with safe Win32 wrappers, real free space and mount paths; df resolves paths by mount prefix
New and improved targets: aarch64-unknown-linux-ohos, AIX (fsext), Haiku (fs), Hurd (signals), NetBSD (safe-traversal), plus wider process, utmpx and entries support
WASI: cp attribute preservation and reflink handling, mktemp temporary directories, tail integration coverage
macOS: tail stdin-redirect, pid and follow-name tests re-enabled
Performance
sort gained benchmarks for spilling, checking and shared prefixes; du benchmarks now warm the OS page cache before timing
cp avoids resolving the cwd for absolute recursive copies; tsort gives the OS a sequential access hint
A significant performance gap with GNU is now stated in the README as a bug, and we handle it as one
sysutils/uutils-coreutils: update to 0.11.0
Rust Coreutils 0.11.0 Release:
We are happy to announce the release of Rust Coreutils 0.11.0 - a release focused on error messages, performance and GNU compatibility.
The big change is a new diagnostic engine built on ariadne. When a chmod mode, a cut list, a sort key or a tr set fails to parse, we now echo the arguments back with a caret under the character at fault, like a compiler does. See our blog post for more information: https://uutils.org/blog/2026-08-error-diagnostics/
PGO release builds are enabled for Linux, macOS and Windows (up to 31% faster), and a lot of per-utility optimization work landed on top of that. We also now treat a utility being significantly slower than GNU as a bug.
We continued to improve the GNU compatibility and we are now at 653 passing, 22 failing, 0 errors.
Highlights:
Modern Error Diagnostics (new)
A new diagnostic engine based on ariadne. When stderr is a terminal, a parse error is printed as a report: the arguments are echoed back as a source line, a caret marks the culprit and a help line explains the syntax. See the blog post for before/after examples
Carets landed in chmod, mkdir, mkfifo, mknod, install, tr, expr, sort, numfmt, cut, env, head, tail, truncate, split, shred, stdbuf, od, seq, dd, stat, join, csplit, ls, df and du
A caret can point inside a quoted argument and at a single character. The reports are localized (format, checksum and advice strings) and still print the usual Try '... --help' hint. A label is only added when it says something useful
UUTILS_DIAG controls the behavior, and the caret rendering can be compiled out for size-constrained builds
Diagnostics are written in a single stderr call, so concurrent writers cannot interleave them
Performance
PGO (profile-guided optimization) release builds: up to 31% faster - now enabled for the published Linux, macOS and Windows artifacts too.
cp: opens the file only once (+32.93%) and reuses the already-open destination fd when a reflink clone falls back
join: 1.37x faster on paired input, 2.5x faster than GNU, by skipping the locale comparison when it cannot change the result
od --skip-bytes uses splice(2) on non-seekable input; tac uses fast_copy; dd no longer faults in the whole copy buffer before reading and page-aligns its read buffer
Fewer allocations and syscalls in ptx (+4% via fxhash, plus fewer per-word allocations), nl (hoisted per-line prefix), tail (no double allocation per reverse chunk, no stat), expand/unexpand (no stat/is_dir), numfmt and sort
New benchmarks for ptx, basenc and the numfmt stdin path
A utility being significantly slower than GNU is now considered a bug - please report it as one
GNU Compatibility
653 passing GNU tests (+8), 23 failures (-6) and no erroring test
New GNU-matching options: uname -A/--all-labeled, cut -F and --whitespace-delimited, pr --columns/--join-lines/-f alias and an optional argument for -n
Behavior fixes in pr (page length of exactly 10, columns that do not divide evenly, -e at the end of a cluster), numfmt (leading +, scientific notation), uniq/truncate/paste (a repeated option overrides the earlier one), join -o accumulating fields, id group ordering, unexpand/expand tab-list separators, mkdir EEXIST, more -f/-l, fold widths, sort -t=, stat nanosecond timestamps and Block size, od 16 significant digits, date trailing timezones
A new gnu/usage_vs_refs.sh check verifies that every option we document also appears in GNU's texi docs
More error messages carry the real OS text instead of a stripped or made up one (rm, env, od, chroot, stdbuf, tee, cut, date, tsort, pathchk, sort)
Security Hardening
mv/cp: xattr TOCTOU fixed by moving to file-descriptor-based operations
rm: no longer follows a symlink swapped in at the -r operand
chmod: uses fchmodat for recursive mode changes and no longer follows in-tree symlinks with -R --reference
cp: does not chmod through the destination symlink; mv does not put a symlink in its target's hardlink group
stdbuf: fixed a temporary-directory leak
Robustness: Anti-Panic & Anti-Hang
Hangs fixed: split endless loop, yes deadlock, sort Lines fuse when a chunk boundary lands exactly at EOF
Panics and aborts fixed in stat and csplit on /dev/full, ls with an invalid QUOTING_STYLE on unwritable stderr, od on large ASCII dump widths, printf on large numeric and %s/%c field widths, nl with -w i32::MAX (rejection plus a 32-bit OOM fix), pr and csplit integer overflow, dd u64 wraparound, touch leap-second year overflow, tail -c +N past the seek limit, tac SIGBUS on a truncated mmap, who -q stdout write errors
uucore::parse_size no longer overflows on a large % size
Cross-platform Reach
Windows: kill and uptime implementations, and test -ef, -t, -h/-L, -r, -w, -x
WASI: touch timestamps, cp symlinks, expr, cleaned-up core platform abstractions and cat integration coverage
df got a fallback statfs path using the mount table; uptime dropped its /proc dependency on more targets; stty and chgrp are now gated by target support; better iOS and Fuchsia handling
Dependency Diet
Dropped byteorder, same-file, filetime, winapi-util, file_diff, mockstream, binary-heap-plus, compare, arrayref, exacl and dns-lookup in favor of std, rustix and windows-sys
Internationalization
Symbolic mode parsing errors, the chmod --verbose messages and the new diagnostic strings are now translatable
ls sorts names using locale-aware collation, comm compares lines with the locale collation, nl supports multibyte one-character section delimiters and cut handles multibyte fields, bytes and delimiters correctly
uucore rebuilds its embedded locales when the consumer's dependencies change
sysutils/uutils-coreutils: import security fix Pull the package sources from unreleased git-hash https://github.com/sylvestre/coreutils/commit/dba580dc057007bc153098b7a5aac3f0bd9aeea7 in order to fix the reported security issue in https://github.com/uutils/coreutils/issues/13939 Bump package revison.
sysutils/uutils-coreutils: update to 0.10.0
Rust Coreutils 0.10.0 Release:
We are happy to announce the release of Rust Coreutils 0.10.0 - a release focused on GNU compatibility and robustness. The GNU test suite results improved sharply this cycle (645 passing, 29 failing, down from 56), we landed a second wave of security hardening (TOCTOU races, safe recursive descent, SELinux labeling at creation, backup guards), and we ran a broad anti-panic campaign across the utilities. On top of that: new features (mv --exchange and an OpenSSL backend for the checksum utilities), more zero-copy/read-ahead performance work, and wasm32-wasip2 support.
Highlights:
GNU Compatibility
645 passing GNU tests (+20) and 27 fewer failures, the largest single-cycle drop we have had
Dozens of behavior alignments: pr (-w/-W/-l/-e/-o, merge mode, page ranges), nproc (cgroups v2 quota, affinity mask, offline cores, OMP_* handling), date (out-of-range years, -d -, O modifier, timezone strings), numfmt, ls, du, install, od, truncate, fold, head/tail, sum, stat
Many error messages now carry the file name and the real OS error instead of a vague or stripped message
Security Hardening
Continued the TOCTOU work started in 0.9.0: touch no longer uses O_TRUNC on create, mkfifo drops the path-based chmod, head checks the open fd instead of the path, split hardens the output-open path, chcon anchors recursive relabeling to the traversal dirfd
Safe recursive descent fixes for chmod/chown (symlink cycles, --preserve-root re-checked during the descent), and cp no longer descends into a destination subdirectory that is a symlink
SELinux labels are now applied at creation in mkdir, mkfifo and mknod instead of being applied afterwards
mv fails closed when recreating a cross-device directory destination, compares file identity in the --backup=simple guard, and strips setuid/setgid when a cross-device copy cannot preserve ownership
chroot chroots exactly the path --skip-chdir validated; stdbuf refuses a libstdbuf path that cannot be represented in LD_PRELOAD; install finalizes ownership before mode
Added SECURITY.md documenting our threat model, scope and reporting process
Robustness: Anti-Panic Campaign
Removed panics and aborts across a long list of utilities: shuf, printf, numfmt, fmt, pr, chroot, dircolors, install, ln, touch, stat, split, expand, more, kill, cp, du, rm, runcon, sort, chown/chgrp, dirname, expr, cksum, dd, truncate, hashsum
Recurring classes fixed: write failures on /dev/full, char-boundary panics on multibyte input, integer overflow on extreme widths/precisions/sizes, and unbounded allocations for huge arguments
expr now uses an iterative parser, so deeply nested expressions no longer overflow the stack
New Features
mv --exchange to atomically swap two paths
install --reflink support, and install -C now works with --preserve-timestamps
OpenSSL backend for the faster checksum utilities
cut -O as a short option for --output-delimiter
rm --one-file-system
timeout now works on Windows, and tail -f/-F finally follows files on Windows
Performance
Read-ahead hints across the cksum family, sum, split, expand/unexpand and the base* utilities
tee zero-copy fast path; cat throughput improvements; faster non-reflink cp; cross-device mv via the fast copy path
expr: index went from O(N*M) to O(N+M); uniq and du improvements; tsort now buffers its output
New benchmarks for expr, tr, cut, uniq and locale-aware sort merges
Internationalization
cut supports multibyte characters in non-UTF-8 locales
ls uses Unicode quotes for the locale/clocale styles in UTF-8 locales and escapes non-ASCII control characters
Fixed C.UTF-8 being detected as ASCII, and incomplete Fluent fallback bundles
cksum quotes file names in a locale-aware way
Cross-platform Reach
New wasm32-wasip2 target support
Windows: timeout implementation, sparse copy support in cp, tail -f, cksum CRLF fix
ls --numeric-uid-gid on non-unix platforms, uptime uses CLOCK_BOOTTIME on more platforms
Code Quality
clippy::collapsible_if and clippy::match_same_arms are now clean and enabled workspace-wide
Continued nix → rustix migration (dd, kill, sync, uptime) and further removal of unsafe and to_string_lossy
Contributions: This release was made possible by 50 new contributors joining our community
sysutils/uutils-coreutils: update to 0.9.0
Rust Coreutils 0.9.0 Release:
We are excited to announce the release of Rust Coreutils 0.9.0 - a release focused on safety and security.
This cycle was shaped by a third-party security audit, driving extensive TOCTOU hardening and a sustained,
project-wide effort to shrink the amount of unsafe code by removing it outright and migrating low-level
syscalls from nix/libc to rustix.
On top of that, we landed major zero-copy I/O performance work (splice/tee/pipe), broadened WebAssembly,
Cygwin and Windows support, and continued contributing tests and bug reports upstream to GNU coreutils.
Highlights:
GNU Compatibility & Upstream Contributions
629 passing tests (+7 from 0.6.0), with 19 new tests added from the GNU 9.10 update
Updated GNU test reference from 9.9 to 9.10
Contributed numerous patches upstream to GNU coreutils, benefiting both projects
New GNU compatibility fixes across date, fmt, kill, ptx, numfmt, cksum, and more
Took over maintenance of num-prime, the primality testing library used by factor
Performance Overhaul
Faster hash maps: rustc-hash in ls, du, tsort, shuf, mv; foldhash in sort
unexpand/expand: ASCII fast-path, buffered reads — 14%+ gain in unexpand
shuf, split, sort, du: Reduced malloc allocations (+3–6% in du, +4% in shuf)
nl: Optimized with itoa and direct writing
true/false: Removed clap dependency, smaller binary, faster startup
uucore: Disabled signal setup in simple utilities for binary size and startup speed
Robustness: Eliminated /dev/full Panics
Fixed panics when stderr is /dev/full across 20+ utilities (echo, date, sort, expr, hostname, id, comm, pr, dircolors, and more)
Generic fix ensuring unrecognized options with 2>/dev/full do not abort
Safety & Code Quality
Replaced unsafe libc calls with safe nix crate wrappers in uucore (umask, mkdirat, and more) and mknod
Eliminated TOCTOU races in ln, tac, and install -D
rm: --preserve-root now works correctly on symlinks
MSRV updated to 1.88
Notable Bug Fixes
date: Extensive fixes — -u/-s/-d flags, timezone abbreviation lookup and DST, RFC-822 format, %+/%_ modifiers, --debug, locale date_fmt
cp: Readonly directories, -a/-z flags, special files, non-UTF-8 directory names
mv: Preserve symlinks during cross-device moves, handle FIFOs in directories
ls: Hyperlink OSC 8 format, dired reports, fd leak on deep recursion, invalid UTF-8 hidden files
sort: Collator panic in worker threads, scientific notation parsing
paste: Multi-byte delimiters, GNU escape sequences, bounded buffering
printf: %q shell quoting with control chars and quotes
ptx: -t/--typeset-mode, multibyte Unicode panic, GNU default behavior
numfmt: --debug flag, empty delimiter, null byte handling, error message formatting
cksum: SHAKE algorithms, --binary/--text/--tag errors
cut, tac, tail, tr, uniq, od, chroot, stat, mktemp, pr, readlink, ln, kill, nproc, rm, env, sync, fmt, factor, wc: Various GNU compatibility and correctness fixes
Platform Support
NetBSD and PowerPC build fixes
Windows: tac stdin piping, test -r/-w/-x, publish static *.exe binaries
WebAssembly: Publish *.wasm artifacts
stdbuf: Support libstdbuf in same directory as binary
NixOS test compatibility fix; added security audit workflow
What's Changed
cat
cat: strip errno by @oech3 in #10885
cksum
*sum: Fix locales fetching from checksum_common after installation by @RenjiSann in #10575
*sum: Fix read_byte_lines discarding read errors by @RenjiSann in #10671
test/cksum: implement test_signed_checksums by @0xMillyByte in #10714
cksum: Accept SHAKE algorithms by @RenjiSann in #10772
cksum family: Backport new errors for --binary, --text and --tag by @oech3 in #10618
cksum family: Fix clippy::unnecessary_wraps by @oech3 in #11110
chroot
chroot: fix gid being set by uid with --userspec #10307 by @cerdelen in #10465
chroot: use var_os by @xtqqczze in #11070
comm
comm /etc/pacman.conf /dev/null 2>/dev/full does not abort by @oech3 in #10746
date, comm, tty: Fixing handling output to dev/null by @ChrisDryden in #10888
coreutils
tests/misc/coreutils.sh: Fail with invalid binary name by @oech3 in #10258
coreutils: output expected error for unrecognized options by @ChrisDryden in #9869
coreutils: Let the name *utils valid by @oech3 in #10729
coreutils: Fix 2>/dev/full aborts & drop a sed for GnuTests by @oech3 in #10740
all: --typo 2>/dev/full does not abort by @oech3 in #10764
Add regression test for coreutils --list by @oech3 in #10858
cp
cp: fix recursive copy of readonly directories by @nikolalukovic in #10529
cp: improve code clarity and remove redundant filesystem checks by @sylvestre in #10790
cp: fixing cp -a functionality to match gnu implementation for -z flag handling and for folders by @ChrisDryden in #10207
cp: Fix panic when recursively copying a directory with a non-UTF8 name by @aweinstock314 in #11148
cp: handle special files by @victor-prokhorov in #11163
csplit
refactor(csplit): use &str slices for patterns by @xtqqczze in #11013
csplit: add benchmarks for line number and regex pattern splitting by @sylvestre in #10927
cut
cut: fix -s flag for newline delimiter and optimize memory allocation by @akervald in #11143
cut: two simple refactorings by @cakebaker in #11194
date
date: fix -u flag to match GNU behavior for input parsing by @ChrisDryden in #10715
date: Fix format optional argument to capture all following parameters by @cerdelen in #10914
date: fix -s UTC conversion losing timezone offset by @yachi in #10828
date: fix RFC-822 format to always use English names by @sylvestre in #10932
date: bump parse_datetime & add test for leap-1 GNU test by @sylvestre in #10933
date: add tests to match GNU's by @sylvestre in #10939
date: fix double periods in Hungarian month abbreviations by @naoNao89 in #10945
date: fix subfmt-up1, fill-1, pct-pct, and invalid-high-bit-set tests / implement --debug by @sylvestre in #10940
date: use locale date_fmt instead of D_T_FMT for default format by @ChrisDryden in #10935
date: Fix Error message missing '+' for format string after valid d flag by @cerdelen in #10982
date: fix -d with relative dates and timezone abbreviations by @yachi in #10956
date: fix timezone abbreviations using wrong offset outside their DST season by @aguimaraes in #11045
date: fix %+ and %_ modifier edge cases by @naoNao89 i...
sysutils/uutils-coreutils: import package uutils coreutils is a cross-platform reimplementation of the GNU coreutils in Rust. While all programs have been implemented, some options might be missing or different behavior might be experienced. This project aims to be a drop-in replacement for the GNU utils. Differences with GNU are treated as bugs. uutils aims to work on as many platforms as possible, to be able to use the same utils on Linux, Mac, Windows and other platforms. This ensures, for example, that scripts can be easily transferred between platforms.