Easy way to re-export dependency features in workspace?

How to easily re-export dependency features in workspace?

I have 10+ crates in the cargo workspace.
When I add a feature in a low-level crate, I want to re-export these features,
in all workspace crates that depends on that that crate.

To do this, whenever I add a feature, I often have to modify the Cargo.toml of all crates.
Any way to simplify this process? Or any way to automate this?

the easiest way it to make it default enabled. but if for some reason that's not desired, I think you can still make a "virtual" fa├žade feature (or maybe you can all it a feature "bundle") that includes all other features as dependencies, so other crates only need to use that single feature. something like:

# crate foo
# set default feature set
default = ["bundle-a"]
# define custom bundled features
bundle-a = ["abc", "xyz", "kkk",]
# possibly multiple bundle configurations
bundle-b = ["abc", "xyz",]
# actual features
abc = []
xyz = []
kkk = []
# crate bar that depends on crate foo
# use bundled feature set instead of individual features
foo = { path = "../foo", features = ["bundle-a"] }

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.