File tree 6 files changed +12
-28
lines changed
6 files changed +12
-28
lines changed Original file line number Diff line number Diff line change @@ -288,14 +288,9 @@ environment variable. We first document the most relevant and most commonly used
288
288
execution with a "permission denied" error being returned to the program.
289
289
` warn` prints a full backtrace when that happens; `warn-nobacktrace` is less
290
290
verbose. `hide` hides the warning entirely.
291
- * `-Zmiri-env-exclude=<var>` keeps the `var` environment variable isolated from the host so that it
292
- cannot be accessed by the program. Can be used multiple times to exclude several variables. The
293
- ` TERM` environment variable is excluded by default in Windows to prevent the libtest harness from
294
- accessing the file system. This has no effect unless `-Zmiri-disable-isolation` is also set.
295
291
* `-Zmiri-env-forward=<var>` forwards the `var` environment variable to the interpreted program. Can
296
- be used multiple times to forward several variables. This takes precedence over
297
- `-Zmiri-env-exclude` : if a variable is both forwarded and exluced, it *will* get forwarded. This
298
- means in particular `-Zmiri-env-forward=TERM` overwrites the default exclusion of `TERM`.
292
+ be used multiple times to forward several variables. Execution will still be deterministic if the
293
+ value of forwarded variables stays the same. Has no effect if `-Zmiri-disable-isolation` is set.
299
294
* `-Zmiri-ignore-leaks` disables the memory leak checker, and also allows some
300
295
remaining threads to exist when the main thread exits.
301
296
* `-Zmiri-permissive-provenance` disables the warning for integer-to-pointer casts and
Original file line number Diff line number Diff line change @@ -441,8 +441,10 @@ fn main() {
441
441
"-Zmiri-seed should only contain valid hex digits [0-9a-fA-F] and must fit into a u64 (max 16 characters)"
442
442
) ) ;
443
443
miri_config. seed = Some ( seed) ;
444
- } else if let Some ( param) = arg. strip_prefix ( "-Zmiri-env-exclude=" ) {
445
- miri_config. excluded_env_vars . push ( param. to_owned ( ) ) ;
444
+ } else if let Some ( _param) = arg. strip_prefix ( "-Zmiri-env-exclude=" ) {
445
+ show_error ! (
446
+ "`-Zmiri-env-exclude` has been removed; unset env vars before starting Miri instead"
447
+ ) ;
446
448
} else if let Some ( param) = arg. strip_prefix ( "-Zmiri-env-forward=" ) {
447
449
miri_config. forwarded_env_vars . push ( param. to_owned ( ) ) ;
448
450
} else if let Some ( param) = arg. strip_prefix ( "-Zmiri-track-pointer-tag=" ) {
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ pub enum BacktraceStyle {
74
74
#[ derive( Clone ) ]
75
75
pub struct MiriConfig {
76
76
/// The host environment snapshot to use as basis for what is provided to the interpreted program.
77
- /// (This is still subject to isolation as well as `excluded_env_vars` and ` forwarded_env_vars`.)
77
+ /// (This is still subject to isolation as well as `forwarded_env_vars`.)
78
78
pub env : Vec < ( OsString , OsString ) > ,
79
79
/// Determine if validity checking is enabled.
80
80
pub validate : bool ,
@@ -88,8 +88,6 @@ pub struct MiriConfig {
88
88
pub isolated_op : IsolatedOp ,
89
89
/// Determines if memory leaks should be ignored.
90
90
pub ignore_leaks : bool ,
91
- /// Environment variables that should always be isolated from the host.
92
- pub excluded_env_vars : Vec < String > ,
93
91
/// Environment variables that should always be forwarded from the host.
94
92
pub forwarded_env_vars : Vec < String > ,
95
93
/// Command-line arguments passed to the interpreted program.
@@ -146,7 +144,6 @@ impl Default for MiriConfig {
146
144
check_abi : true ,
147
145
isolated_op : IsolatedOp :: Reject ( RejectOpWith :: Abort ) ,
148
146
ignore_leaks : false ,
149
- excluded_env_vars : vec ! [ ] ,
150
147
forwarded_env_vars : vec ! [ ] ,
151
148
args : vec ! [ ] ,
152
149
seed : None ,
Original file line number Diff line number Diff line change @@ -42,19 +42,12 @@ impl<'tcx> EnvVars<'tcx> {
42
42
config : & MiriConfig ,
43
43
) -> InterpResult < ' tcx > {
44
44
let target_os = ecx. tcx . sess . target . os . as_ref ( ) ;
45
- let mut excluded_env_vars = config. excluded_env_vars . clone ( ) ;
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
- }
50
45
51
46
// Skip the loop entirely if we don't want to forward anything.
52
47
if ecx. machine . communicate ( ) || !config. forwarded_env_vars . is_empty ( ) {
53
48
for ( name, value) in & config. env {
54
- // Always forward what is in `forwarded_env_vars`; that list can take precedence over excluded_env_vars.
55
- let forward = config. forwarded_env_vars . iter ( ) . any ( |v| * * v == * name)
56
- || ( ecx. machine . communicate ( )
57
- && !excluded_env_vars. iter ( ) . any ( |v| * * v == * name) ) ;
49
+ let forward = ecx. machine . communicate ( )
50
+ || config. forwarded_env_vars . iter ( ) . any ( |v| * * v == * name) ;
58
51
if forward {
59
52
let var_ptr = match target_os {
60
53
target if target_os_is_unix ( target) =>
Original file line number Diff line number Diff line change @@ -81,7 +81,9 @@ fn check_conditional_variables_timed_wait_notimeout() {
81
81
cvar. notify_one ( ) ;
82
82
} ) ;
83
83
84
- let ( _guard, timeout) = cvar. wait_timeout ( guard, Duration :: from_millis ( 1000 ) ) . unwrap ( ) ;
84
+ // macOS runners are very unreliable.
85
+ let timeout = if cfg ! ( target_os = "macos" ) { 2000 } else { 500 } ;
86
+ let ( _guard, timeout) = cvar. wait_timeout ( guard, Duration :: from_millis ( timeout) ) . unwrap ( ) ;
85
87
assert ! ( !timeout. timed_out( ) ) ;
86
88
handle. join ( ) . unwrap ( ) ;
87
89
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments