-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Consider --version output more carefully #13582
Comments
FWIW, I prefer python's style. 1 line with the actual required info. |
@flaper87 that strategy sounds good to me. We need to figure out why |
@brson took the time to dig into the history. This is the commit that added the triple: 68d50b5 No special reason stated there. I'm now thinking it may probably make sense to keep it. Here's the output from other comands:
|
1.0 backcompat libs. |
How about key-value pairs to further ease parsing? rustc: VERSION where commit-id/date are simply listed as "unknown" if built from tarball; the VERSION [git tag] will work just as effectively for referencing the commit in that case. |
my suggestion:
Then scripts can interact with the output produced by |
+1 for @pnkfelix suggestion. |
Incidentally, it would be nice if the Of course if one mixes-and-matches crates then that may not be a meaningful bit of metadata to ask for. Maybe instead it could print out that sort of metadata (i.e. compilation flags for debug and optimization level) for each crate that |
Sure, I like that idea too. Thanks |
Instead of just blindly printing arg[0], use a constant string. Partial fix for rust-lang#13582
Instead of just blindly printing arg[0], use a constant string. Partial fix for rust-lang#13582
Instead of just blindly printing arg[0], use a constant string. Partial fix for #13582
Nominating for removal from milestone. There's more that can be done here, but at least the version number should be consistently parsable. |
Having the host is useful for tools which want to look for host libs (how else do you know what the host is?) but that presumably doesn't need to be part of |
Assuming we're committing to the format of the first line, it seems we can live with people parsing the first line if it comes to that. (though I personally would still prefer the stable output to be accessed via something like Reassiging to P-low and removing from milestone. |
One of my concerns with the suggested |
Closed by #13816 and co. |
feat: Nest Cargo.lock under Cargo.toml in Code Closes rust-lang#13580
The output of --version is often grepped, so it needs to be parsable and stable, and our current output has not been thought through quite enough.
Here are two examples of its current output:
The name
rustc
is actually arg[0], so it changes depending on how rustc is invoked. This makes it very hard to parse rustc's version. Note also that the info in parens is only present in git builds, so it can't be relied on.The one obvious fix is to hardcode
rustc
as the program name. As long as we leave the first line using a consistent format forever we should be mostly ok.The
host: ...
line in our output is non-conventional and might properly be put under another flag or remove it; alternately, we may want to include more info here - why is 'host' special?For comparison, here are some other
--version
outputs on my system:Also, make rustdoc consistent with whatever format is preferred.
Nominating.
The text was updated successfully, but these errors were encountered: