add --ignore-patches to cargo vendor for building vendored crates for published deps #11064
Description
Problem
cargo vendor
vendors all dependencies, but only dependencies intended for use during development because cargo vendor
respects any [patch.*]
entries that are a git reference. It will vendor the copies of those dependencies defined by the git patch entry.
Sometimes building vendor/ directories that contain the dependencies that will be used once published is desirable for testing and what-not.
The only way to do this today is to manually remove the [patch.*]
entries that contain git references, and then run cargo vendor
.
Proposed Solution
Add an option such as --ignore-patches
to cargo vendor
that runs vendoring as if the git patch entries were not present, and vendor the dependencies as referenced without the git URL if it has a version specified elsewhere in the manifests.
Notes
Discussion on Zulip: https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/cargo.20vendor.20for.20multi-crate.20workspace.20package.20verification/near/297866366
Activity