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
Add -
(stdin) support in rustdoc
#124611
Add -
(stdin) support in rustdoc
#124611
Conversation
Add support for inputing via stdin with run-make-support This PR adds the facility to set a input bytes that will be passed via the standard input. This is useful for testing `rustc -` (and soon `rustdoc -`). In rust-lang#124611 took the approach of having a dedicated `run` method but it is not very convenient to use and would necessitate many functions, one for success, one for fail, ... Instead this PR takes a different approach and allows setting the input bytes as if it were a parameter and when calling the (now custom) `output` function, we write the input bytes into stdin. I think this gives us maximum flexibility in the implementation and a simple interface for users. To test this new logic I ported `tests/run-make/stdin-non-utf8/` to an `rmake.rs` one. r? ``@jieyouxu``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's phenomenal! I have some small suggestions and questions.
Looks good overall but ofc, let's wait for the “rmake stdin” PR of yours that you mentioned. After that I'm gonna ping T-rustdoc and ask them for a FCP-merge.
Ofc, technically technically technically speaking this constitutes a breaking change but that's only theoretical in nature. On *nix systems, ppl can name their files # Create a file called `-`:
printf 'pub fn omg() {}' > -
# Yes, we've just created a file called `-`.
# On the command-line, run the following to see the output:
< -
# Now document our wonderful crate:
rustdoc - --crate-name dash
# Docs were generated:
"$BROWSER" ./doc/dash/index.html |
Add support for inputing via stdin with run-make-support This PR adds the facility to set a input bytes that will be passed via the standard input. This is useful for testing `rustc -` (and soon `rustdoc -`). In rust-lang#124611 took the approach of having a dedicated `run` method but it is not very convenient to use and would necessitate many functions, one for success, one for fail, ... Instead this PR takes a different approach and allows setting the input bytes as if it were a parameter and when calling the (now custom) `output` function, we write the input bytes into stdin. I think this gives us maximum flexibility in the implementation and a simple interface for users. To test this new logic I ported `tests/run-make/stdin-non-utf8/` to an `rmake.rs` one. r? `@jieyouxu`
Rollup merge of rust-lang#124612 - Urgau:run-make-stdin, r=jieyouxu Add support for inputing via stdin with run-make-support This PR adds the facility to set a input bytes that will be passed via the standard input. This is useful for testing `rustc -` (and soon `rustdoc -`). In rust-lang#124611 took the approach of having a dedicated `run` method but it is not very convenient to use and would necessitate many functions, one for success, one for fail, ... Instead this PR takes a different approach and allows setting the input bytes as if it were a parameter and when calling the (now custom) `output` function, we write the input bytes into stdin. I think this gives us maximum flexibility in the implementation and a simple interface for users. To test this new logic I ported `tests/run-make/stdin-non-utf8/` to an `rmake.rs` one. r? `@jieyouxu`
Hey there @rust-lang/rustdoc, I propose merging this1 after an FCP. This PR updates rustdoc's CLI to recognize the INPUT argument Motivation:
Maintenance Cost: Very low (next to zero) Potential Concerns:
Footnotes
|
I think we should land this, and I'm surprised this wasn't previously supported |
I'm also surprised it's not already there. Let's start the FCP then. @rfcbot fcp merge |
Team member @GuillaumeGomez has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
re alternatives: If someone is actually putting source code in a file named |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
Thanks everyone! @bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (bb97203): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (primary -4.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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 667.741s -> 668.952s (0.18%) |
Add `-` (stdin) support in rustdoc This PR adds support for the special `-` input which threats the input as coming from *stdin* instead of being a filepath. Doing this also makes `rustdoc` consistent with `rustc` and ~~every~~ other tools. Full [motivation](rust-lang/rust#124611 (comment)). Fixes rust-lang/rust#123671 r? `@fmease`
Add `-` (stdin) support in rustdoc This PR adds support for the special `-` input which threats the input as coming from *stdin* instead of being a filepath. Doing this also makes `rustdoc` consistent with `rustc` and ~~every~~ other tools. Full [motivation](rust-lang/rust#124611 (comment)). Fixes rust-lang/rust#123671 r? `@fmease`
This PR adds support for the special
-
input which threats the input as coming from stdin instead of being a filepath.Doing this also makes
rustdoc
consistent withrustc
andeveryother tools. Full motivation.Fixes #123671
r? @fmease