Stream: general

Topic: miri — macOS environment


Jake Goulding (May 31 2019 at 14:44, on Zulip):
error[E0080]: Miri evaluation error: can't call foreign function: _NSGetEnviron
   --> /Users/shep/.rustup/toolchains/nightly-2019-05-27-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/os.rs:405:5
    |
405 |     _NSGetEnviron()
    |     ^^^^^^^^^^^^^^^ Miri evaluation error: can't call foreign function: _NSGetEnviron
    |
    = note: inside call to `std::sys::unix::os::environ` at /Users/shep/.rustup/toolchains/nightly-2019-05-27-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/os.rs:426:28
    = note: inside call to `std::sys::unix::os::env` at /Users/shep/.rustup/toolchains/nightly-2019-05-27-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/env.rs:143:21

@RalfJ should I report this? seems like env should be supported (and I assume it is on Linux)

RalfJ (May 31 2019 at 14:48, on Zulip):

uh, I thought we had a test for that

RalfJ (May 31 2019 at 14:48, on Zulip):

yeah we test

fn main() {
    assert_eq!(env::var("MIRI_TEST"), Err(env::VarError::NotPresent));
    env::set_var("MIRI_TEST", "the answer");
    assert_eq!(env::var("MIRI_TEST"), Ok("the answer".to_owned()));
}

what code are you running to trigger this?

Jake Goulding (May 31 2019 at 14:49, on Zulip):

And you run the tests on macOS?

RalfJ (May 31 2019 at 14:49, on Zulip):

(so, yes, please report with a reproducing testcase)

RalfJ (May 31 2019 at 14:49, on Zulip):

yes

Jake Goulding (May 31 2019 at 14:49, on Zulip):

This is in the proptest code, but they call vars_os

Jake Goulding (May 31 2019 at 14:50, on Zulip):

I'll see about a smaller case

Jake Goulding (May 31 2019 at 14:53, on Zulip):

Filed as https://github.com/rust-lang/miri/issues/756 — any other deets I'm missing?

RalfJ (May 31 2019 at 15:04, on Zulip):

no looks good

RalfJ (May 31 2019 at 15:04, on Zulip):

hm so maybe this is about enumerating env vars vs accessing a particular one

Last update: Nov 20 2019 at 11:55UTC