Fuckety fuck! So it looks like that with #Rust, I can't have optional and platform-specific dependencies in an easy way.

A workaround might be to have a separate crate that has a platform-specific dependency, and simply re-exports the dependency on the right platform, and a dummy interface on any other platforms.

Then, in my crate, I can do an optional, feature-bound, but platform agnostic dependency on the wrapper crate.

@algernon

Well no, it is possible, I vaguely remember doing this (but sadly long time ago, so I no longer remember the details). Basically boiled down to having a couple features for different platforms, separate optional feature(s), and specifying dependencies accordingly. While I think "it can be done" I remember it indeed could lead to "features" bloat. Having had an internal crate for a different purpose, I remember it was much more maintainable. Your mileage may wary though :)