Skip to content

Commit 654e15b

Browse files
committed
Auto merge of #2471 - RalfJung:term, r=RalfJung
stop excluding TERM env var on Unix Effectively reverts #2018. Needs rust-lang/rust#100206 to not be terribly slow. Fixes #2292.
2 parents 94b6aaf + 5ead47e commit 654e15b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,8 @@ environment variable. We first document the most relevant and most commonly used
282282
verbose. `hide` hides the warning entirely.
283283
* `-Zmiri-env-exclude=<var>` keeps the `var` environment variable isolated from the host so that it
284284
cannot be accessed by the program. Can be used multiple times to exclude several variables. The
285-
`TERM` environment variable is excluded by default to [speed up the test
286-
harness](https://github.com/rust-lang/miri/issues/1702). This has no effect unless
287-
`-Zmiri-disable-isolation` is also set.
285+
`TERM` environment variable is excluded by default in Windows to prevent the libtest harness from
286+
accessing the file system. This has no effect unless `-Zmiri-disable-isolation` is also set.
288287
* `-Zmiri-env-forward=<var>` forwards the `var` environment variable to the interpreted program. Can
289288
be used multiple times to forward several variables. This takes precedence over
290289
`-Zmiri-env-exclude`: if a variable is both forwarded and exluced, it *will* get forwarded. This

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1f5d8d49eb6111931091f700d07518cd2b80bc18
1+
93ab13b4e894ab74258c40aaf29872db2b17b6b4

src/shims/env.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ impl<'tcx> EnvVars<'tcx> {
4242
config: &MiriConfig,
4343
) -> InterpResult<'tcx> {
4444
let target_os = ecx.tcx.sess.target.os.as_ref();
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.
4745
let mut excluded_env_vars = config.excluded_env_vars.clone();
48-
excluded_env_vars.push("TERM".to_owned());
46+
if target_os == "windows" {
47+
// HACK: Exclude `TERM` var to avoid terminfo trying to open the termcap file.
48+
excluded_env_vars.push("TERM".to_owned());
49+
}
4950

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

0 commit comments

Comments
 (0)