-
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 <1.60 failed to select a version of a dependency due to either ?
(weak) or dep:
(namespaced) features
#10623
Comments
Looks like I missed that libgit2-sys uses a weak dependency (really hard to see that My guess is that this is expected behavior when loading this into old versions of cargo. |
Considering the usability issue of this, re-opening for us providing better errors. |
From #10688 |
See also #7929 which discusses some related issues to the resolver not telling you why something wasn't picked. I took a quick peek, and it seems like it will be quite difficult to thread the information through. There are many layers of abstractions between where the filtering happens and where the resolver fetches it. Also, the resolver API doesn't look like it is designed to funnel partial errors out of the I'd love to see the error messages improved, but it looks like it could be a big undertaking. |
?
(weak) or dep:
(namespaced) features
Due to rust-lang/cargo#10623, cargo-bitbake needs at least cargo 1.60 to be built.
This reproduces the problem in rust-lang#10623.
This reproduces the problem in rust-lang#10623.
This reproduces the problem in rust-lang#10623.
This reproduces the problem in rust-lang#10623.
This reproduces the problem in rust-lang#10623.
Below examples are a bit verbose, but may provide some value? 🤷♂️ (I'm mostly documenting the experience) The
I don't really use such old toolchain releases, but was contributing to a crate which did where I encountered this resolver confusion (later discovering
I'm not sure if this sort of incompatibility has also been introduced again in newer toolchain releases since too? (It was definitely unexpected 😅 ) Example - Resolving
|
Bad error messages with |
Not quite the same error but a related problem with us showing an unrelated error that is rooted in MSRV can be found at rust-cli/env_logger#304. I haven't created a separate issue for this yet as I'm still not sure what I'd be asking for moving forward (since we can't time travel to <1.71). |
…ge (#14897) ### What does this PR try to resolve? Instead of saying no package found when there are hidden `Summary`s, we'll instead say why the summary was hidden in the cases of - Yanked packages - Schema mismatch - Offline packages? The schema mismatch covers part of #10623. Whats remaining is when we can't parse the `Summary` but can parse a subset (name, version, schema version, optionally rust-version). That will be handled in a follow up. ### How should we test and review this PR? This has a couple of risky areas - Moving the filtering of `IndexSummary` variants from the Index to the Registry Source. On inspection, there were other code paths but they seemed innocuous to not filter, like asking for a hash of a summary - Switching `PackageRegistry` to preserve the `IndexSummary` variant for regular sources and overrides - I did not switch patches to preserve `IndexSummary` as that was more invasive and the benefits seemed more minor (normally people patch over registry dependencies and not to them) ### Additional information
…14923) ### What does this PR try to resolve? The user likely intended what they said and we should tell them why it didn't work. Rejected versions also imply alt versions below them. Fixes #4260 In changing the errors from alt-versions to rejected-versions, I found part of the old error message was better and changed the message introduced in #14897 from matching alt-names to alt-versions. This includes the test for #14921. The "fix" was done before this because as it was part of the refactors in prep for this. ### How should we test and review this PR? ### Additional information Next steps after this are to still produce an `IndexSummary::Unsupported` even if there are deserialization errors, so long as we know the name and version which should take care of #10623 and #14894.
While rust-lang#14897 reported packages with an unsupported index schema version, that only worked if the changes in the schema version did not cause errors in deserializing `IndexPackage` or in generating a `Summary`. This extends that change by recoverying on error with a more lax, incomplete parse of `IndexPackage` which should always generate a valid `Summary`. To help with a buggy Index, we also will report as many as we can. This does not provide a way to report to users or log on cache reads if the index entry is not at least `{"name": "<string>", "vers": "<semver>"}`. As a side effect, the index cache will include more "invalid" index entries. That should be ok as we will ignore the invalid entry in the cache when loading it. Ignoring of invalid entries dates back to rust-lang#6880 when the index cache was introduced. Fixes rust-lang#10623 Fixes rust-lang#14894
While rust-lang#14897 reported packages with an unsupported index schema version, that only worked if the changes in the schema version did not cause errors in deserializing `IndexPackage` or in generating a `Summary`. This extends that change by recoverying on error with a more lax, incomplete parse of `IndexPackage` which should always generate a valid `Summary`. To help with a buggy Index, we also will report as many as we can. This does not provide a way to report to users or log on cache reads if the index entry is not at least `{"name": "<string>", "vers": "<semver>"}`. As a side effect, the index cache will include more "invalid" index entries. That should be ok as we will ignore the invalid entry in the cache when loading it. Ignoring of invalid entries dates back to rust-lang#6880 when the index cache was introduced. Fixes rust-lang#10623 Fixes rust-lang#14894
### What does this PR try to resolve? While #14897 reported packages with an unsupported index schema version, that only worked if the changes in the schema version did not cause errors in deserializing `IndexPackage` or in generating a `Summary`. This extends that change by recoverying on error with a more lax, incomplete parse of `IndexPackage` which should always generate a valid `Summary`. To help with a buggy Index, we also will report as many as we can. This does not provide a way to report to users or log on cache reads if the index entry is not at least `{"name": "<string>", "vers": "<semver>"}`. Fixes #10623 Fixes #14894 ### How should we test and review this PR? My biggest paranoia is some bad interaction with the index cache including more "invalid" index entries. That should be ok as we will ignore the invalid entry in the cache when loading it. Ignoring of invalid entries dates back to #6880 when the index cache was introduced. ### Additional information
Problem
I did a
cargo update
and my CI broke when verifying MSRV.The error being from the resolver and being cargo-version specific is why I am posting here rather than on the git2 repo.
Steps
Possible Solution(s)
Track parse bad candidates when resolving and report them to the user if they are relevant
Notes
Old cargo cannot see crates in the registry that use weak or namespaced features (or similar new index data).
Version
The text was updated successfully, but these errors were encountered: