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

Compilation errors with rusqlite 0.29 #68

Closed
johnbcodes opened this issue Mar 26, 2023 · 3 comments
Closed

Compilation errors with rusqlite 0.29 #68

johnbcodes opened this issue Mar 26, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@johnbcodes
Copy link

rusqlite has removed some deprecated items with 0.29, including NO_PARAMS in this commit.

Full compatibility also requires tokio-rusqlite to be updated for which a pull request has been submitted

@czocher
Copy link
Collaborator

czocher commented Mar 27, 2023

Thanks @johnbcodes we'll have a look with @cljoly and see what we can do to stay compatible with the new versions of rusqlite, tokio-rusqlite and, if that's still possible, our MSRV which is Rust 1.61.0.

@cljoly cljoly added the bug Something isn't working label Mar 27, 2023
@cljoly cljoly pinned this issue Mar 27, 2023
@cljoly
Copy link
Owner

cljoly commented Mar 27, 2023

Thanks for submitting the PR to tokio-rusqlite and for the research @johnbcodes !

I think that there are two problems here, and that we could tackle them separately.

Make rusqlite_migration compatible with latest dependencies

We want future versions of rusqlite_migration to be compatible with the latest versions of our dependencies. And I agree with you @czocher, as much as possible, we want to keep the same MSRV. If we have to increase it though, so be it, we can’t make any promise anyway as long as rusqlite does not make promises as well.

Make rusqlite_migration properly express its dependencies

We want versions of rusqlite_migration to properly express their dependencies, i.e. if the user requests version 0.29 of rusqlite and rusqlite_migration is incompatible with it, we should get an error from the dependency solver, not a compilation error from the library.

In that regard, we currently have a bug in version 1.0.1 (and most of the previous ones IIRC), in that the Cargo.toml advertises that we support any version of rusqlite >= 0.23. That has become false with version 0.29 of rusqlite. And in general, it was a very hard promise to keep, because per Cargo conventions, rusqlite versions 0.28 and 0.29 are not necessarily compatible. It’s admittedly a mistake on my part, I should not have made a bold >= 0.23 promise.
To remediate this, we should:

cljoly added a commit that referenced this issue Mar 27, 2023
As discussed in #69, currently, version 1.0.1 of `rusqlite_migration` is
incompatible with rusqlite version 0.29. The problem is that the
Cargo.toml states the contrary, when it says:

```toml
[dependencies.rusqlite]
version = ">=0.23.0"
default-features = false
features = []
```

I think we should treat this as a bug and issue a patch release with a
fix.

This commit makes the code compatible with version 0.29. We are lucky
that such a code exists and is not too complicated.

As a result, and to fix the second related issue of insufficiently tight
version requirements on `rusqlite`, the range is not open-ended anymore
and we now constrain the upper bound as well. This means that we won’t
have to worry about breaking changes that `rusqlite` version 0.30 may
introduce.

I’ve tested this change with all the non-yanked versions of rusqlite and
it did `cargo build && cargo test tests::` without issues. The `cargo
test tests::` is to exclude documentation test as I don’t want to make
these weird due to the workaround for old `rusqlite` versions.
I’ve also run the full `cargo test` with `rusqlite` version 0.29 and
0.28, because the documentation examples should be correct for those.

Fixes #68
@cljoly
Copy link
Owner

cljoly commented Mar 29, 2023

TL;DR: if you encounter a compilation problem on rusqlite_migration in version 1.0.x, make sure you update to 1.0.2. This patch version supports rusqlite 0.29

Future versions will have much tighter dependency requirements, this is tracked in #69.

@cljoly cljoly closed this as completed Mar 29, 2023
@cljoly cljoly changed the title Incompatible with rusqlite 0.29 Compilation errors with rusqlite 0.29 Mar 29, 2023
dilawar added a commit to SubconsciousCompute/rusqlite_migration that referenced this issue Jun 2, 2023
dilawar added a commit to SubconsciousCompute/rusqlite_migration that referenced this issue Jun 2, 2023
commit 2dec23d
Author: Dilawar Singh <dilawar@subcom.tech>
Date:   Fri Jun 2 11:16:32 2023 +0530

    chore: cargo update and removed NO_PARAM

    Related: cljoly#68
@czocher czocher unpinned this issue Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants