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

Version incompatibility when upgrading to 1.0.3 #77

Closed
simon-an opened this issue Aug 31, 2023 · 4 comments · Fixed by #82
Closed

Version incompatibility when upgrading to 1.0.3 #77

simon-an opened this issue Aug 31, 2023 · 4 comments · Fixed by #82
Assignees

Comments

@simon-an
Copy link

Hey there,

if someone is facing an issue because of indexmap was upgraded as part of a patch version you can just pin this crate like this:

openapiv3 = "=1.0.2" # pinned because paperclip does not support indexmap v2.0.0 which cames with 1.0.3

Thanks for not doing proper semver by expecting everyone just pins all depencies by default. 👎

@ahl
Copy link
Collaborator

ahl commented Aug 31, 2023

1.0.3 accepts a range of indexmap versions. You should not need to upgrade to 2.0.0. Happy to help you work through whatever issues you've encountered when upgrading.

@ahl ahl changed the title Upgrading to a major version of a dependency within a patch release Version incompatibility when upgrading to 1.0.3 Aug 31, 2023
@tiagolobocastro
Copy link
Contributor

tiagolobocastro commented Sep 8, 2023

I just seen this on another issue. The problem is that paperclip uses version 1 so it creates type incompatibility:

   = note: `IndexMap<_, _>` and `IndexMap<String, Value>` have similar names, but are actually distinct types
note: `IndexMap<_, _>` is defined in crate `indexmap`
  --> /Users/tiagocastro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/indexmap-1.9.3/src/map.rs:71:1
   |
71 | pub struct IndexMap<K, V, S = RandomState> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `IndexMap<String, Value>` is defined in crate `indexmap`
  --> /Users/tiagocastro/.cargo/registry/src/index.crates.io-6f17d22bba15001f/indexmap-2.0.0/src/map.rs:81:1

From what I can tell by having this ">=1.6.1, <3.0.0" actually it picks 2.0 because the latest dep serde_yaml has ^2.0 so this can never work with paperclip. I made it work by doing this hack:

cargo update -p [email protected] --precise "1.9.3"
cargo update -p serde_yaml --precise "0.9.21"

So how to fix this? We can upgrade paperclip to use index map 2 though I feel this may still be brittle if openapiv3 changes again to allow for a future index map v3 for example..

EDIT: paperclip-rs/paperclip#508

@msrd0
Copy link
Contributor

msrd0 commented Sep 12, 2023

I just ran into this problem again. It seems to be a problem whenever there is a dependency wanting ^1.0 and one wanting ^2.0, making cargo pick "whatever of the two it feels like" for openapiv3. It is probably best to always pick one of the two version for public dependencies.

@jayvdb
Copy link

jayvdb commented Dec 13, 2023

note https://crates.io/crates/openapiv3/1.0.3 has been yanked

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

Successfully merging a pull request may close this issue.

5 participants