nix-community / lorri

Your project’s nix-env [maintainer=@Profpatsch,@nyarly]
Apache License 2.0
663 stars 24 forks source link

slog panics when I pipe the output to another command #20

Closed Profpatsch closed 3 years ago

Profpatsch commented 3 years ago

e.g.

> cargo run -- -v internal stream-events | jq
…
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
     Running `target/debug/lorri -v internal stream-events`
parse error: Invalid numeric literal at line 1, column 4
thread 'main' panicked at 'slog::Fuse Drain: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }', /home/philip/.cargo/registry/src/github.com-1ecc6299db9ec823/slog-2.7.0/src/lib.rs:1944:33
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
…
sternenseemann commented 3 years ago

Do you filter SIGPIPE somewhere?

Profpatsch commented 3 years ago

I don’t we use a library called slog which either we call in a wrong way or it isn’t able to deal with a simple pipe.

grahamc commented 3 years ago

It is actually a program with rust https://github.com/rust- lang/rust/issues/62569#issuecomment-510456259

On March 19, 2021, GitHub @.***> wrote:

I don’t we use a library called slog which either we call in a wrong way or it isn’t able to deal with a simple pipe.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nix- community/lorri/issues/20#issuecomment-803186651, or unsubscribe https://github.com/notifications/unsubscribe- auth/AAASXLE4TFYAFPSDLDSFM6DTEPLZDANCNFSM4ZOVWJSA.

Profpatsch commented 3 years ago

This should be fixed by https://github.com/nix-community/lorri/pull/22, the problem was that stream-events was using println instead of write, which triggers the rust SIGPIPE bug.

it’s a 1-line fix so I’ll apply it separately so we don’t block.

Profpatsch commented 3 years ago

Fixed by #23