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:
Noratrieb
2025-06-23 21:01:08 +02:00
committed by Josh Stone
parent 8eb45546d5
commit cd3bc5f082
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -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();
+5
View File
@@ -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 }