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.
This commit is contained in:
Noratrieb
2025-06-23 21:01:08 +02:00
parent 321dde1252
commit 3003050d47
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
@@ -120,6 +120,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 }