Skip to content

Conversation

@tbu-
Copy link
Contributor

@tbu- tbu- commented Nov 15, 2025

Check _STDBUF_O and _STDBUF_E environment variables for setting up stdout and stderr. This makes Rust programs compatible with coreutils's (and uutils's) stdbuf program. It incidentally also solves uutils/coreutils#7967.

This lays ground work for solving #60673 because it lets the user of a Rust program decide the default buffering, offering the opportunity to change the current default, letting stdout buffer blockwise if it's not connected to a terminal, because the user can now override the behavior using stdbuf if it's needed.

andreacorbellini and others added 2 commits November 15, 2025 23:45
Check `_STDBUF_O` and `_STDBUF_E` environment variables for setting up
stdout and stderr. This makes Rust programs compatible with coreutils's
(and `uutils`'s) `stdbuf` program. It incidentally also solves
uutils/coreutils#7967.

This lays ground work for solving rust-lang#60673 because it lets the user of a
Rust program decide the default buffering, offering the opportunity to
change the current default, letting stdout buffer blockwise if it's not
connected to a terminal, because the user can now override the behavior
using [`stdbuf`](https://linux.die.net/man/1/stdbuf) if it's needed.
@rustbot rustbot added O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 15, 2025

r? @ChrisDenton

rustbot has assigned @ChrisDenton.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Nov 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 15, 2025

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@tbu-
Copy link
Contributor Author

tbu- commented Nov 15, 2025

Based on #148274 because it makes some of the changes I need here, as well.

@Mark-Simulacrum Mark-Simulacrum added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Nov 16, 2025
@Mark-Simulacrum
Copy link
Member

Nominating for libs-api to decide whether we want to support this configuration interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-libs-api-nominated Nominated for discussion during a libs-api team meeting. O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants