Skip to content

cargo vendor --versioned-dirs doesn't notice that local vendored content has diverged from crate registry #11897

Open
@jhfrontz

Description

Problem

I had been hoping that I could use cargo vendor to quickly identify any unofficial/local changes to a crate.

To test this, I made an innocuous change to a local copy of a crate -- I was expecting when I did cargo vendor that it would either point out the difference (or even just silently overwrite it). However, it doesn't seem to do either.

The workaround seems to be to delete the entire vendor directory and then compare the result to what had been checked in (a la git diff --exit-code) -- after ignoring any semi-ephemeral content (e.g., git add $(find . -type f -name Cargo.lock -o -name .cargo-checksum.json))

Steps

No response

Possible Solution(s)

It's not clear to me whether this is the intended behavior for cargo vendor or not -- but if it is, there should be a major note on the man page about cargo vendor retaining local changes.

Notes

No response

Version

$ cargo version --verbose
cargo 1.65.0
release: 1.65.0
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.15.0 vendored)
libcurl: 7.29.0 (sys:0.4.55+curl-7.83.1 system ssl:NSS/3.53.1)
os: CentOS 7.9.2009 (Core) [64-bit]

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions