4 ms·
> Edit: also, "features" are sometimes a headache. Just spent ~one day trying to figure out how to build cross-platform static binaries when bunch of libraries
by epage 4y ago
> Edit: also, "features" are sometimes a headache. Just spent ~one day trying to figure out how to build cross-platform static binaries when bunch of libraries depend on openssl-lib. Ended up using "features" to disable it and enable "rusttls" instead, but had to also disable the default features and figure out exactly which ones I needed.
One big usability improvement for features is the addition of cargo-add which can be help in editing features with its table of whats activated.
The next is making it more explicit which optional dependencies are optional features but this requires crates to update to rust 1.60 and make some changes.
Something we are discussing is changing `defaut-features = false` and re-adding what you want to opting out of each default feature. With the current behavior it can be a pain to re-enable what you want and crates can't move existing behavior to a feature without a breaking change.
- shepmaster 4y ago> Something we are discussing is changing `defaut-features = false` I’d be generally in favor of such a change as this is what I use for all of my projects when I start out. I find it much more comfortable to deliberately opt in to things that I need as I find that I need them. The biggest pain point I’ve experienced is for features that are performance based when I am writing an application instead of a library. It’s hard to know that those exist, and that I probably do want them, I just don’t require them.
- epage 4y agoSorry, I was meaning the opposite. We'd be deprecating it and making it unavailable in future editions. Instead you have to opt out of each default feature.
- rascul 4y ago> One big usability improvement for features is the addition of cargo-add which can be help in editing features with its table of whats activated. This made feature discovery much easier for me. Previously, I would often inspect the Cargo.toml for crates I wanted to use to see what features might or might not be useful, now it's all done with 'cargo add'.