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

--version should also print the mir-json version #77

Open
sauclovian-g opened this issue Sep 18, 2024 · 2 comments
Open

--version should also print the mir-json version #77

sauclovian-g opened this issue Sep 18, 2024 · 2 comments
Labels

Comments

@sauclovian-g
Copy link
Contributor

Currently if you ask the mir-json tools for their version they print the rustc version, which is important, but realistically they should also print the mir-json version. Maybe also the current JSON schema version too, now that we have one.

In order to do this we need a version, but there is actually one in the cargo metadata (maybe we should bump it for the recent JSON changes?) so this shouldn't be that difficult to arrange.

@RyanGlScott
Copy link
Contributor

I agree that we should do this. I'm unclear if the rustc API offers a clean way to override the behavior of the --version flag, but if nothing else, we could reimplement --version ourselves. (The rustc implementation can be found here.)

@spernsteiner
Copy link
Collaborator

I'm unclear if the rustc API offers a clean way to override the behavior of the --version flag

Doesn't look like it - the version string is baked in when librustc_interface is compiled: https://github.com/rust-lang/rust/blob/9110d925d0b3e4842376e830f4404a28e1aa2658/compiler/rustc_interface/src/util.rs#L654-L657

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

No branches or pull requests

3 participants