Skip to content

Commit ca8cbc4

Browse files
authored
Unrolled build for #142928
Rollup merge of #142928 - Noratrieb:no-more-hang, r=clubby789 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. Fixes #142926 (verified locally by cherry-picking the patch onto beta where I was building).
2 parents e4b9d01 + 3003050 commit ca8cbc4

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)