Stream: t-compiler/const-eval

Topic: cargo-miri--start-fn

RalfJ (Oct 19 2018 at 06:31, on Zulip):

@Oli @Andrew Poelstra I am wondering if we can remove the footgun of forgetting to pass -- -Zmiri-start-fn to cargo miri, which leads to memory leaks errors because TLS wasn't initialized (and maybe there are other errors?). I see several options, but I am not sure which one I like most:

RalfJ (Oct 19 2018 at 06:33, on Zulip):

My tendency is with the first option, I have to say. Fewer flags always seem nice^^

oli (Oct 19 2018 at 07:17, on Zulip):

first option sounds good. I nominate rust_panic as the canary

RalfJ (Oct 19 2018 at 08:17, on Zulip):


oli (Oct 19 2018 at 08:20, on Zulip):


Christian Poveda (Oct 19 2018 at 08:24, on Zulip):

that was fast :P

RalfJ (Oct 19 2018 at 08:25, on Zulip):

On a related note... @Andrew Poelstra so what do we do about ? Do you still think we should tell the user to copy stuff around? I think we shouldn't. We should rather tell them to do cargo clean, and then MIRI_SYSROOT=~/.xargo/HOST cargo miri, and that should work without any copy.

RalfJ (Oct 19 2018 at 08:25, on Zulip):

@Christian Poveda welcome to Zulip :D

Christian Poveda (Oct 19 2018 at 08:25, on Zulip):

ty :)

RalfJ (Oct 19 2018 at 10:29, on Zulip):

@Oli your two suggestions would become separate commits, so I am going to make them one commit manually instead

oli (Oct 19 2018 at 10:29, on Zulip):

yea, the feature is cool, but not quite ready yet

RalfJ (Oct 19 2018 at 11:40, on Zulip):

lol when you work on rustc+miri and const validation tells you your miri sources contain a bad const^^

Andrew Poelstra (Oct 19 2018 at 12:26, on Zulip):

@RalfJ agreed, I should change the PR to recommend cargo clean rather than copying stuff around. That's much simpler

RalfJ (Oct 19 2018 at 12:40, on Zulip):

@Andrew Poelstra also with -Zmiri-start-fn gone thinks are hopefully a bit better now

RalfJ (Oct 19 2018 at 12:41, on Zulip):

I think the biggest footgun left is not using the same toolchain for xargo/ and cargo miri. Should probably be mentioned: "If you get strange errors, try cargo clean and make sure you used the same toolchain for ..."

Andrew Poelstra (Oct 19 2018 at 12:41, on Zulip):

I actually don't know what -Zmiri-start-fn does. I haven't able to build something without a MIR-enabled std to run cargo miri on it

Andrew Poelstra (Oct 19 2018 at 12:42, on Zulip):

Agreed -- even now sometimes I forget to set MIRI_SYSROOT and things break with "cannot find std". Now I know the correct response is cargo clean and then set MIRI_SYSROOT, but at first this was extremely confusing

Andrew Poelstra (Oct 19 2018 at 12:43, on Zulip):

so I'll update the README PR to say that

RalfJ (Oct 19 2018 at 12:44, on Zulip):

thanks :)

Last update: Apr 03 2020 at 18:25UTC