]> git.proxmox.com Git - cargo.git/commit
Auto merge of #9827 - weihanglo:issue-6199, r=Eh2406
authorbors <bors@rust-lang.org>
Wed, 25 Aug 2021 17:36:11 +0000 (17:36 +0000)
committerbors <bors@rust-lang.org>
Wed, 25 Aug 2021 17:36:11 +0000 (17:36 +0000)
commit77a03793420fa7eb9f070ba44c5994987885c6b7
tree88412a3ad0887ffdb2dd80c6fb1d1afdb1b1c5ed
parent851defd30199b82cd84595cb036fc3250fa0f17f
parenta5f8bc94f5d38539dd127f735ea4d3a515c230fd
Auto merge of #9827 - weihanglo:issue-6199, r=Eh2406

Improve resolver message to include dependency requirements

Resolves #6199.

Thanks for previous efforts: #5452, #6374, #6665, which are great but somehow outdated, so I tweak them and create this PR. This will also be obsolete if we ship pubgrub-rs with cargo in the future ðŸ˜ƒ But before that happens, IMO these changes are still helpful.

---

This PR changes the resolver error message from

https://github.com/rust-lang/cargo/blob/216f915c46b8ada2323423d049314ba18247ef95/tests/testsuite/build.rs#L1104-L1106

to

https://github.com/rust-lang/cargo/blob/0afd40b4de17a5c45145a0762beb4ef001720fe1/tests/testsuite/build.rs#L1104-L1106

Also provide different message for different source kinds, such like:

https://github.com/rust-lang/cargo/blob/0afd40b4de17a5c45145a0762beb4ef001720fe1/tests/testsuite/build.rs#L2810-L2812

## TODO?

From https://github.com/rust-lang/cargo/pull/5452#issuecomment-402832200, there shall be at least one task left behind:

> 3. Special case pind by a lock file and not a `"=1.1.2"` in a dependency. Also add a "note: try cargo update" to the end.

In this PR, `validate_links` also faces this issue that a dependency requirement is locked into a precise version `=0.1.0`.

https://github.com/rust-lang/cargo/blob/a5f8bc94f5d38539dd127f735ea4d3a515c230fd/tests/testsuite/build_script.rs#L1002-L1004

I am uncertain about how to resolve this. Besides  the function`validate_links`, is this problem really a thing that may happen? If not, since `validate_links` only handles old validation logic, it may be ok to drop the commit a5f8bc94f5d38539dd127f735ea4d3a515c230fd and leave it as is.
src/cargo/core/resolver/mod.rs