Skip to content

Allow non-utf8 paths name as input for most of the programs #8457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 84 commits into from
Aug 14, 2025

Conversation

sylvestre
Copy link
Contributor

  • add a fuzzer to verify that we don't regress in the future

Copy link

github-actions bot commented Aug 9, 2025

GNU testsuite comparison:

GNU test failed: tests/misc/realpath. tests/misc/realpath is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)

@cakebaker cakebaker linked an issue Aug 9, 2025 that may be closed by this pull request
@sylvestre sylvestre requested a review from cakebaker August 9, 2025 14:48
Copy link
Collaborator

@drinkcat drinkcat left a comment

Choose a reason for hiding this comment

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

Note: didn't review fuzzer, went all to way to expand.

That's... a huge amount of work, thanks! I'll keep reviewing another day ,-P

Copy link

github-actions bot commented Aug 9, 2025

GNU testsuite comparison:

GNU test failed: tests/misc/realpath. tests/misc/realpath is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Copy link

github-actions bot commented Aug 9, 2025

GNU testsuite comparison:

GNU test failed: tests/misc/realpath. tests/misc/realpath is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

Copy link

github-actions bot commented Aug 9, 2025

GNU testsuite comparison:

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

Copy link
Collaborator

@drinkcat drinkcat left a comment

Choose a reason for hiding this comment

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

expand->pathchk

more(
InputType::File(BufReader::new(opened_file)),
length > 1,
file.to_str(),
next_file.copied(),
Some(&file.to_string_lossy()),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you should fix more and Pager...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think it requires a bunch of changes, ok if I do that in a different PR ?
(and i don't think i regressed the current state)

Copy link
Collaborator

@drinkcat drinkcat left a comment

Choose a reason for hiding this comment

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

Note: Reviewed everything until the tests.

writeln!(
stdout,
"{sum:0width$} {blocks:width$} {}",
file.to_string_lossy()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is technically wrong, you should print the bytes (but you could just add a TODO).

Copy link

GNU testsuite comparison:

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

sylvestre and others added 21 commits August 14, 2025 10:52
Fixes issue introduced in b965c94 where
switching from NonEmptyStringValueParser to OsString parser removed
validation that arguments cannot be empty strings.

- Add custom NonEmptyOsStringParser that validates OsString is not empty
- Use the parser for FILES, --relative-to, and --relative-base arguments
- Add test case to verify empty strings are rejected with exit code 1
- Fixes GNU realpath test failure
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Co-authored-by: Nicolas Boichat <nicolas@boichat.ch>
Copy link

GNU testsuite comparison:

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

Copy link

GNU testsuite comparison:

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

@sylvestre sylvestre requested a review from cakebaker August 14, 2025 12:40
Copy link

GNU testsuite comparison:

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

@cakebaker cakebaker merged commit 5ba99ae into uutils:main Aug 14, 2025
92 checks passed
@cakebaker
Copy link
Contributor

Good work :)

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.

Make sure all tools handle non-Unicode filenames as parameters
3 participants