Skip to content

stty: support any baud on Linux, replace nix with rustix - #15299

Open
oech3 wants to merge 1 commit into
uutils:mainfrom
oech3:stty-unsafe
Open

oech3 wants to merge 1 commit into
uutils:mainfrom
oech3:stty-unsafe

Conversation

@oech3

@oech3 oech3 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

@codspeed

codspeed Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ 118 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 1 benchmark has no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 399 untouched benchmarks
⏩ 70 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation factor_five_38_bit_primes 1.6 s 1.7 s -5.48%
⚡ Simulation factor_three_39_bit_primes 567 ms 357.1 ms +58.78%

Tip

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


Comparing oech3:stty-unsafe (0ad3f39) with main (7654e67)

Open in CodSpeed

Footnotes

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

Comment thread src/uu/stty/Cargo.toml Outdated
Comment thread src/uu/stty/src/stty.rs Outdated
Comment thread src/uu/stty/src/stty.rs Outdated
Comment thread src/uu/stty/src/stty.rs Outdated
@oech3
oech3 marked this pull request as draft October 13, 2026 16:36
Comment thread src/uu/stty/src/stty.rs Outdated
@oech3
oech3 force-pushed the stty-unsafe branch 5 times, most recently from 8c0b529 to 39bc936 Compare October 13, 2026 17:09
@oech3 oech3 changed the title stty: remove unsafe & cfg stty: replace nix with rustix Oct 13, 2026
@oech3 oech3 changed the title stty: replace nix with rustix stty: support any baud on Linux, replace nix with rustix Oct 13, 2026
@oech3
oech3 force-pushed the stty-unsafe branch 2 times, most recently from ff11e70 to f100d7d Compare October 13, 2026 17:47
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Note: The gnu test tests/stty/bad-speed is now being skipped but was previously passing.

@oech3
oech3 force-pushed the stty-unsafe branch 2 times, most recently from 9be3124 to d420658 Compare October 13, 2026 18:30
@oech3

This comment was marked as outdated.

@xtqqczze

Copy link
Copy Markdown
Collaborator

Would it be possible to separate the refactor replacing nix with rustix from the fix for #8719 into separate PRs?

@oech3

oech3 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

It is very difficult since rustix automatically supports any baud and nix and rustix cannot be mixed.

@oech3

This comment was marked as resolved.

@oech3

This comment was marked as outdated.

@xtqqczze

xtqqczze commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #14989

@oech3 Could you please clarify in the PR description whether these changes support arbitrary baud rates across all platforms, or only on Linux?

@oech3

This comment was marked as outdated.

@xtqqczze

Copy link
Copy Markdown
Collaborator

@oech3 #14989 is not for Linux, is the issue fully resolved by this PR?

@oech3

oech3 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

I don't think that we need to support all labeled targets, but yes. https://github.com/bytecodealliance/rustix/blob/287214b889865d8e1406a0ee71cc409b6f6191c8/src/termios/types.rs#L740 .

Missing macOS and bsd are not problem since they use any baud (as same as nix).

Comment thread src/uu/stty/src/flags.rs Outdated
@xtqqczze

xtqqczze commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

By switching from nix to rustix we can support more platforms, e.g. AIX.

Comment thread src/uu/stty/src/flags.rs Outdated
Comment thread src/uu/stty/src/flags.rs Outdated
Comment thread src/uu/stty/src/stty.rs Outdated
Comment thread src/uu/stty/src/stty.rs
Comment thread src/uu/stty/src/stty.rs Outdated
Comment thread util/build-gnu.sh
@oech3
oech3 force-pushed the stty-unsafe branch 14 times, most recently from 3a756ab to 70ed160 Compare October 15, 2026 03:40
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
@oech3
oech3 force-pushed the stty-unsafe branch 2 times, most recently from a561bf5 to 0ad3f39 Compare October 15, 2026 04:41
@oech3
oech3 requested a review from sylvestre October 15, 2026 05:42

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.

stty: support B460800 and B921600 baud rates stty: support arbitrary baudrate (at least on linux) as GNU coreutils 9.8

3 participants