error: one of the features ['runtime-actix-native-tls', 'runtime-async-std-native-tls', 'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', 'runtime-tokio-rustls'] must be enabled
--> /home/hugosum/.cache/cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-rt-0.5.9/src/lib.rs:9:1
|
9 | / compile_error!(
10 | | "one of the features ['runtime-actix-native-tls', 'runtime-async-std-native-tls', \
11 | | 'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', \
12 | | 'runtime-tokio-rustls'] must be enabled"
13 | | );
| |__^
error: could not compile `sqlx-rt` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed
Is there an alternative syntax for declaring feature flags for package installed from git? Why am I bumping into this issue?
Commenting that out would work fine. I thought like other package manager, Cargo would provide the dependency of an package automatically for me, but seems like this one is its peer dependency.
So you've got two copies of sqlx in your dependency tree.
By adding the git dependency to your crate's Cargo.toml it will only affect which version of sqlx your crate depends on - it won't magically go through your entire dependency tree updating all sqlx references to use that version because there's a high chance it'll break something.
If you want to override sqlx for your entire dependency tree, you might want to use one of the techniques from the Overriding Dependencies chapter of The Cargo Book.
There is no such thing as "peer dependencies" in Rust, either you depend on a crate or you don't.