Skip to content

sort: defer compress program errors until needed - #13656

Open
wtcpython wants to merge 1 commit into
uutils:mainfrom
wtcpython:sort-compress-error-priority
Open

wtcpython wants to merge 1 commit into
uutils:mainfrom
wtcpython:sort-compress-error-priority

Conversation

@wtcpython

Copy link
Copy Markdown
Contributor

Fixes #13148.

Defer reporting compression program errors until external sorting is required, allowing earlier input errors to be reported without an unrelated compression warning.

@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

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

@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from d468737 to 8ab9b62 Compare August 5, 2026 09:35
@codspeed

codspeed Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 390 skipped benchmarks1


Comparing wtcpython:sort-compress-error-priority (8b27135) with main (5b2e6e0)

Open in CodSpeed

Footnotes

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

@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch 3 times, most recently from 828477d to 95b0ea3 Compare August 10, 2026 15:00
@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from 95b0ea3 to 9fe5d79 Compare August 14, 2026 03:20
@github-actions

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 148.97 MB (-132 KB, -0.09%)

Significant per-binary changes:
  [           1.10 MB ->    1.18 MB  (+76 KB, +6.74%)
  test        1.10 MB ->    1.18 MB  (+76 KB, +6.74%)
  install     1.25 MB ->    1.32 MB  (+72 KB, +5.62%)
  mkdir       1.10 MB ->    1.17 MB  (+72 KB, +6.38%)
  mkfifo      1.09 MB ->    1.16 MB  (+72 KB, +6.45%)
  mknod       1.10 MB ->    1.17 MB  (+72 KB, +6.41%)
  chmod       1.15 MB ->    1.22 MB  (+68 KB, +5.76%)

@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from 9fe5d79 to d14f018 Compare August 16, 2026 13:56
@wtcpython

Copy link
Copy Markdown
Contributor Author

Would you mind taking a look when convenient? Thanks!

Comment thread src/uu/sort/src/ext_sort/threaded.rs Outdated
if let Some((prog, err)) = compress_prog_error {
let _ = writeln!(
stderr(),
"sort: could not run compress program '{prog}': {}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the translate macro

"nonexistent-program",
"-S",
"10",
"1K",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems unrelated

@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from d14f018 to a97b03b Compare August 17, 2026 00:02
@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch 2 times, most recently from d077b2a to 03ee9d6 Compare August 31, 2026 01:23
@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from 03ee9d6 to 32a1dae Compare September 15, 2026 09:30
Copilot AI lite review requested due to automatic review settings September 15, 2026 09:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from 32a1dae to 596981d Compare September 19, 2026 01:38
Copilot AI review requested due to automatic review settings September 19, 2026 01:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from 596981d to 1b214b2 Compare September 24, 2026 07:39
Copilot AI review requested due to automatic review settings September 24, 2026 07:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from 1b214b2 to f936598 Compare September 25, 2026 00:55
Copilot AI review requested due to automatic review settings September 25, 2026 00:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 27, 2026 00:39
@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from f936598 to 25b047d Compare September 27, 2026 00:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from 25b047d to ba7cfef Compare September 29, 2026 06:09
Copilot AI review requested due to automatic review settings September 29, 2026 06:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from ba7cfef to ac8524a Compare September 30, 2026 03:20
Copilot AI lite review requested due to automatic review settings September 30, 2026 03:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI lite review requested due to automatic review settings October 1, 2026 11:40
@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from ac8524a to c4a433d Compare October 1, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 3 Medium severity · 1 Low severity

Open (4)

Comment on lines +215 to 225
#[allow(clippy::too_many_arguments)]
fn read_write_loop<I: WriteableTmpFile>(
mut files: impl Iterator<Item = UResult<Box<dyn Read + Send>>>,
tmp_dir: &mut TmpDirWrapper,
separator: u8,
buffer_size: usize,
settings: &GlobalSettings,
compress_prog_error: Option<(String, std::io::Error)>,
receiver: &Receiver<Chunk>,
sender: SyncSender<Chunk>,
) -> UResult<ReadResult<I>> {
Comment on lines +259 to +269
// The input did not fit into the first two in-memory chunks.
if let Some((prog, err)) = compress_prog_error {
show_error!(
"{}",
translate!(
"sort-compress-prog-execution-failed",
"prog" => prog,
"error" => strip_errno(&err)
)
);
}
ucmd.args(&["--compress-program=nonexistent", "input", "directory"])
.fails_with_code(2)
.no_stdout()
.stderr_contains("Is a directory")
Comment on lines +1708 to +1710
// Force external sorting by using 1K buffer size so ext_sort.txt spills to disk
"-S",
"10",
"1K",
@wtcpython
wtcpython force-pushed the sort-compress-error-priority branch from c4a433d to 8b27135 Compare October 2, 2026 10:41
Copilot AI lite review requested due to automatic review settings October 2, 2026 10:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

minorbug(sort): priotize the compress program over files

3 participants