Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread 'main' panicked at 'Could not open stderr!' #5

Closed
kswmsw opened this issue Feb 3, 2017 · 3 comments
Closed

thread 'main' panicked at 'Could not open stderr!' #5

kswmsw opened this issue Feb 3, 2017 · 3 comments
Assignees

Comments

@kswmsw
Copy link

kswmsw commented Feb 3, 2017

When running cargo kcov inside Gitlab CI, any failures are reported simply as

thread 'main' panicked at 'Could not open stderr!', ../src/libcore/option.rs:705
note: Run with `RUST_BACKTRACE=1` for a backtrace.

which is a bit unhelpful.

On closer examination, the issue is in errors.rs line 79 which does

let mut t = stderr().expect("Could not open stderr!");

which is actually term::stderr. If the terminal is not set up correctly, this returns None and panics.

Repro:

$ TERM=none cargo kcov --kcov xyz
thread 'main' panicked at 'Could not open stderr!', ../src/libcore/option.rs:705
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Please can cargo-kcov fall back to using stderr (without colouring) if stderr() fails?

Thanks.

Workaround: prefix the cargo command with TERM=ansi.

@kennytm kennytm self-assigned this Feb 3, 2017
@kennytm kennytm closed this as completed in 8ebe2ca Feb 3, 2017
@kennytm
Copy link
Owner

kennytm commented Feb 3, 2017

Fixed in v0.3.1 for the repro case.

(cc Stebalien/term#57)

@kswmsw
Copy link
Author

kswmsw commented Feb 6, 2017

Awesome, thanks @kennytm !

@kswmsw
Copy link
Author

kswmsw commented Feb 6, 2017

Confirmed, this nicely fixes our issue. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants