`cargo install --no-default-features` fails to build
As in title. Lots of complaints about missing crates.
Mhh, looks like --no-default-features turns off most of the default dependencies (they are still needed though) which causes the build to fail.
What do you expect when building cargo-cache with --no-default-features?
I expect a minimal version of the program. If these features are actually required for the binary, then there should be a required-features declaration: https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-required-features-field
(It is also common to have a feature "cli" or similar that enables only the minimal required features for the binary, which is often a subset of the default features.)
There is a ci-autoclean feature which only leaves in a very stripped-down version of cargo cache that only runs cargo-cache --autoclean upon launch and does nothing else.
There's also an offline_tests features that disables tests that require network connectivity for sandboxed builds.
Besides that, I don't think it is worth it to try to split up the program into multiple features, I mean if someone has a good reason and PR ready, I might consider it, but in the last 4 years, I don't think I came across a moment where I thought "oh it would be great if feature XY that is currently default would be optional".
I'm wondering if setting something like required-features = [default] would solve the build failure though.
Hm, that would probably break the ci-autoclean build then :smile: since that one tries to explicitly NOT use default features/deps, hmm....
I'm confused. If you didn't want to "split up the program into multiple features" then why are there optional dependencies?
The dependencies are optional to reduce the build time of the ci-autoclean cargo-cache to around 5 seconds instead of 1-2 mintutes.
Perhaps that could properly be handled by a flag somewhere in that build? --no-deps perhaps?