diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-06-24 11:20:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-24 11:20:09 +0200 |
| commit | 7375c441cec4c87ed88b36dd0edbd5b7240a05e9 (patch) | |
| tree | 9a51c569d42a759ceb1ef245226a09bae725828b | |
| parent | 58a54ef26da5b5d4b9e17e52c0f33b53f8dd9f3d (diff) | |
| parent | 3003050d473abd13d56c7e7966b971bd7443194f (diff) | |
| download | rust-7375c441cec4c87ed88b36dd0edbd5b7240a05e9.tar.gz rust-7375c441cec4c87ed88b36dd0edbd5b7240a05e9.zip | |
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 rust-lang/rust#142926 (verified locally by cherry-picking the patch onto beta where I was building).
| -rw-r--r-- | src/bootstrap/src/core/builder/cargo.rs | 1 | ||||
| -rw-r--r-- | src/bootstrap/src/utils/exec.rs | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index 0e3c3aaee0f..99044e2a253 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -683,6 +683,7 @@ impl Builder<'_> { .arg("--print=file-names") .arg("--crate-type=proc-macro") .arg("-") + .stdin(std::process::Stdio::null()) .run_capture(self) .stderr(); diff --git a/src/bootstrap/src/utils/exec.rs b/src/bootstrap/src/utils/exec.rs index eb9802bf2e1..78b28ac1828 100644 --- a/src/bootstrap/src/utils/exec.rs +++ b/src/bootstrap/src/utils/exec.rs @@ -119,6 +119,11 @@ impl<'a> BootstrapCommand { 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 } |
