Skip to content

Commit 90da89b

Browse files
committed
Fix deadlock when build scripts are waiting for input on stdin
1 parent e691e18 commit 90da89b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/cargo-util/src/process_builder.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ impl ProcessBuilder {
355355
let (mut child, argfile) = spawn(cmd)?;
356356
let out = child.stdout.take().unwrap();
357357
let err = child.stderr.take().unwrap();
358+
// close stdin to prevent deadlock
359+
drop(child.stdin.take().unwrap());
358360
read2(out, err, &mut |is_out, data, eof| {
359361
let pos = if is_out {
360362
&mut stdout_pos

0 commit comments

Comments
 (0)