heroku / libcnb.rs

A framework for writing Cloud Native Buildpacks in Rust
BSD 3-Clause "New" or "Revised" License
34 stars 6 forks source link

Stop enabling all features by default in `libherokubuildpack` #768

Open edmorley opened 7 months ago

edmorley commented 7 months ago

By default libherokubuildpack has all Cargo features enabled: https://github.com/heroku/libcnb.rs/blob/d2b747520b1d66dc29716ffba1b0f13fcef6952d/libherokubuildpack/Cargo.toml#L21

It's then up to consumers of the crate to know that they probably should disable features they aren't using, to save pulling in lots of unnecessary dependencies.

Whilst this reduces the confusion/friction for people who don't know how to enable a Cargo feature (since everything works out of the box), its very rare that anyone needs all features, so literally every consumer should really switch to default-features = false eventually.

Lots of consumers of the crate aren't doing this (even those maintained by experienced Rust users), eg:

And even the ones that are, often are doing so only because I fixed them:

We should either not enable any features by default, or only enable the most commonly used ones (eg logging).