Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide optional Read/Write methods for stdio #136769

Merged
merged 4 commits into from
Mar 23, 2025

Conversation

thaliaarchi
Copy link
Contributor

@thaliaarchi thaliaarchi commented Feb 9, 2025

Override more of the default methods for io::Read and io::Write for stdio types, when efficient to do so, and deduplicate unsupported types.

Tracked in #136756.

try-job: x86_64-msvc-1

@rustbot
Copy link
Collaborator

rustbot commented Feb 9, 2025

r? @Noratrieb

rustbot has assigned @Noratrieb.
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 O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-wasi Operating system: Wasi, Webassembly System Interface 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. labels Feb 9, 2025
@rust-log-analyzer

This comment has been minimized.

@thaliaarchi
Copy link
Contributor Author

@joboet Looks like you wrote #136780 to have minimum conflicts to this. Thanks for that. I don't mind rebasing onto that, if yours is merged first.

@Noratrieb
Copy link
Member

r? joboet

@rustbot rustbot assigned joboet and unassigned Noratrieb Feb 12, 2025
@thaliaarchi thaliaarchi changed the title Provide optional Read/Write method for stdio Provide optional Read/Write methods for stdio Feb 13, 2025
@thaliaarchi thaliaarchi force-pushed the io-optional-methods/stdio branch 2 times, most recently from f51bb4e to 118bb74 Compare February 16, 2025 21:59
@thaliaarchi
Copy link
Contributor Author

I dropped a few commits from this PR:

@thaliaarchi thaliaarchi marked this pull request as draft February 19, 2025 04:37
@thaliaarchi
Copy link
Contributor Author

Since this touches a lot of targets, I'm going to split this into multiple PRs for more target-focused review, once #136780 goes through the merge queue.

@joboet
Copy link
Member

joboet commented Feb 19, 2025

Since this touches a lot of targets, I'm going to split this into multiple PRs for more target-focused review, once #136780 goes through the merge queue.

That'd be great, thank you! Especially the SGX stuff would be much simpler to review as a dedicated PR.

@thaliaarchi thaliaarchi force-pushed the io-optional-methods/stdio branch from 118bb74 to ade071b Compare February 21, 2025 05:27
@rustbot rustbot added O-unix Operating system: Unix-like O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows labels Feb 21, 2025
@bors
Copy link
Contributor

bors commented Mar 22, 2025

⌛ Trying commit 46e3e46 with merge 4fff642...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 22, 2025
…o, r=<try>

Provide optional `Read`/`Write` methods for stdio

Override more of the default methods for `io::Read` and `io::Write` for stdio types, when efficient to do so, and deduplicate unsupported types.

Tracked in rust-lang#136756.

try-job: x86_64-msvc-1
Match what `std::io::Empty` does, since it is very similar. However,
still evaluate the `fmt::Arguments` in `write_fmt` to be consistent with
other platforms.
This seems to be the pattern for newer pal stdio types.
@thaliaarchi
Copy link
Contributor Author

That's a strange failure, since this PR changes nothing for Windows and the other PRs look platform-independent. I'm curious what the try run will report.

I reviewed it again and noticed that write_fmt shouldn't be stubbed like std::io::Sink. It's not appropriate for some platforms to not expand the fmt::Arguments, so I've reverted that bit.

@thaliaarchi thaliaarchi force-pushed the io-optional-methods/stdio branch from 46e3e46 to f6e90d8 Compare March 22, 2025 08:30
@thaliaarchi
Copy link
Contributor Author

@tgross35 The try job passed

@tgross35
Copy link
Contributor

Weird, nothing else in that rollup seems like it could have had an affect on those tests.

@bors r=joboet

@bors
Copy link
Contributor

bors commented Mar 22, 2025

📌 Commit f6e90d8 has been approved by joboet

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 22, 2025
@tgross35
Copy link
Contributor

Actually, the other PRs in that rollup all merged. This wouldn't make it into a rollup for a few hours, so might as well use that time to try again on top of everything else in case it interacted with another PR somehow.

@bors r-
@bors try

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 22, 2025
@bors
Copy link
Contributor

bors commented Mar 22, 2025

⌛ Trying commit f6e90d8 with merge 533535adca65287b0e54b123821057231cd51bc8...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 22, 2025
…o, r=<try>

Provide optional `Read`/`Write` methods for stdio

Override more of the default methods for `io::Read` and `io::Write` for stdio types, when efficient to do so, and deduplicate unsupported types.

Tracked in rust-lang#136756.

try-job: x86_64-msvc-1
@bors
Copy link
Contributor

bors commented Mar 22, 2025

☀️ Try build successful - checks-actions
Build commit: 533535a (533535adca65287b0e54b123821057231cd51bc8)

@thaliaarchi
Copy link
Contributor Author

Probably just a spurious failure then?

@tgross35
Copy link
Contributor

I guess so, that’s just a weirdly specific failure to be spurious.

@bors r=joboet

@bors
Copy link
Contributor

bors commented Mar 23, 2025

📌 Commit f6e90d8 has been approved by joboet

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 23, 2025
@bors
Copy link
Contributor

bors commented Mar 23, 2025

⌛ Testing commit f6e90d8 with merge 60a3084f64607e86dd7715d72f11764cd500c364...

@bors
Copy link
Contributor

bors commented Mar 23, 2025

☀️ Test successful - checks-actions
Approved by: joboet
Pushing 60a3084 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 23, 2025
@bors bors merged commit 60a3084 into rust-lang:master Mar 23, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 23, 2025
Copy link

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing f08d5c0 (parent) -> 60a3084 (this PR)

Test differences

Show 60 test diffs

Additionally, 60 doctest diffs were found. These are ignored, as they are noisy.

Job group index

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (60a3084): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -3.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.1% [-3.1%, -3.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.1% [-3.1%, -3.1%] 1

Cycles

Results (secondary 3.7%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% [3.7%, 3.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 774.928s -> 774.048s (-0.11%)
Artifact size: 365.54 MiB -> 365.55 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

8 participants