diesel-rs / diesel

A safe, extensible ORM and Query Builder for Rust
https://diesel.rs
Apache License 2.0
12.79k stars 1.08k forks source link

Attempting to use feature `mysqlclient-sys` when only using `sqlite` #4316

Closed epompeii closed 1 month ago

epompeii commented 1 month ago

I'm trying to run the following command:

cargo install diesel_cli --version 2.2.4 --locked --no-default-features --features sqlite

and I get the following error:

error: Package `diesel_cli v2.2.4` does not have feature `mysqlclient-sys`. It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an implicit feature with that name

I found this issue: https://github.com/diesel-rs/diesel/issues/4056 However, I'm not using mysql; I'm using sqlite, so I don't think know why the feature mysqlclient-sys should be in play here.

Setup

I'm trying to update from 2.1.1 to 2.2.4 in a Debian Bookworm devcontainer: https://github.com/bencherdev/bencher/commit/79bbc5e237b46e025dc8fb98548037c8046dc6b3#diff-13bd9d7a30bf46656bc81f1ad5b908a627f9247be3f7d76df862b0578b534fc6R48

Versions

Feature Flags

Problem Description

I'm trying to update from 2.1.1 to 2.2.4 with sqlite and the feature mysqlclient-sys is causing an error.

What are you trying to accomplish?

I'm trying to update from 2.1.1 to 2.2.4 with sqlite.

What is the expected output?

Successful install.

What is the actual output?

error: Package `diesel_cli v2.2.4` does not have feature `mysqlclient-sys`. It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an implicit feature with that name

https://github.com/bencherdev/bencher/actions/runs/11422567315/job/31780703324#step:6:508

Are you seeing any additional errors?

No. This error kills the build.

Steps to reproduce

cargo install diesel_cli --version 2.2.4 --locked --no-default-features --features sqlite

Checklist

weiznich commented 1 month ago

Thanks for reporting, that sounds really strange.

I could not reproduce this issue with my local setup nor neither with the rust:1.82 docker container. I could reproduce it with the linked dev container. After looking a bit around there I noticed that the dev container only has rust 1.70 and not 1.82 as listed in the issue description. Updating to a newer rust version there fixed the problem. I also verified that it works fine with rust 1.78 which is the current minimal supported rust version for the latest diesel-cli release.

Closed as this seems to be an environment issue on your side, although it might be worth to fill an issue at the cargo issue tracker for the missing warning/error on install as the crate expects/declares a newer rust than what is used.