mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Fix hang in --print=file-names in bootstrap
In an interactive context, the subprocess inherited a real tty stdin,
which lead it it waiting for something to happen, even though nothing
happened. By explicitly passing null as stdin we make sure an empty file
is passed, which achieves the desired behavior.
(cherry picked from commit 3003050d47)
This commit is contained in:
@@ -683,6 +683,7 @@ fn cargo(
|
||||
.arg("--print=file-names")
|
||||
.arg("--crate-type=proc-macro")
|
||||
.arg("-")
|
||||
.stdin(std::process::Stdio::null())
|
||||
.run_capture(self)
|
||||
.stderr();
|
||||
|
||||
|
||||
@@ -119,6 +119,11 @@ pub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Self {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn stdin(&mut self, stdin: std::process::Stdio) -> &mut Self {
|
||||
self.command.stdin(stdin);
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn delay_failure(self) -> Self {
|
||||
Self { failure_behavior: BehaviorOnFailure::DelayFail, ..self }
|
||||
|
||||
Reference in New Issue
Block a user