rust-shell-script/rust_cmd_lib

Stderr is unconditionally redirected

andylizi opened this issue · 1 comments

Description

Contents of stderr will always be sliently redirected and consumed.

Reproduction

cargo build outputs are printed to stderr, so we can use it as a demo:

run_cmd!(cargo build).unwrap();

Run it and nothing happens.

The Cause

In bd7837f, an attempt to fix logging for stderr:

rust_cmd_lib/src/process.rs

Lines 464 to 467 in f125db8

// set up error pipe
let (pipe_reader, pipe_writer) = os_pipe::pipe()?;
self.stderr_redirect = Some(CmdOut::Pipe(pipe_writer));
self.stderr_logging = Some(pipe_reader);

It is intentional. You need to set up a logger to show it. See readme.