rust-lang / miri

An interpreter for Rust's mid-level intermediate representation
Apache License 2.0
4.56k stars 343 forks source link

cargo-miri version information is outdated #3845

Closed JoJoDeveloping closed 1 month ago

JoJoDeveloping commented 2 months ago

Would it be possible to add version information to miri? Currently, running miri --version forwards this flag to rustc, so it prints e.g.

$ miri --version
rustc 1.82.0-nightly (fdf61d499 2024-08-20)

which is not useful.

Instead, it would be nice to have miri --version and maybe even cargo miri version. My personal use-case is that I want to double-check that I am using the correct miri when I am making modifications to it to debug/test some other code somewhere else.

RalfJung commented 2 months ago

which is not useful.

Why not? The commit is in the rustc repo, which contains Miri, so it says exactly the commit you have to look at to find out which version of Miri rustup installed.

running miri --version forwards this flag to rustc

That's not quite right. There's no separate rustc binary we are forwarding this to. Miri is a rustc driver and so this shows the version of the rustc driver Miri is using.

JoJoDeveloping commented 2 months ago

That's unfortunately not true if you build miri yourself, is it?

RalfJung commented 2 months ago

Ah, yeah. But that's going to be a dev version anyway so the version should probably just say "dev" or so, similar to what local rustc builds do.

rustc 1.82.0-dev
RalfJung commented 2 months ago

Also note that cargo miri --version exists. That's just the version of cargo-miri though, it does not check the miri driver binary.

JoJoDeveloping commented 2 months ago

Yes.. for me that prints

miri 0.1.0 (a84aba2f gpg: Signature made Mi 21 Aug 2024 21:08:09 CEST)

Which is interesting, but I can not even find the commit (or whatever it is) referenced there. In general, what repository do they belong to?

Also, the last change I made to the miri installation I ran this command in was today. So again, there's no way of getting the miri version.

RalfJung commented 2 months ago

Generally, development versions don't have a version. That's deliberate, and consistent with rustc.

Which is interesting, but I can not even find the commit (or whatever it is) referenced there. In general, what repository do they belong to?

If you installed via ./miri install, it should be a commit in the Miri repo. However due to https://github.com/rust-lang/rust-clippy/issues/13312 the commit may be outdated.