Skip to content

Commit cd3bc5f

Browse files
Noratriebcuviper
authored andcommitted
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 3003050)
1 parent 8eb4554 commit cd3bc5f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/bootstrap/src/core/builder/cargo.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ impl Builder<'_> {
683683
.arg("--print=file-names")
684684
.arg("--crate-type=proc-macro")
685685
.arg("-")
686+
.stdin(std::process::Stdio::null())
686687
.run_capture(self)
687688
.stderr();
688689

src/bootstrap/src/utils/exec.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ impl<'a> BootstrapCommand {
119119
self
120120
}
121121

122+
pub fn stdin(&mut self, stdin: std::process::Stdio) -> &mut Self {
123+
self.command.stdin(stdin);
124+
self
125+
}
126+
122127
#[must_use]
123128
pub fn delay_failure(self) -> Self {
124129
Self { failure_behavior: BehaviorOnFailure::DelayFail, ..self }

0 commit comments

Comments
 (0)