killercup / killercup/cargo-edit
`cargo upgrade` is bumping dependencies incompatible with specified rust version
- Dominant language
- Rust
- Stars
- 3.5k
- Forks
- 166
- PR merge metrics
- No merged PRs in 30d
Description
First things first, this is a great tool!!
My version is:
```sh
❯ cargo upgrade --version
cargo-edit-upgrade 0.13.8
```
Just having issues with the `cargo upgrade` command in a repository where we can't use a higher rust version than 1.82.
Our toolchain (`rust-toolchain.toml`) file looks like this:
```toml
[toolchain]
channel = "1.82.0"
```
When executing:
`cargo upgrade` and afterwards run the tests, we get:
```sh
❯ cargo test
error: rustc 1.82.0 is not supported by the following packages:
icu_collections@2.1.1 requires rustc 1.83
icu_locale_core@2.1.1 requires rustc 1.83
icu_normalizer@2.1.1 requires rustc 1.83
icu_normalizer_data@2.1.1 requires rustc 1.83
icu_normalizer_data@2.1.1 requires rustc 1.83
icu_normalizer_data@2.1.1 requires rustc 1.83
icu_properties@2.1.1 requires rustc 1.83
icu_properties_data@2.1.1 requires rustc 1.83
icu_properties_data@2.1.1 requires rustc 1.83
icu_properties_data@2.1.1 requires rustc 1.83
icu_provider@2.1.1 requires rustc 1.83
Either upgrade rustc or select compatible dependency versions with
`cargo update @ --precise `
where `` is the latest version supporting rustc 1.82.0
```
This doesn't help either:
`cargo upgrade --rust-version 1.82.0`
This feels like a bug, the packages are clearly saying 1.82 is not supported, yet it's updating them.
Thanks for looking into it!
Contributor guide
Research direction
Reproduce the failure with the rust-toolchain.toml pinned to Rust 1.82.0, then run cargo upgrade --rust-version 1.82.0 and cargo test. Start by tracing how cargo upgrade handles the rust-version constraint and dependency metadata. Done means upgraded dependencies remain compatible with Rust 1.82.0 and the reported cargo test failure no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100