-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cargo can't update itself when new Rust editions are released and its dependencies update to use them #11266
Comments
Cargo is only intended to work with the version of Rust it shipped with. You cannot use Cargo to install a newer version of Cargo. If you want to update you'll need follow the instructions from the place you installed it. If you installed using rustup then Whether in general cargo should downgrade your dependencies to match the outdated version of Rust you are using is an interesting design question, hinging on how much capacity the community has for maintaining older versions of libraries. This question has been discussed at length in a number of venues. It is not clear what the correct solution is. https://rust-lang.github.io/rfcs/2495-min-rust-version.html is an accepted suggestion for at least improving the error messages when that is the source of the problem. |
Thanks for clearing that up @Eh2406. I didn't even want to update Cargo today, I just wanted to use my Rust 1.50 to build a But Cargo was going and trying to use Is there something the package author should have done when they released the package (like make a lockfile?) that would have prevented it from not being able to build anymore on a Cargo/ |
Normally cargo will fail and tell you what package had failed for MSRV and you can then use #10623 is one issue with but we can't time travel to fix old versions, unfortunately. There has been talk of an MSRV-aware resolver and other solutions to improve the MSRV situation. I don't have the various links at the moment to point to. |
|
Problem
I have
rustc 1.50.0 (cb75ad5db 2021-02-10)
andcargo 1.50.0 (f04e7fab7 2021-02-04)
. This Cargo is old, and I would like to upgrade it to the next version.I think reported version
1.50.0
is really crate version0.50.0
, so let me just install the next minor release:Cargo is not able to update itself, I think because its dependencies have released new versions which match version specifiers higher in the dependency tree, and the dependency resolver isn't considering whether the current version of Cargo (or even
rustc
) will be able to use the versions it is selecting.Steps
Possible Solution(s)
The dependency resolver could backtrack when it downloads a dependency and finds it requires an unavailable
edition
or otherwise has an un-parse-able manifest. The registry could record what editions or versions of Cargo or Rust a crate release is compatible with, and Cargo could use that information to avoid trying to install things it cannot handle.Notes
Python's
pip
understands that some releases of some packages only work on some versions of Python, and uses this information when selecting dependency versions to install.Version
The text was updated successfully, but these errors were encountered: