Skip to content

add --ignore-patches to cargo vendor for building vendored crates for published deps #11064

Open
@leighmcculloch

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-patchArea: [patch] table overrideC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-vendorS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions