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

Changing a version of a dependency based on target causes cargo to install both versions regardless #2905

Closed
glademiller opened this issue Jul 22, 2016 · 3 comments

Comments

@glademiller
Copy link

I wanted to do this

[target.'cfg(windows)'.dependencies]
schannel = "0.0.2"
hyper = {version = "0.7", default-features = false}

[target.'cfg(unix)'.dependencies]
hyper = {version = "0.9", default-features = true}

But it always ends up installing both versions of hyper and all the dependencies for hyper 0.9.

I have observed this behaviour on Windows and have not attempted it on any other platform.

@alexcrichton
Copy link
Member

Interesting! I'm kinda surprised this works at all, I'd expect Cargo to trip an assert somewhere...

In general though I'm not sure how feasible this would be to get working, we may just have to issue a warning for awhile saying "this probably won't work".

I'll try to think about it though and see if it's plausible to get working.

@alexcrichton
Copy link
Member

I think this may have been fixed by #3123, @glademiller could you test that out and see if it works?

@glademiller
Copy link
Author

I just tested on Nightly and it does appear to be fixed.

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

No branches or pull requests

2 participants