Skip to content

cargo vendor doesn't re-vendor if the version number hasn't changed #8181

@jsgf

Description

@jsgf

Problem

cargo vendor fails to re-vendor a package if:

  • the package vendor dir has a version number (eg because it's not the most recent, or --versioned-dirs is in use)
  • the code has changed

This can happen if the code is coming from a git repo and the rev has been updated, if a patch has been added in the [patch] section of the Cargo.toml, or when switching between crates.io and git as a source.

This doesn't happen for non-versioned directories because cargo vendor unconditionally re-vendors their contents.

Possible Solution(s)
Rather than just comparing the version, it should also check for changes to the patch and/or origin specification.

Notes

Output of cargo version: 1.42, but this hasn't changed in recent versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugCommand-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