-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 support for inputing via stdin with run-make-support #124612
Conversation
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.
I like how the API looks with custom stdin
. One nit about the comment, after that r=me.
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! r=me after CI is green.
@bors delegate=Urgau |
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 of 8 pull requests Successful merges: - rust-lang#124412 (io safety: update Unix explanation to use `Arc`) - rust-lang#124441 (String.truncate comment microfix (greater or equal)) - rust-lang#124594 (run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS) - rust-lang#124604 (library/std: Remove unused `gimli-symbolize` feature) - rust-lang#124607 (`rustc_expand` cleanups) - rust-lang#124609 (variable-precision float operations can differ depending on optimization levels) - rust-lang#124610 (Tweak `consts_may_unify`) - rust-lang#124612 (Add support for inputing via stdin with run-make-support) r? `@ghost` `@rustbot` modify labels: rollup
Failed in rollup: #124643 (comment) |
😮💨, I think I will always forget that Windows has |
Ideally this would use std::env::consts::EXE_SUFFIX so it wouldn't break if another platform would ever need an extension added. |
I agree, that would be better, but I think the |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#124461 (handle the targets that are missing in stage0) - rust-lang#124492 (Generalize `adjust_from_tcx` for `Allocation`) - rust-lang#124588 (Use `ObligationCtxt` in favor of `TraitEngine` in many more places) - rust-lang#124612 (Add support for inputing via stdin with run-make-support) - rust-lang#124613 (Allow fmt to run on rmake.rs test files) - rust-lang#124649 (Fix HorizonOS build broken by rust-lang#124210) r? `@ghost` `@rustbot` modify labels: rollup
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`
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 soonrustdoc -
).In #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 anrmake.rs
one.r? @jieyouxu