Skip to content

cksum: print file name for explicit - operand - #16031

Merged
RenjiSann merged 3 commits into
uutils:mainfrom
Logic769:cksum-explicit-stdin-filename
Nov 16, 2026
Merged

RenjiSann merged 3 commits into
uutils:mainfrom
Logic769:cksum-explicit-stdin-filename

Conversation

@Logic769

Copy link
Copy Markdown
Contributor

Problem

cksum - (an explicit - operand) printed the checksum without the file name, while GNU cksum prints - as the file name for an explicit operand. Only an implicit stdin (no operands) omits the name.

Change

Track whether the - operand was given explicitly on the command line and print the file name in that case. Added a regression test.

Closes #15984

@Logic769
Logic769 force-pushed the cksum-explicit-stdin-filename branch from 47a8a9b to 209f560 Compare October 30, 2026 13:02
@codspeed

codspeed Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 57.9%

2 warnings

⚠️ 109 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 3 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 8 improved benchmarks
✅ 183 untouched benchmarks
🆕 4 new benchmarks
⏩ 284 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ split_lines 14.4 ms 4.4 ms ×3.3
⚡ split_numeric_suffix 14.6 ms 4.6 ms ×3.2
⚡ factor_small_factors_and_a_large_prime 1,012.7 µs 682 µs +48.48%
⚡ join_partial_overlap 18.7 ms 15.1 ms +23.42%
⚡ join_full_match 21.8 ms 18.3 ms +19.19%
⚡ join_french_locale 21.8 ms 18.3 ms +19.15%
⚡ join_unicode_locale 2.2 ms 1.8 ms +19.1%
⚡ join_custom_separator 22.1 ms 18.8 ms +17.82%
🆕 factor_batch_of_largest_u64s N/A 557.4 ms N/A
🆕 factor_batch_of_semiprimes N/A 794.2 ms N/A
🆕 factor_batch_of_small_numbers N/A 138.6 ms N/A
🆕 factor_batch_of_smallest_u128s N/A 516.3 ms N/A

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing Logic769:cksum-explicit-stdin-filename (83bf46b) with main (fca3de1)2

Open in CodSpeed

Footnotes

  1. 284 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. ↩

  2. No successful run was found on main (3e2c890) during the generation of this report, so fca3de1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@Logic769
Logic769 force-pushed the cksum-explicit-stdin-filename branch from 209f560 to b99cd58 Compare November 2, 2026 01:02
Comment thread tests/by-util/test_cksum.rs Resolved
Comment thread tests/by-util/test_cksum.rs Resolved
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)

@sylvestre

Copy link
Copy Markdown
Contributor

a bunch of jobs are failing

@Logic769
Logic769 force-pushed the cksum-explicit-stdin-filename branch from 5a67d7b to efd813e Compare November 3, 2026 15:43
@sylvestre
sylvestre force-pushed the cksum-explicit-stdin-filename branch from efd813e to 90c914a Compare November 6, 2026 11:20
@Logic769

Logic769 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

CI note (environment issue, not related to the changes in this PR):

Two jobs failed on the latest run, both caused by CI infrastructure rather than by this change:

  • Tests → step "Prepare, build and test": the uucore unit tests passed (467 passed, 0 failed), but the following Doc-tests uucore step failed with error: extern location for libc does not exist: .../target/debug/deps/liblibc-....rlib and error[E0463]: can't find crate for ... (27 errors in total). The dependency .rlib artifacts under target/debug/deps were removed by a concurrently running make MULTICALL=Y build while the doctests were being compiled against them. Re-running the job rebuilds these artifacts.

  • Build (ubuntu-24.04-arm, aarch64-unknown-linux-gnu, feat_os_unix_gnueabihf, PGO) → step "Test": only test_tail::test_follow_when_files_are_pointing_to_same_relative_file_and_file_stays_same_size failed (6551 passed, 1 failed) with Expected stderr to be empty, but it's: tail: ...: file truncated. This is a timing-sensitive test in the tail -F follow family (the same test has also failed intermittently on other PRs' aarch64 PGO runs in the same window), and it is unrelated to this PR, which only touches cksum.

No code changes in this PR are involved; a rerun should be green.

@sylvestre
sylvestre force-pushed the cksum-explicit-stdin-filename branch from 90c914a to 946cef7 Compare November 8, 2026 11:08
@RenjiSann
RenjiSann force-pushed the cksum-explicit-stdin-filename branch from 5297f1b to c551b7f Compare November 9, 2026 13:16
@RenjiSann
RenjiSann enabled auto-merge (rebase) November 9, 2026 13:16
auto-merge was automatically disabled November 16, 2026 04:11

Head branch was pushed to by a user without write access

@Logic769
Logic769 force-pushed the cksum-explicit-stdin-filename branch from c551b7f to 83bf46b Compare November 16, 2026 04:11
@RenjiSann
RenjiSann enabled auto-merge (rebase) November 16, 2026 10:17
@RenjiSann
RenjiSann merged commit 50dfbbd into uutils:main Nov 16, 2026
157 of 196 checks passed
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.

cksum: explicit - operand is not printed as file name

3 participants