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

Need a way of specifying features for dependencies with cargo install #4555

Closed
kjeremy opened this issue Sep 29, 2017 · 2 comments
Closed

Need a way of specifying features for dependencies with cargo install #4555

kjeremy opened this issue Sep 29, 2017 · 2 comments
Labels
A-features Area: features — conditional compilation Command-install

Comments

@kjeremy
Copy link

kjeremy commented Sep 29, 2017

cargo install diesel_cli --no-default-features --features "sqlite" fails on my windows machine because a dependent crate libsqlite3-sys can't find the sqlite headers and libs. However that crate has a feature "bundled" which will compile it's own version of sqlite. I can get around this when running cargo build on my app with diesel as a dependency:

[dependencies]
diesel = { version = "0.16.0", features = ["sqlite"] }
diesel_codegen = { version = "0.16.0", features = ["sqlite"] }
libsqlite3-sys = { version="*", features=["bundled"]}

in the Cargo.toml of my app. However there does not appear to be a way to do this using cargo install.

@spease
Copy link

spease commented Apr 20, 2018

I also just ran into this issue reinstalling diesel. I've also opened a ticket there requesting a bundled feature for diesel itself

@ehuss ehuss added the A-features Area: features — conditional compilation label Oct 11, 2018
@weihanglo
Copy link
Member

You should be able to specify features for optional dependency. Something like --features libsqlite3-sys/bundled. (-F for short)

So it would look like:

cargo install diesel_cli --no-default-features -F sqlite -F libsqlite3-sys/bundled

Given this issue is quite old and should have been resolved already by both diesel side and Cargo, I am going to close it. If it is wrong, please leave a comment and we can check it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-features Area: features — conditional compilation Command-install
Projects
None yet
Development

No branches or pull requests

5 participants