Skip to content

Commit a12a48b

Browse files
committed
Auto merge of #2018 - RalfJung:term, r=oli-obk
exclude TERM env var by default Fixes #1702 r? `@oli-obk`
2 parents 9029fa4 + 3c5cb89 commit a12a48b

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,9 @@ environment variable:
270270
`warn` prints a full backtrace when that happen; `warn-nobacktrace` is less
271271
verbose. `hide` hides the warning entirely.
272272
* `-Zmiri-env-exclude=<var>` keeps the `var` environment variable isolated from the host so that it
273-
cannot be accessed by the program. Can be used multiple times to exclude several variables. On
274-
Windows, the `TERM` environment variable is excluded by default. This has no effect unless
273+
cannot be accessed by the program. Can be used multiple times to exclude several variables. The
274+
`TERM` environment variable is excluded by default to [speed up the test
275+
harness](https://github.com/rust-lang/miri/issues/1702). This has no effect unless
275276
`-Zmiri-disable-validation` is also set.
276277
* `-Zmiri-env-forward=<var>` forwards the `var` environment variable to the interpreted program. Can
277278
be used multiple times to forward several variables. This has no effect if

src/shims/env.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ impl<'tcx> EnvVars<'tcx> {
4242
forwarded_env_vars: Vec<String>,
4343
) -> InterpResult<'tcx> {
4444
let target_os = ecx.tcx.sess.target.os.as_str();
45-
if target_os == "windows" {
46-
// Temporary hack: Exclude `TERM` var to avoid terminfo trying to open the termcap file.
47-
// Can be removed once https://github.com/rust-lang/miri/issues/1013 is resolved.
48-
excluded_env_vars.push("TERM".to_owned());
49-
}
45+
// HACK: Exclude `TERM` var to avoid terminfo trying to open the termcap file.
46+
// This is (a) very slow and (b) does not work on Windows.
47+
excluded_env_vars.push("TERM".to_owned());
5048

5149
// Skip the loop entirely if we don't want to forward anything.
5250
if ecx.machine.communicate() || !forwarded_env_vars.is_empty() {

0 commit comments

Comments
 (0)