-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vendor): dont remove non-cached source (#15260)
### What does this PR try to resolve? Fixes #15244 With this fix, `cargo vendor` will not delete original sources, if you want to vendor things from one directory sources to the other #### Background cargo-vendor has a workaround that to mitigate #5956: it removes all cached sources in order to trigger a re-unpack. It was meant for dealing with registry sources only, but accidentally applied to directory source kind. While directory source kind was invented for vendoring, and vendoring from one vendored directory to the other seems unusual, Cargo IMO should not delete any real sources. It does not mean that registry sources are okay to delete, In long term, we should explore a way that unpacks `.crate` files directly, without any removal. See #12509 (comment) ### How should we test and review this PR? The added test should suffice. Also, although this is for fixing #15244, `cargo vendor` still doesn't support vendor from and to the same location. Unless we figure out an `rsync`-like solutin to update vendor sources, it is not going to support in short term. (And I also doubt the real world use case of it) ### Additional information
- Loading branch information
Showing
3 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters