cargo: cargo update should not highlight non-semver-compatible "(latest: v0.23.5)" for indirect dependencies

Problem

I just ran my weekly cargo update against the workspace at work, and it highlighted this change:

    Updating rustls v0.21.11 -> v0.21.12 (latest: v0.23.5)

This workspace does not have a direct dependency on rustls. As such, I would suggest this information isn’t actionable enough to merit a mention in the non-verbose cargo update output (it would definitely fit in with the verbose output).

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.78.0 (54d8815d0 2024-03-26)
release: 1.78.0
commit-hash: 54d8815d04fa3816edc207bbc4dd36bf18014dbc
commit-date: 2024-03-26
host: aarch64-apple-darwin
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.4.0 (sys:0.4.72+curl-8.6.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Mac OS 14.4.1 [64-bit]

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Agree it is not actionable locally and quite verbose, especially when you have only few direct dependencies and that’s very noisy. (…) Putting in behind --verbose would reduce the change of it. It is also a more consistent console output that an update always comes with latest version information, but not some are behind --verbose some are not.

This seems like bad reasoning, since cargo update --verbose reveals a bunch more crates that similarly have semver-incompatible versions (but somehow these are not being shown without --verbose):

Unchanged hyper-rustls v0.24.2 (latest: v0.27.1)

I suppose that the (latest ..) notice for rustls is only shown because there was a semver-compatible bump, but IMO that’s not a good reason to also show the (latest ..) notice for non-direct semver-incompatible versions.

If anything, I would be happy if you showed Unchanged semver-incompatible bumps for my workspace’s direct dependencies, but it currently doesn’t – so that also feels inconsistent.

To summarize:

  • I think Updating notices should not show (latest ..) if the latest version is semver-incompatible with the selected version (because that doesn’t fit in with the scope of cargo update)
  • Maybe the color should change for (latest ..) notices advertising a version that is semver-incompatible with the selected version, making it green instead?
  • Even for Unchanged notices from cargo update --verbose it’s not obvious to me that it makes sense to show (latest ..) notices for semver-incompatible versions, since that’s historically outside of the scope of update
  • On the other hand, it would be great to start extending cargo update to help users address semver-incompatible bumps, and one good way to go about that would be to start noting available semver-incompatible updates for direct dependencies using a (latest ..) notice independent from if the dependency got updated

However, I see it as an opportunity to encourage user to collaborate with upstreams.

(I happen to do a lot of this, trying to push the ecosystem forward – but I think I’m in a small minority, and anyway it’s still a different level of actionable/effort to effect changes like this, so any production user will have to timebox these efforts.)

(cc @epage who’s done a lot of work in this area.)

Sorry for the delay, I’ve been doing some focused time trying to wrap things up before I get to my 100+ github notifications between MSRV, 2024 Edition, and RustNL (wish timing worked to talk to you in person about this).

This also caused confusion in https://github.com/rust-lang/cargo/issues/13873#issuecomment-2100460976

This was previously discussed in #13372. The idea behind this comes from

  • A desire to help users know about dependencies held back generally (#7167, #4309)
    • MSRV and semver are two ways dependencies can be held back and we should acknowledge and handle both, as well as other reasons (missing feature, non-semver bounds, etc)
  • On-going work to integrate cargo upgrade into cargo update (#12425)
  • The state of your entire dependency is relevant even if you can’t directly act on indirect dependencies
  • This is the more trivial solution so starting there and collecting feedback (which we did in the PR itself and with the call for testing for MSRV more generally) is the better approach

If anything, I would be happy if you showed Unchanged semver-incompatible bumps for my workspace’s direct dependencies, but it currently doesn’t – so that also feels inconsistent.

I’d have to check the implementation and issues, but I have a feeling this runs counter to the feedback you gave for cargo upgrade.

CC @jonhoo as you mentioned in the release changes stream your excitement for reporting changes and want to make sure we capture multiple perspectives