Skip to content

stty: Implemented saved state parser for stty#9480

Merged
sylvestre merged 18 commits into
uutils:mainfrom
ChrisDryden:save_state_stty
Nov 26, 2025
Merged

stty: Implemented saved state parser for stty#9480
sylvestre merged 18 commits into
uutils:mainfrom
ChrisDryden:save_state_stty

Conversation

@ChrisDryden

@ChrisDryden ChrisDryden commented Nov 25, 2025

Copy link
Copy Markdown
Collaborator

A missing feature in the implementation currently is the ability to read values that look like the format:

6d02:5:4bf:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:ff:12:f:17:16:ff:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

Apart from this, is the last feature missing for stty for the main stty test is the COLUMN env var. I implemented three integ tests for this new code that matches the types of tests that are run in the stty GNU tests.

This ended up being way more complicated than I originally envisioned after I had set up the GNU comparisons to run in the integration tests across multiple platforms. I learned that the amount of control flags is actually determined by a LIBC variable and that the GNU implementation had additional error messaging associated with the arg parsing error messages that we were not adding.

There is also still an pre-existing issue where the output of the control flag state is not being printed correctly, so for me to add an integration test to compare the printed output of the save state between GNU and the UUTILS implementation I will have to wait until that issue is addressed. Its already starting to become a long PR so was hoping to create this one to purely focus on the state saving and then can address the printing issues and flags in other PR's since it might involve upstream NIX changes.

@ChrisDryden ChrisDryden marked this pull request as ready for review November 25, 2025 05:47
@ChrisDryden ChrisDryden changed the title Implemented saved state parser for stty stty: Implemented saved state parser for stty Nov 25, 2025
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

Comment thread src/uu/stty/src/stty.rs
Comment thread src/uu/stty/src/stty.rs
Comment thread src/uu/stty/src/stty.rs
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@ChrisDryden

Copy link
Copy Markdown
Collaborator Author

The new testing I added brought up an issue that the GNU tests are being skipped without error if the version of GNU is not high enough, this likely causes blind spots in our CI testing and should be fixed.

I thought everything was matching the GNU implementation until I upgraded the GNU version and discovered that the messaging was quite different.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

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

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@codspeed-hq

codspeed-hq Bot commented Nov 26, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #9480 will not alter performance

Comparing ChrisDryden:save_state_stty (c571552) with main (b2d1117)

Summary

✅ 126 untouched
⏩ 6 skipped1

Footnotes

  1. 6 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.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@ChrisDryden

Copy link
Copy Markdown
Collaborator Author

Its a bit tough to figure out what the full scope of this PR should be, now that we have the integ tests running on many platforms I am discovering that various parts of the program are not matching the GNU implementation. I am going to try to disable the tests that are failing for reasons that aren't related to the state parsing but instead the flag printing and plan on following up on adding more testing and fixing the bugs in following PR's since this is already over 200 lines

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

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

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre merged commit 824c5c7 into uutils:main Nov 26, 2025
127 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.

2 participants