Introduce --all-features
flag to cargo vendor
#12596
Labels
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-vendor
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
Problem
When using cargo vendor, the only transitive dependencies that get vendored are the ones of enabled features at the original time of vendoring. This is an issue when a user that only has access to the vendored crates later tries to enable a feature of a crate that was not originally enabled. Example flow:
cargo add tokio --features full
cargo vendor vendor_dir
mio
feature (not underfull
feature flag), but transitive dependencies were not included in vendored directory and is unable to buildProposed Solution
I propose introducing an
--all-features
flag tocargo vendor
that would vendor all optional dependencies behind any feature flags for any dependencies of a project. This is simply a convenience so that not all features have to be manually specified.Another possibility would be to have different levels for vendoring for "all features":
--all-features=top
would only vendor dependencies for all features for top level dependencies (all optional dependencies fortokio
in previous example)--all-features=recursive
would recursively vendor dependencies for all features for all dependencies (all optional depencies fortokio
andmio
and so on, in previous example)Notes
Cargo seems to have an all-features flag that is similar to what I am thinking of.
I'd be glad to contribute to this! 😃
The text was updated successfully, but these errors were encountered: