From f8449c2c78366d9ce016bb0b8be788d76ed9528e Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 6 Aug 2022 14:31:11 -0400 Subject: [PATCH 1/2] stop excluding TERM env var on Unix --- README.md | 5 ++--- src/shims/env.rs | 7 ++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5fbf89c86b..c7a3200dbd 100644 --- a/README.md +++ b/README.md @@ -282,9 +282,8 @@ environment variable. We first document the most relevant and most commonly used verbose. `hide` hides the warning entirely. * `-Zmiri-env-exclude=` keeps the `var` environment variable isolated from the host so that it cannot be accessed by the program. Can be used multiple times to exclude several variables. The - `TERM` environment variable is excluded by default to [speed up the test - harness](https://github.com/rust-lang/miri/issues/1702). This has no effect unless - `-Zmiri-disable-isolation` is also set. + `TERM` environment variable is excluded by default in Windows to prevent the libtest harness from + accessing the file system. This has no effect unless `-Zmiri-disable-isolation` is also set. * `-Zmiri-env-forward=` forwards the `var` environment variable to the interpreted program. Can be used multiple times to forward several variables. This takes precedence over `-Zmiri-env-exclude`: if a variable is both forwarded and exluced, it *will* get forwarded. This diff --git a/src/shims/env.rs b/src/shims/env.rs index db1ddf6291..3dd0b65d02 100644 --- a/src/shims/env.rs +++ b/src/shims/env.rs @@ -42,10 +42,11 @@ impl<'tcx> EnvVars<'tcx> { config: &MiriConfig, ) -> InterpResult<'tcx> { let target_os = ecx.tcx.sess.target.os.as_ref(); - // HACK: Exclude `TERM` var to avoid terminfo trying to open the termcap file. - // This is (a) very slow and (b) does not work on Windows. let mut excluded_env_vars = config.excluded_env_vars.clone(); - excluded_env_vars.push("TERM".to_owned()); + if target_os == "windows" { + // HACK: Exclude `TERM` var to avoid terminfo trying to open the termcap file. + excluded_env_vars.push("TERM".to_owned()); + } // Skip the loop entirely if we don't want to forward anything. if ecx.machine.communicate() || !config.forwarded_env_vars.is_empty() { From 5ead47e623ccaf16aaf5d5932e14212c6bb3f9a8 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 7 Aug 2022 20:36:57 -0400 Subject: [PATCH 2/2] rustup --- rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-version b/rust-version index 22daf00bd0..cac0155e3c 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -1f5d8d49eb6111931091f700d07518cd2b80bc18 +93ab13b4e894ab74258c40aaf29872db2b17b6b4