Skip to content

detect_family_inner may block indefinietely #1287

@ChrisDenton

Description

@ChrisDenton

This line can, in certain situations, block indefinitely

cc-rs/src/tool.rs

Lines 161 to 167 in a0441c3

let accepts_cl_style_flags = run(Command::new(path).arg("-?"), path, &{
// the errors are not errors!
let mut cargo_output = cargo_output.clone();
cargo_output.warnings = cargo_output.debug;
cargo_output.output = OutputKind::Discard;
cargo_output
})

If cl.exe detects there's a console then it will paginate its output, prompting the user to press enter to continue. This is a problem when cargo_output.debug is set to true because then we will forward stderr to what may, potentially, be a console handle.

Easiest fix is probably to set .stdin to Stdio::null() so cl.exe always knows there's no input to wait for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions