-
-
Notifications
You must be signed in to change notification settings - Fork 34
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 resolves different versions of dependencies (with different MSRV) from Cargo 1.60 and up #728
Comments
Happy to help if I can! Attempts to reproduceI shallow cloned your repo and got the following (locally): Making sure I'm running the latest release, and not the latest beta
Showing the MSRV
Running `cargo msrv` to find the MSRVNB: In this case it will never go below the currently set rust-version, which is 1.59. I also removed the rust-version and ran the test again; then the MSRV is still 1.59, because rayon-core requires 1.59 or newer.
Running cargo msrv verify (I expected it to succeed since the MSRV was found to be 1.59)
Setting the MSRV to 1.58 test whether that would fail (as expected)
Running some commands on linked commit `a4aa0acc`
After the above I checked with your linked commit.
Request for more information :)
For what MSRV do you expect it to fail? Running it locally suggests the MSRV is 1.59 (that's equivalent to the rust-version defined in the Cargo manifest), so running
There should be more text indeed. Can you perhaps try the json output format to confirm it has nothing to do with the indicatif based formatter used by default:
-> I'm running a pipeline with the above here: https://github.com/foresterre/cargo-msrv-exrs/actions/runs/5444486707/jobs/9902405414?pr=1 |
Hi! Thanks for your help so far, and for taking the time to help me. I realize I forgot some important information, sorry. The main/master branch is fine. But a currently open PR should fail, which is the branch The reason why I expect it to fail is because a dependency ( Running |
Yes I'll do that :) |
An initial reply; I will need to dive a bit deeper before I can conclude anything, however, when I check out the branch (which defines 1)
2) (I use 1.70 here explicitely, but latest stable would be fine too)
I get different results, based on which Rust (or really Cargo) version resolves the Cargo.lock file. Both use resolver |
Fails locally for me, even after
Cargo.lock Edit: Wait, it also fails for master now, what is happening :o
|
Your stable Rust version shouldn't matter for cargo-msrv, all calls to Cargo go through
It may be still using an old lock file, especially since it is in the gitignore, so you won't be notified on switching branches. |
I created a new crate for minimal reproduction, and tested this issue with all toolchains from Rust 1.56 - 1.70 here: https://github.com/foresterre/wow-cargo The resolver behaviour really seems to change from Rust I also checked the cargo changelog: https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-160-2022-04-07 To me, there is nothing which explicitely stands out: there are no changes to the resolver itself. |
I asked on Zulip in the t-cargo channel. There is a Cargo issue open: rust-lang/cargo#10623 The problem is caused by the new
Thanks to @Eh2406 on Zulip for pointing me to Cargo issue. I'm thinking about what to do from here; there doesn't seem to be a proper solution (at first sight at least). |
I think I ran |
When I tried |
But independent of dependency management, the following conditions should always lead to a failure, but somehow succeed:
I don't think it's possible that Cargo will ever select a version of Therefore, it's perhaps a caching issue in the pipeline. I think I'll try some kind of clean build without caching in the pipeline |
I think that should be impossible, indeed.
|
I'll try to remove the caching from my pipeline and run the tool without any Cargo.lock :) |
The script I used, to avoid caching is: steps:
- uses: actions/checkout@v2
- name: Install foresterre/cargo-msrv without cache (takes longer, but caching produces unexpected behaviour)
run: cargo install cargo-msrv
- name: Verify the Rustc version declared in `cargo.toml`
run: |
rm -f Cargo.lock
cargo update
cargo-msrv verify And it worked! The pipeline failed, as it should :) |
Hi! I'm using GitHub Workflows to check PRs. I also added a check ensuring that all PRs conform to the
rust-version
defined in the projectsCargo.toml
. However, it seems I got something wrong. Do you have an idea what could be the problem? :)Here's what I've got:
(see https://github.com/johannesvollmer/exrs/blob/a4aa0acc9fe9d4467eabf47cb647ff99dc7b10b5/.github/workflows/rust.yml#L39)
I checked that your tool returns exit codes. Somehow, the check does not fail though. This is the output I get from GitHub:
(see https://github.com/johannesvollmer/exrs/actions/runs/5441981161/jobs/9896601827?pr=191)
Shouldn't there be more text? The same command correctly fails on my local machine. Maybe you have an idea? :)
The text was updated successfully, but these errors were encountered: