Skip to content

Commit

Permalink
Fix deadlock when build scripts are waiting for input on stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
arlosi committed Oct 10, 2022
1 parent e691e18 commit 90da89b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/cargo-util/src/process_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ impl ProcessBuilder {
let (mut child, argfile) = spawn(cmd)?;
let out = child.stdout.take().unwrap();
let err = child.stderr.take().unwrap();
// close stdin to prevent deadlock
drop(child.stdin.take().unwrap());
read2(out, err, &mut |is_out, data, eof| {
let pos = if is_out {
&mut stdout_pos
Expand Down

0 comments on commit 90da89b

Please sign in to comment.