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

Upgrade workspace's crate version #426

Closed
maxv-rust opened this issue Oct 24, 2020 · 2 comments · Fixed by #736
Closed

Upgrade workspace's crate version #426

maxv-rust opened this issue Oct 24, 2020 · 2 comments · Fixed by #736

Comments

@maxv-rust
Copy link

maxv-rust commented Oct 24, 2020

Hello,

I have a workspace where I have multiple crates: crate_a, crate_b, crate_c.

I have to put both version and path for the crates from my workspace into the Cargo.toml (to allow crates to be published at crates.io):

[package]
name="crate_c"
version="0.0.9"

[dependencies]
crate_a = { version = "0.0.5", path = "../crate_a" }
crate_b = { version = "0.0.7", path = "../crate_b" }

Unfortunately cargo upgrade doesn't work in that case.

I'm able to fix that maxv-rust@8b4bfa3 but I'm not sure if you're interested in that kind of changes.

Please let me know what is the best way to fix the issue:

  • should I just open a PR with my changes (probably not) or
  • should I explain the problem better or
  • could you please suggest what will be the better approach to solve the problem.

Have a great day,
MaxV

@epage
Copy link
Collaborator

epage commented Aug 26, 2021

Let me see if I understand the steps

  • Upgrade crate_a to 1.0.0
  • Run crate_c $ cargo upgrade and expect it to change from pointing to crate_a 0.0.5 to 1.0.0?

Not a maintainer but I think thats understandable. Even better will be with my next steps after #482 where crate_a $ cargo set-version 1.0.0 will update crate_c for you.

@epage
Copy link
Collaborator

epage commented Aug 26, 2021

I'm a little uncertain about the proposed fix. I think it will leading to surprising behavior if make merge_dependencies aware of this.

Instead, I would expect the sync lock file and upgrade functions to check that its a path dependency and generate the appropriate Dependency.

epage added a commit to epage/cargo-edit that referenced this issue Jul 14, 2022
With path and git dependencies, you can specify a version for use with
the registry.  If its incompatible, I believe the resolver will fail, so
we don't need to handle that case.  That just leaves `--to-lockfile`.
This just means post-poning the check for the registry to be in the
non-lockfile case.

Fixes killercup#426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants