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

Add some more information to verbose version. #9968

Merged
merged 3 commits into from
Oct 11, 2021

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Oct 8, 2021

This adds a little bit of extra information to the verbose version command.

cc #6275 and #6161

Some examples of what it might look like:

cargo 1.57.0
release: 1.57.0
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1-DEV (sys:0.4.49+curl-7.79.1 vendored ssl:OpenSSL/1.1.1k)
ssl: OpenSSL 1.1.1k  25 Mar 2021
cargo 1.57.0
release: 1.57.0
host: x86_64-pc-windows-msvc
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1-DEV (sys:0.4.49+curl-7.79.1 vendored ssl:Schannel)
cargo 1.57.0
release: 1.57.0
host: x86_64-apple-darwin
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.64.1 (sys:0.4.49+curl-7.79.1 system ssl:(SecureTransport) LibreSSL/2.8.3)
ssl: OpenSSL 1.1.1l  24 Aug 2021

@rust-highfive
Copy link

r? @Eh2406

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 8, 2021
@ehuss
Copy link
Contributor Author

ehuss commented Oct 8, 2021

This doesn't include everything mentioned in #6275 and #6161. Things not included:

  • Doesn't include git hashes for various libraries. I think the version information provided should be sufficient, and that information is generally not available.
  • Doesn't explicitly call out SChannel/SecureTransport, however libcurl shows that for us, and I think that's all that really matters.
  • libgit2 doesn't expose information about which ssl library it is using.
  • libssh2: didn't include anything, it is not currently exposed. Also, issue reports around ssh2 are extremely rare, so this didn't seem too interesting to me.
  • zlib: This is not exposed, and not too interesting to me.
  • default target: I'm not sure what this means (the build.target config value?). I didn't think this was too interesting.
  • current crates.io index version: This isn't particularly interesting to me, since I don't recall ever seeing any issues posted that needed to use an older index.

I'm not saying the above information isn't useful, I just don't want to spend a lot of time on this.

The only thing missing that I really want is the OS version. However, that is extremely difficult to get reliably. I found https://crates.io/crates/os_info which actually looks to be pretty thorough and well written for the few platforms that I looked at. However, I don't know if that covers every platform we build for, and I fear it will make life difficult for people porting cargo to other platforms. Thoughts?

@alexcrichton
Copy link
Member

For OS version information are you thinking of learning about things like the macOS patch number or things like that? I find it doesn't come up too too often but I agree that if it's easy-ish to put in here then we may as well because it can often be a red flag if something is super old or extremely new.

I'm not too worried about the platform compatibility in that if we know about it ahead of time we can have it be opt-in for platforms instead of opt-out. For example we could probably turn it on for macOS and Windows by default and then allow-list platforms like Linux and such as they are implemented. If something is missing from a platform's cargo -vV then we still have the host target that Cargo was built for which helps at least a little bit.

Otherwise though this looks great to me and r=me when you feel like this is ready.

@Eh2406
Copy link
Contributor

Eh2406 commented Oct 11, 2021

Thank you for moving this forward!

I have had cases where resolver bugs did not reproduce that we thought where do to index changes. But now I cant find a link to an example. So it can't be that common.

os_info looks pretty useful, may as well use it.

Anyway +1 from me when you are happy!

@ehuss
Copy link
Contributor Author

ehuss commented Oct 11, 2021

OK, I went ahead and added os_info. It looks like it has a fallback for all unknown platforms. If it causes problems, we can figure out what to do from there.

@bors r=alexcrichton,Eh2406

@bors
Copy link
Contributor

bors commented Oct 11, 2021

📌 Commit 9f5da7c has been approved by alexcrichton,Eh2406

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2021
@bors
Copy link
Contributor

bors commented Oct 11, 2021

⌛ Testing commit 9f5da7c with merge c7957a7...

@bors
Copy link
Contributor

bors commented Oct 11, 2021

☀️ Test successful - checks-actions
Approved by: alexcrichton,Eh2406
Pushing c7957a7 to master...

@bors bors merged commit c7957a7 into rust-lang:master Oct 11, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2021
Update cargo

7 commits in d56b42c549dbb7e7d0f712c51b39400260d114d4..c7957a74bdcf3b11e7154c1a9401735f23ebd484
2021-09-27 13:44:18 +0000 to 2021-10-11 20:17:07 +0000
- Add some more information to verbose version. (rust-lang/cargo#9968)
- Skip all `cargo fix` that tends to write to registry cache. (rust-lang/cargo#9938)
- Stabilize named profiles (rust-lang/cargo#9943)
- Update git2 (rust-lang/cargo#9963)
- Distinguish lockfile version req from normal dep in resolver error message (rust-lang/cargo#9847)
- nit: Allocated slightly bigger vec than needed (rust-lang/cargo#9954)
- Add shell completion for shorthand commands (rust-lang/cargo#9951)
@ehuss ehuss added this to the 1.57.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants