Adding TTY helper for unix to be able to create tests for stty and more#9348
Adding TTY helper for unix to be able to create tests for stty and more#9348sylvestre merged 2 commits intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
|
Hm, at least on my machine (with Arch Linux) all three tests fail with the same |
|
@cakebaker is your machine running glibc 2.42? I think this might be an underlying issue with the stty.rs implementation itself. |
|
It appears that this is a previously reported bug. #8474 The discussions about this are here: #8719 It appears that in the ubuntu implementation it has an ongoing patch that is not in main here: https://git.launchpad.net/~juliank/ubuntu/+source/rust-coreutils/tree/debian/patches/glibc-2.42.patch?h=ubuntu/devel&id=a16e77bec0546ee51770a891a24468e8048242e3 |
|
Apart from this discussion, that error message is not helpful at all. Should have a separate PR to clean up the unwraps and replace with better messaging |
|
I have been using docker to try and replicate this but have been unable to get a version to replicate this bug even with the latest fedora and arch-linux images. Is there a possibility that this has already been patched in 2.42? |
|
Nevermind found out how to reproduce it: It looks at build time glibc |
|
coverage: 87.23% (+0.53%) |
|
Yes. Arch's You can use |
|
@ChrisDryden yes, it's the issue reported in #8474 |
- Add panic handling with message suppression in print_terminal_size() - Remove unsafe unwrap() in combo_to_flags() - Fixes panic on systems with glibc 2.42 (Ubuntu 25.10, Arch Linux) - Speed display omitted on affected systems but all other functionality preserved Fixes uutils#8474 Related to uutils#9348, uutils#9430
- Add panic handling with message suppression in print_terminal_size() - Remove unsafe unwrap() in combo_to_flags() - Fixes panic on systems with glibc 2.42 (Ubuntu 25.10, Arch Linux) - Speed display omitted on affected systems but all other functionality preserved Fixes uutils#8474 Related to uutils#9348, uutils#9430
Currently the two biggest areas of missing testing coverage in this project are stty and more. These two do not currently have tests because it requires a pty to run the program. The nix crate contains helpers that allow you to create one and then the --file parameter of the location of the pty can be passed in as a parameter.
This is just a short PR to add the util functionality and a basic test, but will be able to build on this in the more and stty tests.