Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Miri first builds some crates #684

Closed
RalfJung opened this issue Feb 26, 2021 · 7 comments
Closed

Using Miri first builds some crates #684

RalfJung opened this issue Feb 26, 2021 · 7 comments

Comments

@RalfJung
Copy link
Member

RalfJung commented Feb 26, 2021

It looks like somehow Miri doesn't come with fully pre-built crates any more on the playground: when I open this code and run it in Miri, it starts doing this in the output:

   Compiling hyper v0.14.4
   Compiling hyper-tls v0.5.0
   Compiling reqwest v0.11.0

Most of the time, it then timeouts, probably because building the dependencies takes too long.

We have done some changes to cargo-miri in the recent past that fixed in particular the interaction with hyper (rust-lang/miri#1705), so maybe the cache needs to be cleared and re-built somehow? But I thought that was supposed to happen automatically.

@shepmaster
Copy link
Member

Is this still the right setup to do before running the user code?

rustup component add rust-src miri
cargo miri setup
cargo miri run

@shepmaster
Copy link
Member

CI appears to be precompiling those crates (click on "build and push container"):

#8 146.2    Compiling hyper v0.14.4
551
#8 146.7    Compiling cookie_store v0.12.0
552
#8 147.2    Compiling select v0.5.0
553
#8 147.5    Compiling postgres v0.19.0
554
#8 149.7    Compiling hyper-tls v0.5.0
555
#8 149.9    Compiling reqwest v0.11.0
556
#8 151.1    Compiling playground v0.0.1 (/playground)
557
#8 151.1     Finished dev [unoptimized + debuginfo] target(s) in 2m 30s
558
#8 151.1      Running `/playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri target/x86_64-unknown-linux-gnu/debug/playground`
559
#8 151.2 Hello, world!

@RalfJung
Copy link
Member Author

Is this still the right setup to do before running the user code?

Yeah, I would think so. However, it's possible that old files sticking around could confuse cargo-miri... does this process start with an empty target directory each time, or does it reuse the one from the previous day?

@shepmaster
Copy link
Member

The intention (and everything I've seen previously) is that it's a completely clean build.

@RalfJung
Copy link
Member Author

Yeah this is a Miri bug: rust-lang/miri#1722

@RalfJung
Copy link
Member Author

Closing this then, bors is testing the fix for Miri now and eventually it should make its way through to the playground.

@shepmaster
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants