fix(msrv): Report all incompatible packages, not just a random one#13514
Merged
bors merged 2 commits intorust-lang:masterfrom Mar 1, 2024
Merged
fix(msrv): Report all incompatible packages, not just a random one#13514bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
In rust-lang#9930, it recommended improving the error for incompatible packages so people can better get to the root of the problem. For example, you might get an error about `clap_lex` but resolving the error for the higher level `clap` could make the problem with `clap_lex` go away. Because I generally saw earlier packages in the graph reported, I assumed we were reporting these errors bottom up. It turns out, we are reporting them in the `UnitGraph`s order, which is non-deterministic because it is built on a `HashMap`. So this adds determinism and shows all incompatible dependencies (not just the bottom or the root). This is a first step. We might find that we still want to only include the shallowest units, rather than all. At that point, we can add the complexity to address this by walking the unit graph. We could also further improve this by querying the index to suggest compatible versions of packages.
Collaborator
|
r? @weihanglo rustbot has assigned @weihanglo. Use r? to explicitly pick a reviewer |
27 tasks
weihanglo
approved these changes
Mar 1, 2024
| fn dependency_tree_rust_version_newer_than_rustc() { | ||
| Package::new("baz", "0.0.1") | ||
| .dep("bar", "0.0.1") | ||
| .rust_version("1.2345.0") |
Member
There was a problem hiding this comment.
nit: choose a larger version. I believe Rust will last over 300 years!
Member
|
@bors r+ Thanks! |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 2, 2024
Update cargo 12 commits in 8964c8ccff6e420e2a38b8696d178d69fab84d9d..f772ec0224d3755ce52ac5128a80319fb2eb45d0 2024-02-27 19:22:46 +0000 to 2024-03-01 22:57:35 +0000 - feat(toml): Warn on unset Edition (rust-lang/cargo#13505) - fix(msrv): Report all incompatible packages, not just a random one (rust-lang/cargo#13514) - refactor: abstract `std::fs` away from on-disk index cache (rust-lang/cargo#13515) - chore(deps): update compatible (rust-lang/cargo#13507) - chore(deps): update rust crate rusqlite to 0.31.0 (rust-lang/cargo#13510) - [docs]: Clarify vendored sources as read-only and way to modify (rust-lang/cargo#13512) - chore(deps): update rust crate supports-hyperlinks to v3 (rust-lang/cargo#13511) - refactor: Clarify more Config -> Context (rust-lang/cargo#13506) - test: Make `edition` explicit in packages (rust-lang/cargo#13504) - Add all unit's children recursively for `doc.extern-map` option (rust-lang/cargo#13481) - fix(rustc): Always pass --edition to rustc (rust-lang/cargo#13499) - Silently ignore `cargo::rustc-check-cfg` to avoid MSRV annoyance when stabilizing `-Zcheck-cfg` (rust-lang/cargo#13438) r? ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
In #9930, it recommended improving the error for incompatible packages
so people can better get to the root of the problem.
For example, you might get an error about
clap_lexbut resolving theerror for the higher level
clapcould make the problem withclap_lexgo away.
Because I generally saw earlier packages in the graph reported, I
assumed we were reporting these errors bottom up.
It turns out, we are reporting them in the
UnitGraphs order, which isnon-deterministic because it is built on a
HashMap.So this adds determinism and shows all incompatible dependencies
(not just the bottom or the root).
How should we test and review this PR?
This is a first step.
We might find that we still want to only include the shallowest units,
rather than all.
At that point, we can add the complexity to address this by walking the
unit graph.
We could also further improve this by querying the index to suggest
compatible versions of packages.
The multi-package test wasn't split out into its own commit because hat would have required fixing the non-determinism one way to then just revert it when we fix it this way.
Additional information