Skip to content

Commit 3003050

Browse files
committed
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.
1 parent 321dde1 commit 3003050

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
@@ -120,6 +120,11 @@ impl BootstrapCommand {
120120
self
121121
}
122122

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

0 commit comments

Comments
 (0)