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

Don't use overly-minimal dependencies #1037

Merged
merged 1 commit into from
May 17, 2021
Merged

Conversation

kornelski
Copy link
Contributor

@kornelski kornelski commented May 16, 2021

I'm trying to get the crates ecosystem to work with -Z minimal-versions Cargo option, but many crates incorrectly specify required versions of their dependencies, including tantivy.

tantivy doesn't actually work with the versions of dependencies it specifies, and relies on them being implicitly upgraded to latest.

If actually old deps are used as specified in Cargo.toml, tantivy won't compile:

error[E0599]: no variant or associated item named `Norwegian` found for enum `Algorithm` in the current scope
  --> /Users/kornel/.cargo/registry/src/-10eda45d2c7a9533/tantivy-0.14.0/src/tokenizer/stemmer.rs:44:37
   |
44 |             Norwegian => Algorithm::Norwegian,
   |                                     ^^^^^^^^^ variant or associated item not found in `Algorithm`

error[E0277]: the trait bound `Algorithm: Clone` is not satisfied
  --> /Users/kornel/.cargo/registry/src/-10eda45d2c7a9533/tantivy-0.14.0/src/tokenizer/stemmer.rs:61:5
   |
61 |     stemmer_algorithm: Algorithm,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `Algorithm`
   |

I've upgraded all deps, because many of them have their own problems (especially in their older versions), and tantivy isn't tested in CI with minimal versions (it's impractical in the current state of the ecosystem), so it can't guarantee that old versions will remain to work.

@fulmicoton
Copy link
Collaborator

fulmicoton commented May 17, 2021

I'm ok with this change, but can we make the caret explicit?
I stupidly thought it defaulted to the = operator.

byteorder = "^1.4.3"

@fulmicoton fulmicoton merged commit 8e21087 into quickwit-oss:main May 17, 2021
@kornelski kornelski deleted the minver branch May 17, 2021 16:43
@kornelski
Copy link
Contributor Author

It is a common surprise, but I don't think it can be fixed.

Adding ^ may just perpetuate the confusion by suggesting it was necessary to add and is different from a plain version number.

@fulmicoton
Copy link
Collaborator

@kornelski that's one to see it indeed. Anyway thanks.

This was referenced Feb 18, 2022
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 this pull request may close these issues.

2 participants