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

Option to skip upgrading direct dependencies if it would increase the number of copies to be built #445

Closed
ssokolow opened this issue Jan 13, 2021 · 3 comments

Comments

@ssokolow
Copy link

ssokolow commented Jan 13, 2021

Currently, in one of my actix-based projects, running cargo upgrade attempts to upgrade my dependency on tokio to v1.x.

Given that the actix dependency still demands tokio v0.2.x, that means cargo upgrade tries to change the intended semantics of my Cargo.toml from "Depend on actix and give me access to the copy of tokio it pulls in" to "Depend on actix and pull in a separate copy of tokio for me to use".

Please add an option to only perform semver-breaking upgrades of direct dependencies when it would not increase the number of copies of a given dependency that will need to be compiled and linked.

(I give that very specific definition because I have other dependencies where upgrading two direct dependencies causes a shared transitive dependency to diverge and I just consider that a necessary evil.)

@ssokolow ssokolow changed the title Option to skip upgrading dependencies if it would increase the number of copies to be built Option to skip upgrading direct dependencies if it would increase the number of copies to be built Jan 13, 2021
@epage
Copy link
Collaborator

epage commented Jul 27, 2022

Reducing number of copies is something cargo add has also punted on, so rejecting that until we look at that problem more holistically.

For holding back dependency versions, cargo upgrade now doesn't upgrade non-default version requirements by default, assuming the user has a special reason to pin them. The user has to opt-in with --pinned. So the tokio upgrade can be resolved with that.

Now for automatically detecting the compatibility breaking is dependent on public/private dependencies (rust-lang/rust#44663). We'll want to update the tracking issue to include cargo upgrade.

@epage
Copy link
Collaborator

epage commented Jul 27, 2022

leaving this open so we remember to update the tracking issue

@epage
Copy link
Collaborator

epage commented Jul 27, 2022

nm, I've put it in the task list for merging, see #685

@epage epage closed this as completed Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants