Target specific config for cargo dependencies not working

can we do this in a cargo.toml

[target.'cfg(target_os = "android")'.dependencies]
native-tls = {version = "0.2", features = ["vendored"]}

[target.'cfg(not(target_os = "android"))'.dependencies] 
native-tls = "0.2"

basically if its android, I want to have the vendored option, and for non-android targets use the native non-vendored option. now if i give a build for my default target cargo build --target x86_64-unknown-linux-gnu, it still includes the vendored option

I see the bug - which seems to be what i see, but it says it was fixed in 2020 feb i also tried a nightly rust just in case, no help.

That fix is shipping in Rust 1.51 (currently on the beta channel, coming to the stable channel on March 25th), and requires opting in to the new feature resolver.

Thx, I upgraded my rustc and this feature works like a charm!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.