Skip to content

more: use OS errors instead of hardcoded locales - #14085

Open
Devel08 wants to merge 2 commits into
uutils:mainfrom
Devel08:more-use-os-error
Open

more: use OS errors instead of hardcoded locales#14085
Devel08 wants to merge 2 commits into
uutils:mainfrom
Devel08:more-use-os-error

Conversation

@Devel08

@Devel08 Devel08 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This PR replaces hardcoded error message with native OS error

@codspeed-hq

codspeed-hq Bot commented Aug 22, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 5.05%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 177 untouched benchmarks
⏩ 229 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation numfmt_stream_to_si_precision 330.4 ms 348 ms -5.05%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing Devel08:more-use-os-error (86a2a6f) with main (a9b64fc)2

Open in CodSpeed

Footnotes

  1. 229 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 (71ebb92) during the generation of this report, so a9b64fc was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.
Congrats! The gnu test tests/dd/no-allocate is now passing!
Skip an intermittent issue tests/tail/tail-n0f (was skipped on 'main', now failing)

more-error-is-directory = {$path} is a directory.
more-error-cannot-open-no-such-file = cannot open {$path}: No such file or directory
more-error-cannot-open-io-error = cannot open {$path}: {$error}
more-error-is-directory = {$path}: Is a directory

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.

Where is the place more-error-is-directory cannot be replaced by os error? (Removing it at another PR is fine).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

File::open() doesn't throw an error when a file is a directory, thus we have to check that manually

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.

EISDIR (or EPERM) is returned when read was called for directory. So the arm

Self::IsDirectory(path) => {
write!(
f,
"{}",
translate!(
"more-error-is-directory",
"path" => path.quote()
)
)
}
can be removed on many unix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah it's returned on read, but the message will look something like "more: Is a directory", the path will be missing, if we rely on the message that read returns, should we let read's message or the custom locale?

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.

I'll fix this at different PR using format! or something else.

@codspeed-hq

codspeed-hq Bot commented Aug 24, 2026

Copy link
Copy Markdown

Unable to generate the performance report

There was an internal error while processing the run's data. We're working on fixing the issue. Feel free to contact us on Discord or at support@codspeed.io if the issue persists.

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.

3 participants