diff options
| author | Ralf Jung <post@ralfj.de> | 2022-09-20 08:42:45 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-09-20 08:51:13 +0200 |
| commit | bacf131accaf47759d4dfac41549d2c96af196a5 (patch) | |
| tree | a59e1ff9936d125128b1e2fa7ffa08287c7d16d1 /src | |
| parent | 4b9463c5b713350b37ebc26a01122ea16e002451 (diff) | |
| download | rust-bacf131accaf47759d4dfac41549d2c96af196a5.tar.gz rust-bacf131accaf47759d4dfac41549d2c96af196a5.zip | |
remove Windows TERM env var hack and -Zmiri-env-exclude
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/miri.rs | 6 | ||||
| -rw-r--r-- | src/eval.rs | 5 | ||||
| -rw-r--r-- | src/shims/env.rs | 11 |
3 files changed, 7 insertions, 15 deletions
diff --git a/src/bin/miri.rs b/src/bin/miri.rs index d9e91951a92..644a8129eee 100644 --- a/src/bin/miri.rs +++ b/src/bin/miri.rs @@ -441,8 +441,10 @@ fn main() { "-Zmiri-seed should only contain valid hex digits [0-9a-fA-F] and must fit into a u64 (max 16 characters)" )); miri_config.seed = Some(seed); - } else if let Some(param) = arg.strip_prefix("-Zmiri-env-exclude=") { - miri_config.excluded_env_vars.push(param.to_owned()); + } else if let Some(_param) = arg.strip_prefix("-Zmiri-env-exclude=") { + show_error!( + "`-Zmiri-env-exclude` has been removed; unset env vars before starting Miri instead" + ); } else if let Some(param) = arg.strip_prefix("-Zmiri-env-forward=") { miri_config.forwarded_env_vars.push(param.to_owned()); } else if let Some(param) = arg.strip_prefix("-Zmiri-track-pointer-tag=") { diff --git a/src/eval.rs b/src/eval.rs index 1be2a8990a6..819d71dc69f 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -74,7 +74,7 @@ pub enum BacktraceStyle { #[derive(Clone)] pub struct MiriConfig { /// The host environment snapshot to use as basis for what is provided to the interpreted program. - /// (This is still subject to isolation as well as `excluded_env_vars` and `forwarded_env_vars`.) + /// (This is still subject to isolation as well as `forwarded_env_vars`.) pub env: Vec<(OsString, OsString)>, /// Determine if validity checking is enabled. pub validate: bool, @@ -88,8 +88,6 @@ pub struct MiriConfig { pub isolated_op: IsolatedOp, /// Determines if memory leaks should be ignored. pub ignore_leaks: bool, - /// Environment variables that should always be isolated from the host. - pub excluded_env_vars: Vec<String>, /// Environment variables that should always be forwarded from the host. pub forwarded_env_vars: Vec<String>, /// Command-line arguments passed to the interpreted program. @@ -146,7 +144,6 @@ impl Default for MiriConfig { check_abi: true, isolated_op: IsolatedOp::Reject(RejectOpWith::Abort), ignore_leaks: false, - excluded_env_vars: vec![], forwarded_env_vars: vec![], args: vec![], seed: None, diff --git a/src/shims/env.rs b/src/shims/env.rs index 084433fab74..5b2d645c174 100644 --- a/src/shims/env.rs +++ b/src/shims/env.rs @@ -42,19 +42,12 @@ impl<'tcx> EnvVars<'tcx> { config: &MiriConfig, ) -> InterpResult<'tcx> { let target_os = ecx.tcx.sess.target.os.as_ref(); - let mut excluded_env_vars = config.excluded_env_vars.clone(); - 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() { for (name, value) in &config.env { - // Always forward what is in `forwarded_env_vars`; that list can take precedence over excluded_env_vars. - let forward = config.forwarded_env_vars.iter().any(|v| **v == *name) - || (ecx.machine.communicate() - && !excluded_env_vars.iter().any(|v| **v == *name)); + let forward = ecx.machine.communicate() + || config.forwarded_env_vars.iter().any(|v| **v == *name); if forward { let var_ptr = match target_os { target if target_os_is_unix(target) => |
