coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

date: fix interaction of flags, fix issues around --set

Open BenWiederhake opened this issue 1 year ago • 18 comments

This PR fixes multiple issues around multi-flags:

  • Many repeated flags used to be handled incorrectly; this is work toward #5998
  • We used to accept the --reference argument, but completely ignored it. Yikes!
  • Input, parsing, and output of --set was completely broken. This fixes it largely.
  • Input options (-d, -f, -r), formatting options (-I, -R, --rfc-3339), and --set are often mutually-exclusive, with the exception that input options override themselves (but not each other), and also --set can be combined with formatting options.

Some things are unfixable, in particular the order-sensitive behavior; see #4254#issuecomment-2026446634 and https://github.com/uutils/uutils-args/pull/113

BenWiederhake avatar Mar 29 '24 16:03 BenWiederhake

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Mar 29 '24 16:03 github-actions[bot]

"CICD / Build (macos-latest, x86_64-apple-darwin, feat_os_macos)" flaked:

---- test_stat::test_stdin_pipe_fifo1 stdout ----
run: /Users/runner/work/coreutils/coreutils/target/x86_64-apple-darwin/debug/coreutils stat -
run: /Users/runner/work/coreutils/coreutils/target/x86_64-apple-darwin/debug/coreutils stat -L -
thread 'test_stat::test_stdin_pipe_fifo1' panicked at ''  File: -
  Size: 0         	Blocks: 0          IO Block: 512    weird file
Device: 25d29ea1h/634560161d	Inode: 2178033826  Links: 0
Access: (0660/?rw-rw----)  Uid: (  501/  runner)   Gid: (   20/   staff)
Access: 2024-03-29 16:28:42.942290340 +0000
Modify: 2024-03-29 16:28:42.942290340 +0000
Change: 2024-03-29 16:28:42.942290340 +0000
 Birth: 1970-01-01 00:00:00.000000000 +0000
' does not contain 'fifo'', tests/by-util/test_stat.rs:286:10

All other failures appear to be known issues, too.

BenWiederhake avatar Mar 29 '24 16:03 BenWiederhake

Changes since last push:

  • Rebased on current main
  • Resolved trivial conflict in test_date.rs with #4657

BenWiederhake avatar Mar 30 '24 15:03 BenWiederhake

Changes since last push:

  • While resolving the conflict, I accidentally dropped the #[test] marker for a test. Whoops! Added it back in.

BenWiederhake avatar Mar 30 '24 15:03 BenWiederhake

Changes since last push:

  • Rebased to new main, due to conflict with #6160

BenWiederhake avatar Mar 31 '24 20:03 BenWiederhake

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Mar 31 '24 21:03 github-actions[bot]

Changes since last push: Nothing, just a rebase to show that it's still a good idea to do this.

BenWiederhake avatar Apr 06 '24 21:04 BenWiederhake

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Apr 06 '24 22:04 github-actions[bot]

CI failures seem to be only flakes:

  • #6331
  • #6275
  • Plus some stuff that looks like #3155?

Example:

---- test_pinky::test_short_format_q stdout ----
run: /Users/runner/work/coreutils/coreutils/target/x86_64-apple-darwin/debug/coreutils pinky -q
thread 'test_pinky::test_short_format_q' panicked at 'Command was expected to succeed. code: 101
stdout = Login     TTY      When            
runner   *console 
 stderr = thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: IndeterminateOffset', src/uucore/src/lib/features/utmpx.rs:192:62
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
', tests/by-util/test_pinky.rs:97:40

BenWiederhake avatar May 02 '24 14:05 BenWiederhake

Changes since last push:

  • Rebased to new main
  • Nothing more, I just want to remind that this PR exists and is still a good idea.

~~What else needs to be done?~~ EDIT: Those CI failures look suspicious, I'll have a look.

BenWiederhake avatar Jul 03 '24 02:07 BenWiederhake

Changes since last push:

  • Rebase on current main (that's around 100 commits!)
  • Split the gargantuan uumain function into four separate functions, as requested, and remove the corresponding clippy lint.

The only CI failure is #6534, as usual.

BenWiederhake avatar Aug 11 '24 21:08 BenWiederhake

GNU testsuite comparison:

Congrats! The gnu test tests/timeout/timeout is no longer failing!

github-actions[bot] avatar Aug 11 '24 21:08 github-actions[bot]