Skip to content

Cached package cleanup for Cargo

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

inejge/cargo-cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cached package cleanup for Cargo

Cargo keeps a local cache of downloaded dependencies. Over time, as dependencies are updated, this cache can grow pretty large, and full of outdated package versions which are unlikely to be used ever again. This tool can help you discover which packages are no longer needed. In the present, proof-of-concept form, only packages published on crates.io and present in the default registry are considered, and no automatic deletion is supported.

Installation

$ cargo install cargo-cleanup

Usage

Run

$ cargo cleanup

in the top-level directory of some crate. This will automatically try to use Cargo.lock from that directory. (Alternatively, you can specify the path of Cargo.lock as an argument to the command.) The program will read the names and versions of all dependencies, then scan the Cargo unpacked crate cache ($HOME/.cargo/registry/src/*/...) and list the packages whose names are in the list, but versions aren't. For example, if your crate uses rand-0.3.22 and rand-0.4.3, and the cache contains those two plus rand-0.5.5, only rand-0.5.5 will be listed.

Caveat

This is a proof of concept. There is no automatic deletion. Packages retrieved directly from their repositories are not considered. Neither are alternative registries.

License

Licensed under either of:

at your option.

About

Cached package cleanup for Cargo

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages