-
Notifications
You must be signed in to change notification settings - Fork 148
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-upgrade --to-lockfile
fails to upgrade renamed dependencies
#750
Comments
cargo-upgrade --to-lockfile
fails to upgrade renamed dependencies
Can you confirm which version of |
I meant to include that in my demo but it didn't make it in 🙃 〉playground〉cargo upgrade -vV
cargo-upgrade 0.10.2
〉playground〉cargo -vV
cargo 1.62.1 (a748cf5a3 2022-06-08)
release: 1.62.1
commit-hash: a748cf5a3e666bc2dcdf54f37adef8ef22196452
commit-date: 2022-06-08
host: x86_64-pc-windows-msvc
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:Schannel)
os: Windows 10.0.22000 (Windows 10 Education) [64-bit] |
Oh right, forgot about the rename behavior. If you run cargo-upgrade with We hint at this behavior with the note
As I'm thinking through this, some things I'm going to be considering (and welcome others thoughts on)
|
I think why it "failed" in the actual repo is that the precision was So I think the takeaway here would be
|
## Motivation Fix minimal-versions failure. ## Solution Upgrade all the dependencies to their most recent semver-compatible version, adjusting back down as necessary for MSRV. Essentially a cherry-pick of #2231, but redone by hand. ## Tests - `cargo minimal-versions msrv verify -- cargo check --all-features` - `cargo minimal-versions msrv verify -- cargo check --no-default-features` ## Methodology - `cargo update && cargo upgrade --to-lockfile` - Identify [a bug](killercup/cargo-edit#750) and manually resolve it - loop; upgrade transitive deps - `cargo minimal-versions check --all-features` - Identify failing dep - `cargo minimal-versions tree -i dep --all-features` - Find the closest dependency leading to pulling in `dep` - `cargo add fixdep --optional` to force a more recent more-minimal-versions-correct version - loop; downgrade to msrv - `cargo minimal-versions msrv verify -- cargo check --all-features` - Identify failing dep - `cargo minimal-versions tree -i dep --all-features` - Find the version that supports MSRV from lib.rs - `cargo upgrade dep@msrv`
I remembered the big reason why I was blaming cargo-upgrade for having a bug: Another note on renames; ideally: In the specific case of [dependencies."lib.name"]
package = "package.name" this should not be considered a pinned dependency, and should be treated as a normal dependency. There's two reasonable ways that this can come into being:
Similarly, renaming to |
I think something that will help is that I'm considering adding a
FYI the cargo team has not yet decided if it will adopt this docs.rs convention, see rust-lang/cargo#10794 (comment) |
I lean towards keeping the current behavior and not adding a flag. I think the table view will help raise visibility of what is happening to be sufficient. If someone doesn't like the existing behavior, its a one time change to their lock file (set full precision) A flag effectively would automate that one-time change and doesn't seem to justify the cost of increasing the surface area of the UX. |
This provides a `cargo outdated`-like UI, reducing the need for one extra tool and helps raise visibility into cargo-upgrades decisions in a pretty way (compared to lines and lines of warnings). Fixes killercup#750
While it is true it is a one-time cost to make the migration, in a workspace such as tokio-rs/tracing#2246, it's not a trivial change to do by hand due to there being multiple manifests involved. For that PR I did a A more difficult task would be doing so for a single dependency rather than all dependencies. Ideally, in such a minver correctness diff, instead of {upgrade to lockfile; downgrade to msrv} you'd upgrade each dependency only as-needed, which is significantly more work, especially if it involves manual steps1 (e.g. to increase dependency precision). Personally I would prefer Footnotes
|
This provides a `cargo outdated`-like UI, reducing the need for one extra tool and helps raise visibility into cargo-upgrades decisions in a pretty way (compared to lines and lines of warnings). Fixes killercup#750
This provides a `cargo outdated`-like UI, reducing the need for one extra tool and helps raise visibility into cargo-upgrades decisions in a pretty way (compared to lines and lines of warnings). Fixes killercup#750
This provides a `cargo outdated`-like UI, reducing the need for one extra tool and helps raise visibility into cargo-upgrades decisions in a pretty way (compared to lines and lines of warnings). Fixes killercup#750
## Motivation Fix minimal-versions failure. ## Solution Upgrade all the dependencies to their most recent semver-compatible version, adjusting back down as necessary for MSRV. Essentially a cherry-pick of #2231, but redone by hand. ## Tests - `cargo minimal-versions msrv verify -- cargo check --all-features` - `cargo minimal-versions msrv verify -- cargo check --no-default-features` ## Methodology - `cargo update && cargo upgrade --to-lockfile` - Identify [a bug](killercup/cargo-edit#750) and manually resolve it - loop; upgrade transitive deps - `cargo minimal-versions check --all-features` - Identify failing dep - `cargo minimal-versions tree -i dep --all-features` - Find the closest dependency leading to pulling in `dep` - `cargo add fixdep --optional` to force a more recent more-minimal-versions-correct version - loop; downgrade to msrv - `cargo minimal-versions msrv verify -- cargo check --all-features` - Identify failing dep - `cargo minimal-versions tree -i dep --all-features` - Find the version that supports MSRV from lib.rs - `cargo upgrade dep@msrv`
## Motivation Fix minimal-versions failure. ## Solution Upgrade all the dependencies to their most recent semver-compatible version, adjusting back down as necessary for MSRV. Essentially a cherry-pick of tokio-rs#2231, but redone by hand. ## Tests - `cargo minimal-versions msrv verify -- cargo check --all-features` - `cargo minimal-versions msrv verify -- cargo check --no-default-features` ## Methodology - `cargo update && cargo upgrade --to-lockfile` - Identify [a bug](killercup/cargo-edit#750) and manually resolve it - loop; upgrade transitive deps - `cargo minimal-versions check --all-features` - Identify failing dep - `cargo minimal-versions tree -i dep --all-features` - Find the closest dependency leading to pulling in `dep` - `cargo add fixdep --optional` to force a more recent more-minimal-versions-correct version - loop; downgrade to msrv - `cargo minimal-versions msrv verify -- cargo check --all-features` - Identify failing dep - `cargo minimal-versions tree -i dep --all-features` - Find the version that supports MSRV from lib.rs - `cargo upgrade dep@msrv`
Example (from nushell):
The text was updated successfully, but these errors were encountered: