Since Ubuntu started shipping the Rust rewrite of coreutils by default, I got curious how close it really is to the GNU tools in day to day edge cases.

So I wrote a small recorder. It runs a CLI on a few hundred cases and saves what it did: stdout, stderr, exit code and the files it touched. Then it replays the same cases against another binary and shows the diffs.

Pointed at GNU coreutils 9.12 vs uutils, most differences were not crashes. They were error message wording, exit codes, option parsing corners (a bare - being taken as an option value) and a few things that turned out to be GNU version differences rather than bugs.

I reported what I found upstream: 44 bug reports and 51 small fix PRs so far, 34 merged. The uutils folks have been great to work with.

The tool is open source (MIT), works on any CLI, not only coreutils: https://github.com/emirmrkaljevic/behave

Curious if anyone here has run into a uutils difference that broke a script for them.

you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 1 day ago (1 child)

So it's a more general purpose tool for various rewrites? Because uutils already has a lot of tests.

  • source
  • hideshow 1 child comment
  • [–] [S] 2 points 6 hours ago

    Yes, it is not tied to coreutils. I have also used it on findutils, sed and procps, and there are example recordings for jq. uutils does have a big test suite and also runs the GNU tests. The difference is that these cases are generated from each tool's --help and recorded from the GNU binary, so they catch small things nobody thought to write a test for, like the wording of an error or an exit code. The fix PRs I sent add those cases to the uutils suite.

  • source
  • parent