coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

printf: accept non-UTF-8 input in FORMAT and ARGUMENT arguments

Open jtracey opened this issue 11 months ago • 17 comments

Rebases #6812 on #7208.

EDIT: Now also includes a commit from me to pass the printf-mb GNU test, as well as a few other odds and ends. Fixes #6804.

jtracey avatar Jan 25 '25 06:01 jtracey

This is just a rebase, it compiles and passes our tests, but there are still some kinks to work out to get it to work as expected/pass GNU tests.

jtracey avatar Jan 25 '25 06:01 jtracey

GNU testsuite comparison:

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

github-actions[bot] avatar Jan 25 '25 06:01 github-actions[bot]

needs to be rebased again :/ Sorry

sylvestre avatar Feb 16 '25 23:02 sylvestre

GNU testsuite comparison:

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

github-actions[bot] avatar Feb 22 '25 02:02 github-actions[bot]

Rebased on #7208 again. This still needs some cleaning up IMO, but I'm going to hold off until #7208 gets merged.

jtracey avatar Feb 22 '25 02:02 jtracey

GNU testsuite comparison:

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

github-actions[bot] avatar Apr 30 '25 19:04 github-actions[bot]

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/stdbuf (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Apr 30 '25 20:04 github-actions[bot]

Force push before the most recent is the last with the individual commits from #6812, most recent force push squashes them into one and adds my fixes in another commit. Final rebased #6812 commits before squashing are: 9eddbcaabfbf97a541595a23b736f3b4f5b70ead a9f53a6c998a41c4ea3157d89e41576e000e042a bc7516aa380712557604bf46127d6b06949906b7 2ec24339f47922e9a88b739f401ee8f1bdeb1a65

jtracey avatar May 03 '25 01:05 jtracey

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/printf/printf-mb is no longer failing!

github-actions[bot] avatar May 03 '25 01:05 github-actions[bot]

To spell out a bit what my commit does: there was some redundant handling of various pieces of parsing format arguments, each with their own bugs. I minimized and simplified that, and got most things to only being implemented once in more proper locations, so that, e.g., behavior no longer differs between %i and %d format strings (aside from the type), misc. utils like seq no longer accept things like 'a as numbers, etc.

jtracey avatar May 03 '25 02:05 jtracey

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/printf/printf-mb is no longer failing!

github-actions[bot] avatar May 03 '25 02:05 github-actions[bot]

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (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)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/printf/printf-mb is no longer failing!

github-actions[bot] avatar May 05 '25 17:05 github-actions[bot]

@sylvestre: This is ready for review btw (no rush, just pinging in case the status change didn't).

jtracey avatar May 10 '25 01:05 jtracey

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/printf/printf-mb is no longer failing!

github-actions[bot] avatar May 27 '25 02:05 github-actions[bot]

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/printf/printf-mb is no longer failing!

github-actions[bot] avatar May 29 '25 00:05 github-actions[bot]

Sorry for any duplicate notifications, GitHub did something weird because I grouped my responses in a review.

jtracey avatar May 30 '25 03:05 jtracey

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/printf/printf-mb is no longer failing!

github-actions[bot] avatar May 30 '25 03:05 github-actions[bot]

@jtracey ping ? ^^

RenjiSann avatar Jun 30 '25 16:06 RenjiSann

Sorry, in the middle of a move + new job. I'll try to get to this in the next week. I wouldn't be offended if someone else wanted to take it over, though that would start to be a real pile of authors, so if this is pressing it might be simpler to merge as-is, then take a look at @drinkcat's suggestions (haven't had time to look in depth, but at a glance they don't seem unreasonable).

jtracey avatar Jul 07 '25 12:07 jtracey

Goodness, even a rebase was challenging, ended up squashing 2 commits together to make the rebase slightly easier, preserved author info in commit message. #8329. I'll try to apply the changes I suggested, next.

drinkcat avatar Jul 11 '25 02:07 drinkcat

Obsoleted by #8329

jtracey avatar Jul 15 '25 01:07 jtracey