Skip to content
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

unable to build older releases due to MSRV conflict #4811

Closed
2 tasks done
tones111 opened this issue Mar 30, 2023 · 2 comments
Closed
2 tasks done

unable to build older releases due to MSRV conflict #4811

tones111 opened this issue Mar 30, 2023 · 2 comments
Labels
C-bug Category: Updating dependencies

Comments

@tones111
Copy link

Please complete the following tasks

Rust Version

1.62.1

Clap Version

v4.0.32

Minimal reproducible code

N/A

Steps to reproduce the bug with the above code

cargo new --bin args
cd args
cargo add clap@=4.0.32
cargo +1.62.1 check

Actual Behaviour

error: package `clap_lex v0.3.3` cannot be built because it requires rustc 1.64.0 or newer, while the currently active rustc version is 1.62.1

Expected Behaviour

Since the MSRV for clap v4.0.32 is rust 1.60.0 I expect to be able to compile with the 1.62.1 compiler.

Additional Context

It looks like the version numbers for dependencies need to be constrained to prevent cargo from picking a version with an incompatible MSRV. In this case clap_lex should be fixed to v0.3.0 since v0.3.1 bumped the MSRV to rust 1.64.0. There may be other incompatibilities... this is just the first error presented.

Debug Output

No response

@tones111 tones111 added the C-bug Category: Updating dependencies label Mar 30, 2023
@tones111
Copy link
Author

It looks like I'm able to build by adding the constraint described above to v4.0.32.

-clap_lex = { path = "./clap_lex", version = "0.3.0" }
+clap_lex = { path = "./clap_lex", version = "=0.3.0" }

however, I'm unable to create a pull request since there's no branch at that point in the repo. Would it be possible to tag a v4.0.33 with this change?

@epage
Copy link
Member

epage commented Mar 30, 2023

The way to solve this is for you to run cargo update -p clap_lex --precise 0.3.0. Newer versions of cargo should include that suggestion in the error.

Unfortunately, crates can only be responsible that they can build for the MSRV but should not be responsible for all of versions of dependencies to build for the MSRV

The ideal long term solution is for cargo to handle this automatically which I'm working towards: rust-lang/cargo#9930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Updating dependencies
Projects
None yet
Development

No branches or pull requests

2 participants