Skip to content

0.13.0

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Nov 06:53
· 6 commits to main since this release
Immutable release. Only release title and notes can be modified.

Rust Coreutils 0.13.0 Release:

We are happy to announce the release of Rust Coreutils 0.13.0 - a release focused on GNU compatibility of options and edge cases, and on safer file handling.
Most of the work went into the details that break scripts: conflicting or ambiguous options in sort, date format flags, dd conversions, ls time styles, tail --follow on symlinks, and what cp, mv, ln and install do when the destination is a symlink or a directory.

Alongside that, several utilities got faster (basenc base58 about 35x, cut +23%, date +22%, join +20%, etc), the WASI port got a lot of integration test coverage, a few more dependencies were dropped in favor of std, and more utilities now handle non-UTF-8 input.

We are now at 684 passing, 23 failing, 0 errors on the GNU test suite.

Counting only the tests that actually run, we are at 684/707 (96.7%).


GNU Test Suite Compatibility:

Result 0.12.0 0.13.0 Change 0.12.0 to 0.13.0 % Total 0.12.0 % Total 0.13.0 % Change 0.12.0 to 0.13.0
Pass 653 684 +31 94.36% 95.26% +0.90%
Skip 18 11 -7 2.60% 1.53% -1.07%
Fail 21 23 +2 3.03% 3.20% +0.17%
Error 0 0 0 0% 0% 0%
Total 692 718 +26 (new tests)

Note: the suite grew by 26 tests (backport of GNU tests), and 2 of them currently fail.


GNU testsuite evolution


Highlights:

  • GNU Compatibility

    • sort rejects conflicting -t, --compress-program and --check modes, validates --parallel like GNU, and rejects --debug together with -c/-C; merge batches and temporary files are handled more carefully
    • date matches the GNU case flags on %c, %p, %P, %r and %Z, keeps leading zeros of %N with a width, and uses the locale date format verbatim
    • dd: conv=ibm, conv=block and conv=unblock behave like GNU, and excl/nofollow are checked before seeking in an output FIFO
    • ls accepts unambiguous --time-style prefixes, applies two-line time formats to old and recent files correctly, and sorts command-line arguments by version properly
    • tail follows a symlink to its target, accepts the obsolete -cf form, and clamps --max-unchanged-stats instead of overflowing
    • printf and seq fix %f padding past 1000 zeros; split accepts a leading + in every number and retries short writes; pr, numfmt, stty, stat and od align more options and messages with GNU
  • Safer File Handling

    • cp no longer writes a recursive copy through a symlinked target, and checks relative symlink destinations against the working directory
    • mv and ln refuse to replace a directory with a symlink (or with --backup, -f, -i in ln)
    • chown/chgrp judge --preserve-root on the stat the traversal is pinned to; chmod -R -L reports dangling symlinks
    • install backs up a dangling symlink destination; install, cp and mknod warn when an explicit security context is ignored
    • rm escapes the operand in the --preserve-root error message
    • uucore: fixed EOVERFLOW in safe traversal
  • Robustness

    • Panics fixed on write failures for verbose output in rmdir, chcon, cp and tail, on write errors in numfmt, and in printf/seq on zero
    • Non-UTF-8 input is now preserved in date (format strings and --reference), stat error messages and shred diagnostics
    • uucore parses a NaN payload such as nan(1) and quotes a lone brace in the shell quoting styles; c-maybe quoting is supported
  • Performance

    • tr deletes bytes faster, basenc encodes and decodes base58 faster, and od streams its output line by line instead of buffering it
  • Dependency Diet

    • chroot, sync and the permission helpers use std instead of rustix; cp and dd use set_len instead of ftruncate; uucore no longer needs unsafe for gettid
  • Cross-platform Reach

    • WASI: integration tests enabled for seq, mv, fmt, readlink, dircolors, cksum, realpath, nproc, shred and join, a macro to document why a test is ignored, date clock support, and nice is no longer part of the default WASI build
    • Windows: ln converts / to \ in symlink targets, and cp handles a recursive copy of a root such as W:/
    • uucore detects ASIMD on big-endian aarch64 and builds stty on little-endian ppc64
  • Upstream: while chasing compatibility we found behavior GNU's own suite did not cover, and contributed 82 commits to GNU coreutils during this cycle, almost all of them new tests for edge cases both implementations share, plus two small fixes (tail, fmt)

  • Contributions: This release landed 931 pull requests from 92 new contributors


Call to Action:

Try it in your browser - Online Playground powered by WebAssembly
Help us translate - Contribute to Rust Coreutils on Weblate
Sponsor us on GitHub to accelerate development: github.com/sponsors/uutils

What's Changed

b2sum

base32

base64

basename

basenc

cat

chcon

chgrp

chmod

  • chown, chgrp, chmod: bind the recursive operand to a verified descriptor by @sylvestre in #14483
  • chmod: preserve metadata errors for overlong paths by @limadog9 in #15499
  • chmod: report every failure met under -R by @NdekoCode in #15166
  • chmod: accept modes like -=r, -+x and -,u+x by @fixfon in #15680
  • chmod: fix EROFS showing as Permission denied by @gabrielhnf in #12200
  • chmod: report umask conflict below the -R operand by @eylulseyit in #15885
  • chmod: keep operand order with --reference by @fixfon in #15676
  • chmod: print 'could not be accessed' with -v for operands that can't be stat'ed by @emirmrkaljevic in #15884
  • chmod: report dangling symlinks below the -R -L operand by @a7604 in #16162
  • chmod, chown: check --preserve-root on the directory actually descended into by @abendrothj in #14972
  • chmod: report the real error for files below the -R operand by @eylulseyit in #15935

chown

  • chown, chgrp, chmod: bind the recursive operand to a verified descriptor by @sylvestre in #14483
  • chown: allow non-utf8 path for --reference by @cakebaker in #14785
  • chown: set group to owner's login group on "OWNER:" by @varranvar in #15204
  • chown, chgrp: accept repeated flags like GNU by @excid3 in #15669
  • chown, chgrp: say 'cannot access' unless the operand is a dangling symlink by @emirmrkaljevic in #15868
  • chmod, chown: check --preserve-root on the directory actually descended into by @abendrothj in #14972

chroot

cksum

comm

cp

csplit

cut

date

dd

df

dircolors

dirname

du

env

  • env: apply the signal options in the order they are given by @paoValle in #15208
  • env: do not start a word for an unset variable in -S by @fixfon in #15877
  • env: require a command when --argv0 is given by @Logic769 in #16029
  • env: list the state of the signals, not the actions taken by @NdekoCode in #15186
  • env: take the value of -C, -u and -a as is, not as a -S string by @sylvestre in #16253
  • env: keep a leading = in values attached to short options by @MannXo in #15838
  • env: drop the ... after --debug in --help, and fix the flaky usage_vs_getopt by @sylvestre in #16534
  • env: support --env0-from by @wtcpython in #14609

expand

expr

factor

fmt

fold

groups

head

  • head: remove Default trait from HeadOptions by @cakebaker in #12261
  • head, tail: quote file names in the '==> name <==' headers by @sylvestre in #14710
  • head: remove a fn used just twice by @oech3 in #15043
  • head: honor the current stdin offset for -n -N and -c -N by @Logic769 in #16043
  • head: accept the l suffix in the obsolete -NUM syntax by @binhvq in #16610

hostname

id

install

join

ln

ls

md5sum

mkdir

mkfifo

mknod

mktemp

more

  • more: use OS errors instead of hardcoded locales by @Devel08 in #14085

mv

  • mv: symlink exponential walk fix by @mtvb in #14286
  • mv: use io::ErrorKind::CrossesDevices for rename fallback by @wtcpython in #14703
  • mv: keep copying xattrs after one fails in a cross-device move by @Cassian433 in #15049
  • mv: diagnose directory overwrites of symlink destinations by @limadog9 in #15366
  • mv: diagnose trailing slashes on regular-file sources by @limadog9 in #15379
  • mv: don't skip cross_device_xattr_failure_keeps_the_rest on tmpfs by @oech3 in #15904
  • mv: do not replace an empty directory with a symlink to a directory by @gibkim in #15914
  • mv: skip the same-file error with -n and --update=none by @emirmrkaljevic in #15825
  • mv: name the source in 'cannot overwrite directory' error by @emirmrkaljevic in #15725
  • mv: add 'cannot move' context to rename errors with two operands by @emirmrkaljevic in #15722
  • mv: warn when the destination doesn't support xattrs by @Cassian433 in #15101
  • mv: keep mode and xattrs of subdirectories on a cross-device move by @nishant9144 in #16222
  • mv: keep cross-device directories private until their mode is set by @Socialpranker in #16328

nice

nl

nohup

numfmt

od

paste

pathchk

pinky

  • groups, pinky: look up user operands by name only by @binhvq in #15860

pr

printenv

printf

  • printf: preserve failure status after character constant warning by @SichenLiang in #15033
  • printf: reject a * precision above INT_MAX for %s by @fixfon in #15670
  • printf: handles output of %q when input contains braces by @mikusgabriel in #16215
  • printf: quote ignored chars in the character constant warning by @tridev-tej in #16509
  • printf: take --help/--version as options only when alone by @binhvq in #16385
  • printf: accept a NaN payload such as nan(1) by @binhvq in #16413

ptx

pwd

  • pwd: explain failures when the working directory was removed by @limadog9 in #15494

readlink

realpath

rm

rmdir

  • rmdir: handle verbose output failures without panicking by @limadog9 in #15384

seq

  • seq: don't count the increment's integer digits for -w by @fixfon in #15601
  • seq, tac, numfmt, sum, ptx: accept repeated options like GNU by @frogscooper in #15892
  • seq: treat option-like arguments before the first operand as options by @emirmrkaljevic in #16114

shred

shuf

sort

split

stat

  • stat: add %Qn and quote names as GNU 9.12 does by @charly-mp in #14839
  • stat: truncate fractional pre-epoch timestamps toward zero by @mattsu2020 in #14975
  • stat: preserve non-UTF-8 filenames in error messages by @ddy314 in #14755
  • stat: replace while with for by @oech3 in #15452
  • stat: reject flag-only % directives closed by another % by @Franklin-Qi in #15411
  • stat: print a newline after --format output even if it ends with one by @qodelicious in #15469
  • stat: print the rest of a multibyte char after an unknown directive by @qodelicious in #15470
  • stat: let the last of --printf and --format win by @Logic769 in #16012
  • stat: print signed and unsigned values like GNU for %s, %S, %a, %b, %d, %f by @binhvq in #16370
  • stat: do not take a sign as part of the precision by @binhvq in #16458
  • stat: add the 0 of %#a only when the digits do not start with one by @binhvq in #16393
  • stat: drop a directive whose width or precision is above INT_MAX by @binhvq in #16481

stdbuf

  • stdbuf: fix build.rs to propagate custom profiles to libstdbuf by @Ecordonnier in #12462
  • stdbuf: fix stdio getters in libstdbuf by @Ecordonnier in #15480
  • stdbuf: fix test_stdbuf_reports_signalled_command when /bin/sh is bash by @lmilz in #16355
  • stdbuf: build.rs: give the nested cargo build its own build-dir by @mitar in #16525
  • stdbuf, GNUmakefile: support cargo 1.100.0 by @oech3 in #16487

stty

sum

sync

  • sync: replace rustix with std & extend cfg by @oech3 in #15733

tac

tail

tee

test

timeout

touch

tr

truncate

tsort

uname

unexpand

uniq

uptime

users

wc

who

whoami

yes

uucore

Testing

Code Quality & Cleanup

CI & Build

Documentation

Platform Support

Dependency Updates

Version Management

New Contributors

Full Changelog: 0.12.0...0.13.0