Skip to content

Conversation

@RenjiSann
Copy link
Collaborator

@oech3 Can you take a look at this and let me know what you think ?

It will need some refactoring, because I started working on these before Christmas and it lacks your recent changes (namely #10057, #10055, #9999, #9998, #9996, and possibly others I'm not aware of). Additionally, I still need to handle other binaries.

@RenjiSann
Copy link
Collaborator Author

If we're proceeding with this, we'd better wait before merging all PRs related to #9992, so the refactor it's going to require isn't even bigger

@oech3
Copy link
Contributor

oech3 commented Jan 6, 2026

Requred: #10031 #10028 #10041

Doubeful: #10042 #10043 [--check vs legacy algos at clap] [--length to usize and default is 0 by clap]

I'm not sure do they really reduce size of your PR.

@RenjiSann
Copy link
Collaborator Author

My primary concern is not to reduce the size of the PR but to limit the complexity of the refactor, since I'll have to manually backport all the changes you did in the past 2 weeks.
I know for a fact that backports are usually very error-prone tasks.

#10031 can definitely wait for the split to have happened to reintroduce blake3 and shake in cksum.

The others, I'm not sure, maybe it's actually easier to remove all GNU error-handling compatibility code once and for all and I'll backport them as well, but that should be OK (ngl, it hurts a bit since I spent a good amount of time doing it not so long ago 🥹 )

@oech3
Copy link
Contributor

oech3 commented Jan 6, 2026

I also want to drop --[non-gnu digest] from hashsum.

it hurts a bit since I spent a good amount of time doing it not so long ago

Sorry...

@RenjiSann
Copy link
Collaborator Author

I also want to drop --[non-gnu digest] from hashsum.

Not really important if we're taking down hashsum in the end 🤔

@oech3
Copy link
Contributor

oech3 commented Jan 6, 2026

Yes. But we should restrict usage of it until we discard it. hashsum is already famous program...

@RenjiSann RenjiSann force-pushed the checksum-common-cli-bis branch 3 times, most recently from c7bd04a to 8ea0463 Compare January 6, 2026 20:17
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/shuf/shuf-reservoir is no longer failing!
Congrats! The gnu test tests/sort/sort-stale-thread-mem is no longer failing!

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 6, 2026

CodSpeed Performance Report

Merging this PR will improve performance by 6.05%

Comparing RenjiSann:checksum-common-cli-bis (14cf09d) with main (130f780)

Summary

⚡ 1 improved benchmark
✅ 138 untouched benchmarks
⏩ 37 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
cksum_blake3 224.9 µs 212.1 µs +6.05%

Footnotes

  1. 37 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@RenjiSann RenjiSann force-pushed the checksum-common-cli-bis branch from 8ea0463 to 5715ff3 Compare January 6, 2026 20:31
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

GNU testsuite comparison:

GNU test failed: tests/tty/tty-eof. tests/tty/tty-eof is passing on 'main'. Maybe you have to rebase?

1 similar comment
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

GNU testsuite comparison:

GNU test failed: tests/tty/tty-eof. tests/tty/tty-eof is passing on 'main'. Maybe you have to rebase?

@RenjiSann RenjiSann force-pushed the checksum-common-cli-bis branch from 5715ff3 to 5dde08a Compare January 6, 2026 22:57
@RenjiSann
Copy link
Collaborator Author

I'm still trying to adapt clap argument validation, and I have a small issue with ftl files loading, but the biggest part of the work is done.

To be honest, the more I work with it, the less I find added value in doing all the argument validation with clap, firstly because it does not produce understandable error messages, and also because it just CAN'T handle some behaviors correctly, the --text/--binary/--tag/--untagged hell being the best of examples.

For example, in the test test_cksum::output_format::test_text_binary, which runs cksum --text --binary,
clap will reject the command because it encountered --text without --untagged, even though it shouldn't since it is overwritten by --binary.

I know it is frustrating that clap does not fit our usecase, but that's how it is when trying to deal with legacy and backwards compatibility sadly 😔

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

GNU testsuite comparison:

Note: The gnu test tests/printf/printf-surprise is now being skipped but was previously passing.

@oech3
Copy link
Contributor

oech3 commented Jan 6, 2026

Yes. clap is not desined to provide a reason for error and bit buggy.

@RenjiSann RenjiSann force-pushed the checksum-common-cli-bis branch from 5dde08a to 81d54bd Compare January 6, 2026 23:37
@RenjiSann RenjiSann force-pushed the checksum-common-cli-bis branch from 81d54bd to 14cf09d Compare January 6, 2026 23:43
@RenjiSann
Copy link
Collaborator Author

RenjiSann commented Jan 6, 2026

I have a small issue with ftl files loading.

This is done !

Now for the not-clap argument validation, I can come up with 3 ideas:

  • I can do it here, by retrieving the code that was previously handling it, but that would make an even bigger PR

  • We can do it in a separate PR before or after, merging this one, ideally after because I don't want to do even more rebases, but if we do it after it means merging this PR with a definitely wrong behavior

  • Last option, maybe I can split this MR in 2 parts:

    1. introducing checksum_common and migrating cksum to it,
    2. AND implementing the new standalone executables after.

    That would let us patch the new checksum_common crate between the two, and avoid having definitely wrong code in main while not requiring to much rebasing work.

cc @oech3

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

GNU testsuite comparison:

GNU test failed: tests/shuf/shuf-reservoir. tests/shuf/shuf-reservoir is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/sort/sort-stale-thread-mem. tests/sort/sort-stale-thread-mem is passing on 'main'. Maybe you have to rebase?

@oech3
Copy link
Contributor

oech3 commented Jan 7, 2026

Would you wait a bit? I'm still trying to ctrl most things under clap.

I think everything working at my fork (waiting CI run...)

@RenjiSann
Copy link
Collaborator Author

superseded by #10142

@RenjiSann RenjiSann closed this Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants