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

Make miri easier to install #520

Closed
RalfJung opened this issue Nov 14, 2018 · 34 comments
Closed

Make miri easier to install #520

RalfJung opened this issue Nov 14, 2018 · 34 comments
Assignees
Labels
A-ux Area: This affects the general user experience C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@RalfJung
Copy link
Member

RalfJung commented Nov 14, 2018

It would be great if we could make miri easier to install.

miri + cargo miri

One thing is getting miri (and cargo-miri) itself. The ideal solution here would be making this a component in rustup so that it comes with a matching nightly. The dev-tools team has said they would support us in getting that done, after the edition.

libstd

However, miri isn't extremely useful if libstd comes without all the MIR. Right now, I don't think just making it a component is going to do much good, if people still have to then clone our repo to run xargo/build.sh.

The best I can think of here is to do this automatically in miri itself: Basically, to move xargo/* into the miri library, and have a setup step in the beginning which automatically compiles and then uses an appropriate libstd. Sounds rather hacky, but does anyone have a better idea?

@RalfJung RalfJung added C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement A-ux Area: This affects the general user experience labels Nov 17, 2018
@RalfJung
Copy link
Member Author

The second item above is solved: cargo miri now automatically installs and uses xargo.

What remains is distributing miri itself. @oli-obk you have some experience with clippy, can you help making miri a rustup component?

@oli-obk oli-obk self-assigned this Dec 20, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Dec 20, 2018

I'll do it over the holidays. I'll want to deduplicate some work between e.g. clippy and miri distribution instead of just copypasting everything.

@RalfJung
Copy link
Member Author

Sounds great :)

@RalfJung
Copy link
Member Author

RalfJung commented Feb 8, 2019

@oli-obk what is the state of making Miri a rustup component?

@mati865
Copy link
Contributor

mati865 commented Feb 8, 2019

I believe it should be available with next release of rustup (or with git checkout).

@RalfJung
Copy link
Member Author

RalfJung commented Feb 8, 2019

I thought rustup needs patching to hook cargo-miri, or so?

@mati865
Copy link
Contributor

mati865 commented Feb 8, 2019

You mean rust-lang/rustup#1606?

@RalfJung
Copy link
Member Author

RalfJung commented Feb 8, 2019

Ah, I didn't know that already landed!

Whom should we bug for a rustup release?

@mati865
Copy link
Contributor

mati865 commented Feb 8, 2019

Most of the releases were made by alexcrichton, Idk about the preferred way to contact.

@RalfJung
Copy link
Member Author

RalfJung commented Feb 8, 2019

@alexcrichton When do you usually make rustup releases? Would be nice to get one that includes the Miri support.

@alexcrichton
Copy link
Member

It's just on-demand, there's no schedule currently. There's development happening on rustup right now and presumably when that reaches a good point a release can be made.

@aleksmelnikov
Copy link

@alexcrichton , new rustup release needs to testing of the first miri component installation.

@RalfJung
Copy link
Member Author

RalfJung commented Mar 7, 2019

It seems there was a new rustup release. What's next?

@oli-obk
Copy link
Contributor

oli-obk commented Mar 7, 2019

Curious:

➜  cargo miri
error: 'cargo-miri' is not installed for the toolchain 'nightly-x86_64-unknown-linux-gnu'
To install, run `rustup component add miri --toolchain nightly-x86_64-unknown-linux-gnu`
➜  rustup component add miri --toolchain nightly-x86_64-unknown-linux-gnu
error: toolchain 'nightly-x86_64-unknown-linux-gnu' does not contain component 'miri' for target 'x86_64-unknown-linux-gnu'

@mati865
Copy link
Contributor

mati865 commented Mar 7, 2019

@oli-obk
Copy link
Contributor

oli-obk commented Mar 7, 2019

That explains it. I was sure I checked every clippy mention, but I might've only looked in bootstrap.

Thanks!

@mati865
Copy link
Contributor

mati865 commented Mar 10, 2019

rust-lang/rust#58990 was merged, it should work with next nightly.

@aleksmelnikov
Copy link

aleksmelnikov commented Mar 10, 2019

Yes, miri is available in rustup component list now.

 rustup component list | grep miri
miri-x86_64-unknown-linux-gnu

But I cannot install it:

rustup component add miri
info: downloading component 'miri'
info: installing component 'miri'
info: rolling back changes
error: component manifest for 'miri' is corrupt

@RalfJung
Copy link
Member Author

Also, shouldn't it be called miri-preview?

@aleksmelnikov
Copy link

@RalfJung ,

rustup component add miri-preview
error: toolchain 'nightly-x86_64-unknown-linux-gnu' does not contain component 'miri-preview' for target 'x86_64-unknown-linux-gnu'

@mati865
Copy link
Contributor

mati865 commented Mar 16, 2019

I debugged rustup and there is mismatch between miri and miri-preview.
Rust's dist crates directory miri-preview but but the manifest tells rustup to look for miri.
Chaning miri-preview to miri is simple, the other way around requires a bit more work.

I can try to fix it but which name should be used miri or miri-preview?

@oli-obk
Copy link
Contributor

oli-obk commented Mar 16, 2019

if there's a discrepancy anyway, let's go with miri-preview in order to communicate the unstable nature of it

@mati865
Copy link
Contributor

mati865 commented Mar 16, 2019

Opened rust-lang/rust#59236

@RalfJung
Copy link
Member Author

@mati865 awesome, thanks!

But then I assume rustup also needs updating? With https://github.com/rust-lang/rustup.rs/pull/1606/files, it says to install miri when the cargo-miri binary is missing.

@mati865
Copy link
Contributor

mati865 commented Mar 16, 2019

IIRC both miri and miri-preview should work because of rename.

@aleksmelnikov
Copy link

rustup component list | grep miri
miri-x86_64-unknown-linux-gnu
rustup component add miri
info: downloading component 'miri'
info: installing component 'miri'
info: rolling back changes
error: component manifest for 'miri' is corrupt

rustup component add miri-preview
error: toolchain 'nightly-x86_64-unknown-linux-gnu' does not contain component 'miri-preview' for target 'x86_64-unknown-linux-gnu'

Ping. It's still unavailable.

@mati865
Copy link
Contributor

mati865 commented Mar 18, 2019

@superriva the PR isn't merged yet.

@orium
Copy link
Member

orium commented Mar 23, 2019

rust-lang/rust#59236 landed. Does rustup need to be updated as well?

@mati865
Copy link
Contributor

mati865 commented Mar 23, 2019 via email

@mati865
Copy link
Contributor

mati865 commented Mar 24, 2019

🎊 Seems to be finally fixed, running in clear container:

root@bc89da8c8ed5:/# rustup component add miri
info: downloading component 'miri'
info: installing component 'miri'
root@bc89da8c8ed5:/# cargo miri
It seems you do not have a recent enough xargo installed. I will run `cargo install xargo -f`. Proceed? [Y/n]
...

@oli-obk
Copy link
Contributor

oli-obk commented Mar 25, 2019

cc @shepmaster you can now install miri as a component instead of building it yourself

@RalfJung
Copy link
Member Author

Awesome. :)

@orium
Copy link
Member

orium commented Mar 30, 2019

The component doesn't seem to be available anymore:

$ rustup component add --toolchain nightly miri-preview
error: component 'miri' for target 'x86_64-unknown-linux-gnu' is unavailable for download for channel 'nightly'

@RalfJung
Copy link
Member Author

Yeah, that is waiting for rust-lang/rust#59555 to land.

Just like Clippy and RLS, Miri sometimes gets broken by rustc changes and then a fix has to land before it can be installed via rustup again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ux Area: This affects the general user experience C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

No branches or pull requests

6 participants