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

panic if TERM environment variable is "dumb" #219

Open
jimblandy opened this issue Apr 12, 2020 · 5 comments
Open

panic if TERM environment variable is "dumb" #219

jimblandy opened this issue Apr 12, 2020 · 5 comments

Comments

@jimblandy
Copy link

jimblandy commented Apr 12, 2020

If I do a compiletest test run under Emacs, Emacs sets the TERM environment variable to "dumb", and then the test run panics:

running 2 tests
test [compile-fail] asynchronous/async-fn-not-unpin.rs ... 
thread '[compile-fail] asynchronous/wrong_mutex.rs' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', /home/jimb/.cargo/registry/src/github.com-1ecc6299db9ec823/tester-0.7.0/src/lib.rs:598:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test [compile-fail] enums/exclusive_range_patterns.rs ... 
...

If I change the test command to TERM=ansi cargo test, then all is well.

This is the panicking line, in the tester crate's run_test_in_process function:

    monitor_ch.send(message).unwrap();

where monitor_ch is a Sender<CompletedTest>.

The only thing I can imagine compiletest uses TERM for is the color in the output. So I'd guess that whoever is supposed to be receiving on this channel exited early for some color-related reason. Ideally, if color is not available, one should simply not emit the color escape codes.

@jimblandy jimblandy changed the title panic if terminal doesn't support color panic if TERM environment variable is "dumb" Apr 12, 2020
@Munksgaard
Copy link
Collaborator

Hi @jimblandy, thank you for reporting this issue. I'm having trouble recreating it on my local machine. Running TERM=dumb cargo test in our test-project doesn't seem to exhibit the error you've described. What project are you running this on? Can you perhaps supply a minimal working example?

Furthermore, if the panicking line is in the tester crate, I think it would be best to report the error there?

@jimblandy
Copy link
Author

Here's a test case: https://github.com/jimblandy/compiletest-issue-219

@jimblandy
Copy link
Author

This is on Fedora.

@jimblandy
Copy link
Author

Okay, I filed an issue against the tester crate: messense/rustc-test#6

@Munksgaard
Copy link
Collaborator

Thank you @jimblandy, that reproduces the issue for me here. I don't have time to look at the issue at the moment, unfortunately, let's hope someone else does.

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