Crates.io | cargo-gc-target |
lib.rs | cargo-gc-target |
version | 0.2.0 |
source | src |
created_at | 2021-03-28 19:08:55.687537 |
updated_at | 2021-03-28 19:08:55.687537 |
description | Cargo sub-command to delete unused files in your cargo `target` directory |
homepage | |
repository | https://github.com/oxalica/cargo-gc-target |
max_upload_size | |
id | 374776 |
size | 55,873 |
A cargo sub-command to delete unused files in your cargo target
directory.
cargo install cargo-gc-target
Your cargo version should be at least 1.51.0
.
In your project/workspace directory, simple run:
cargo gc
Note: It's gc
. Not gc-target
.
It can automatically follow custom target-dir
specified in .cargo/config
or environment variable CARGO_TARGET_DIR
.
It doesn't work well on shared target
directory, since a simple tracing GC
will erase all artifacts untracable from current workspace but may still
referenced in some other workspaces.
When resolved target directory is outside the workspace, an error will be
emitted to protect user from accidentally erasing shared target directory.
If you really know what you are doing, pass -f
to force GC anyway.
Cargo target
hierarchy and metadata calculation may change between
versions. When using cargo
other than 1.51.0
, it may incorrectly remove
tracable artifacts. Use it with care!
Path | Content | GC supported? |
---|---|---|
target/<profile>/deps |
Artifacts of dependencies | ✅ |
target/<profile>/build |
Build scripts and outputs | ✅ |
target/<profile>/.fingerprint |
Cargo fingerprints | ✅ |
target/<profile>/<bin> |
Final binary or libraries | ✅ |
target/<profile>/incremental |
Rustc incremental temps | |
target/<profile>/examples |
Example artifacts | |
target/doc |
Documentations |
MIT Licensed.